{"id":48871257,"url":"https://github.com/leokun/aisync","last_synced_at":"2026-05-24T07:01:53.102Z","repository":{"id":351568117,"uuid":"1210817369","full_name":"leokun/aisync","owner":"leokun","description":"Sync AI tool configurations between git worktrees","archived":false,"fork":false,"pushed_at":"2026-05-16T20:43:58.000Z","size":244,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T21:46:51.184Z","etag":null,"topics":["ai","claude","cli","cursor","developer-tools","git-worktree"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leokun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T19:36:05.000Z","updated_at":"2026-05-16T20:44:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leokun/aisync","commit_stats":null,"previous_names":["leokun/aisync"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/leokun/aisync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leokun%2Faisync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leokun%2Faisync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leokun%2Faisync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leokun%2Faisync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leokun","download_url":"https://codeload.github.com/leokun/aisync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leokun%2Faisync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33424573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude","cli","cursor","developer-tools","git-worktree"],"created_at":"2026-04-15T22:03:31.559Z","updated_at":"2026-05-24T07:01:53.094Z","avatar_url":"https://github.com/leokun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aisync\n\n[![CI](https://github.com/leokun/aisync/actions/workflows/ci.yml/badge.svg)](https://github.com/leokun/aisync/actions/workflows/ci.yml)\n\n\u003e Sync AI tool configurations between git worktrees.\n\nAI tools store their configs in the working tree (`.claude/`, `.cursor/`, `CLAUDE.md`, etc.). These files often aren't tracked by git - whether gitignored, local-only, or simply absent in new worktrees.\n\n**aisync** copies your AI environment from one worktree to another in a single command.\n\n## Install\n\nOne-shot via npx:\n\n```bash\nnpx @leokun-wasabee/aisync\n```\n\nOr install globally for a shorter command:\n\n```bash\npnpm add -g @leokun-wasabee/aisync\n# or: npm install -g @leokun-wasabee/aisync\n\naisync --version\n```\n\nThe examples below use the global `aisync` command. Replace with `npx @leokun-wasabee/aisync` if you prefer not to install globally.\n\n## Usage\n\n### Copy configs to a new worktree\n\n```bash\naisync copy . ../feature-auth\n```\n\nCopies all detected AI provider configs from the current worktree to the target.\n\n### Re-sync later\n\n```bash\ncd ../feature-auth\naisync copy\n```\n\nUses the `aisync-lock.json` saved from the first copy to re-sync from the original source.\n\n### Bootstrap missing provider configs\n\n```bash\naisync init\n```\n\nDetects your cross-tool base (`AGENTS.md`, `.agents/`) and generates missing provider-specific configs that reference it.\n\n### Check what's detected\n\n```bash\naisync status\naisync list providers\naisync list worktrees\n```\n\n### Symlink instead of copy\n\n```bash\naisync link . ../feature-auth\n```\n\nCreates relative symlinks instead of copying files. Edits in the source are reflected immediately in the destination.\n\n### Watch and re-sync automatically\n\n```bash\naisync watch\n```\n\nWatches every participating worktree and re-syncs changes to all the others. Edits flow both ways: a change in the \"main\" worktree propagates to \"feature-auth\", and an edit in \"feature-auth\" propagates back.\n\nParticipants are determined from `aisync-lock.json` files: the source plus every sibling whose lock points back at the source. If no worktree has a lock yet (first run), all non-bare siblings are included as a bootstrap. The sync mode (`copy` or `link`) is inherited from the first lock found.\n\nLoops are suppressed via an in-flight write guard. Hash equality short-circuits redundant events, so re-saving a file without changes does not trigger a re-sync.\n\n### Auto-sync on `git checkout`\n\n```bash\naisync hook install\naisync hook remove\n```\n\nInstalls (or removes) a `post-checkout` git hook that runs `aisync copy` after switching branches or creating a new worktree.\n\n### Shell completion\n\naisync ships completion scripts for bash, zsh, and fish:\n\n```bash\n# bash\naisync completion bash \u003e /etc/bash_completion.d/aisync\n\n# zsh (directory must be on $fpath)\naisync completion zsh \u003e ~/.zfunc/_aisync\n\n# fish\naisync completion fish \u003e ~/.config/fish/completions/aisync.fish\n```\n\n### Diagnose sync state\n\n```bash\naisync doctor\n```\n\nCompares the destination's `aisync-lock.json` against the source and the local files. Reports per-item status:\n\n- `synced` : everything matches the lock\n- `stale` : source has changed since the last sync\n- `drift` : destination has local edits\n- `conflict` : both source and destination changed\n- `missing-source` / `missing-dest` : a tracked path no longer exists\n\nUse `--json` for machine-readable output. Exit code is `1` when conflicts are present (CI-friendly).\n\n### Clean a synced worktree\n\n```bash\naisync clean              # remove items + lock from current worktree\naisync clean --dry-run    # preview\naisync clean --all        # clean every worktree that has a lock\n```\n\nRemoves files and folders listed in `aisync-lock.json`, then deletes the lock file itself.\n\n## Supported providers\n\n| Provider | Files |\n|----------|-------|\n| Claude Code | `.claude/`, `CLAUDE.md` |\n| Cursor | `.cursor/`, `.cursorrules` |\n| OpenAI Codex | `.codex/` |\n| GitHub Copilot | `.github/copilot/` |\n| Windsurf | `.windsurf/`, `.windsurfrules` |\n| Cline | `.clinerules` |\n| Aider | `.aider.conf.yml`, `CONVENTIONS.md` |\n| Cross-tool | `AGENTS.md`, `.agents/` |\n\n### Interactive selection\n\nWhen you run `copy`, `link`, or `init` in a TTY without `--only` or `--exclude`, aisync prompts you to pick which providers to sync. Pass `--only` / `--exclude` to skip the prompt, or use `-i, --interactive` to force it.\n\n### Pull configs from another worktree\n\n```bash\naisync pull                       # auto-detect a sibling worktree\naisync pull ../main               # explicit source\naisync pull ../main --link        # symlink instead of copy\n```\n\n`pull` is the inverse of `copy`: instead of pushing the current worktree to a destination, it brings configs from another worktree into the current directory.\n\n## Options\n\n```\n--only \u003cprovider\u003e     Sync only specific providers (repeatable)\n--exclude \u003cprovider\u003e  Exclude providers (repeatable)\n--dry-run             Show what would happen without doing it\n--force               Overwrite existing files (and drifted local edits)\n--link, -l            Use symlinks instead of copy (pull only; copy/link behave by command, watch inherits mode from existing locks)\n--verbose             Detailed output\n--quiet, -q           Suppress info output (warnings/errors only)\n--interactive, -i     Force interactive provider selection\n```\n\n### Drift protection\n\nWhen `copy` or `pull` detects that a destination file has been modified locally since the last sync (its hash no longer matches `aisync-lock.json`), it skips the file and reports a `drift` warning instead of silently overwriting. Pass `--force` to overwrite drifted files.\n\n## Configuration\n\naisync reads two config files and merges them, with project values overriding global values key by key:\n\n| Level | Location |\n|-------|----------|\n| Global | `$XDG_CONFIG_HOME/aisync/config.json` (defaults to `~/.config/aisync/config.json`). On Windows: `%APPDATA%/aisync/config.json`. |\n| Project | `.aisyncrc` at the project root (JSON). |\n\nSupported keys: `source`, `only`, `exclude`, `providers`, `templates`.\n\n```json\n{\n  \"only\": [\"claude\", \"cursor\"],\n  \"source\": \"../main\"\n}\n```\n\nPut your favorite providers in the global config to skip the prompt in every repo, and override per-project as needed.\n\n## Why\n\nAI configs live in the working tree, not in `.git/`. Whether they're gitignored, local-only, or just not committed - a new worktree won't have them. You end up copying files by hand or writing fragile shell scripts.\n\nThis scales poorly, especially with agent orchestrators (Superset, Conductor, Emdash) that spin up dozens of worktrees in parallel.\n\n### Orchestrator integration\n\n```bash\n# .conductor/setup.sh\naisync copy \"$CONDUCTOR_MAIN_WORKTREE\" \"$(pwd)\" --force\n```\n\n## Release (maintainers)\n\n```bash\npnpm release patch        # bumps 0.9.0 -\u003e 0.9.1\npnpm release minor        # bumps 0.9.x -\u003e 0.10.0\npnpm release major        # bumps 0.x.x -\u003e 1.0.0\npnpm release 1.2.3        # explicit version\npnpm release patch --dry-run   # preview pipeline\n```\n\n`scripts/release.sh` handles version bump (package.json + src/index.ts), lint, tests, build, `CHANGELOG.md` entry, commit, tag, push, npm publish, and GitHub release in one pipeline.\n\n## Roadmap\n\n- **v0.1.0** - Copy + init\n- **v0.2.0** - Symlink mode (`aisync link`)\n- **v0.3.0** - More providers (Windsurf, Cline, Aider) + interactive selection\n- **v0.4.0** - Config file (`.aisyncrc`)\n- **v0.5.0** - Full interactive wizard\n- **v0.6.0** - File watching + git hooks\n- **v0.7.0** - Maintenance: `doctor` + `clean` (current)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleokun%2Faisync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleokun%2Faisync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleokun%2Faisync/lists"}