Thanks for your interest in contributing! Here's how to get started.
# Clone the repo
git clone https://github.com/claude-sync/claude-sync.git
cd claude-sync
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run in watch mode during development
npm run devsrc/
cli/ CLI commands (init, sync, status, etc.)
backends/ Sync backends (git, cloud, syncthing, rsync, custom)
core/ Core functionality (merger, encryption, watcher, etc.)
hooks/ Session lifecycle hooks
types.ts TypeScript type definitions
bin/ CLI entry point
tests/ Test files
docs/ Documentation
Open an issue with:
- Your OS, Node.js version, and claude-sync version
- Backend type you're using
- Steps to reproduce
- Expected vs actual behavior
- Output of
claude-sync status --json
Open an issue describing:
- The use case (what are you trying to do?)
- Proposed solution
- Alternatives you've considered
- Fork the repo and create a branch from
main - Write your code
- Add tests for new functionality
- Ensure all tests pass:
npm test - Ensure TypeScript compiles:
npm run build - Open a PR with a clear description
Backends follow the strategy pattern. To add a new backend:
- Create a new file in
src/backends/ - Implement the
SyncBackendinterface fromsrc/types.ts - Register it in
src/cli/helpers.ts(getBackendfunction) - Add it to the init wizard in
src/cli/init.ts - Add tests
- Add documentation in
docs/
- TypeScript strict mode
- No
anytypes (except where absolutely necessary with a comment) - Async/await over raw promises
- Descriptive variable names
- JSDoc comments for public APIs
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run a specific test file
npx vitest run tests/merger.test.tsTests that require external tools (git, age, rsync) are automatically skipped if the tool isn't installed.
By contributing, you agree that your contributions will be licensed under the MIT License.