{"id":32105505,"url":"https://github.com/fnebenfuehr/worktree-cli","last_synced_at":"2026-01-20T17:01:24.797Z","repository":{"id":318964718,"uuid":"1077103685","full_name":"fnebenfuehr/worktree-cli","owner":"fnebenfuehr","description":"A modern CLI tool for managing git worktrees with ease","archived":false,"fork":false,"pushed_at":"2025-12-14T15:03:07.000Z","size":277,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-16T23:18:23.008Z","etag":null,"topics":["ai-coding","claude-code","cursor","git-worktree","mcp"],"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/fnebenfuehr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2025-10-15T19:28:53.000Z","updated_at":"2025-12-14T15:02:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6206f15-08dd-4b0e-bbf6-54fff720b502","html_url":"https://github.com/fnebenfuehr/worktree-cli","commit_stats":null,"previous_names":["fnebenfuehr/worktree-cli"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fnebenfuehr/worktree-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnebenfuehr%2Fworktree-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnebenfuehr%2Fworktree-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnebenfuehr%2Fworktree-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnebenfuehr%2Fworktree-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnebenfuehr","download_url":"https://codeload.github.com/fnebenfuehr/worktree-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnebenfuehr%2Fworktree-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-coding","claude-code","cursor","git-worktree","mcp"],"created_at":"2025-10-20T06:45:23.816Z","updated_at":"2026-01-20T17:01:24.781Z","avatar_url":"https://github.com/fnebenfuehr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/@fnebenfuehr/worktree-cli.svg)](https://www.npmjs.com/package/@fnebenfuehr/worktree-cli)\n[![license](https://img.shields.io/npm/l/@fnebenfuehr/worktree-cli.svg)](https://github.com/fnebenfuehr/worktree-cli/blob/main/LICENSE)\n\n# Worktree CLI\n\nGit worktree management for AI coding assistants. Enables parallel development across multiple branches without context switching.\n\n## Why?\n\nAI coding assistants work best with isolated contexts. Git worktrees give each task its own directory—no stashing, no branch switching, no conflicts. Your AI can work on a feature while you review a PR in another worktree.\n\n## Quick Start\n\n```bash\n# Install\nnpm install -g @fnebenfuehr/worktree-cli\n\n# Convert existing repo to worktree structure\ncd your-project \u0026\u0026 worktree setup\n\n# Create a feature worktree\nworktree create feat/new-feature\n```\n\nSee [docs/QUICKSTART.md](./docs/QUICKSTART.md) for detailed setup guide.\n\n## MCP Integration\n\nAdd to your Claude Code or AI assistant config:\n\n```json\n{\n  \"mcpServers\": {\n    \"worktree\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@fnebenfuehr/worktree-cli\", \"mcp\"]\n    }\n  }\n}\n```\n\nYour AI assistant can now:\n- Check worktree status before modifications\n- Create isolated worktrees for features/fixes\n- Switch between work contexts\n- Checkout PRs for review\n- Clean up merged branches\n\n### MCP Tools\n\n| Tool | Description |\n|------|-------------|\n| `worktree_status` | Check if repo uses worktrees, current branch, default branch |\n| `worktree_list` | List all worktrees with branches and paths |\n| `worktree_create` | Create new worktree with branch |\n| `worktree_checkout` | Intelligent checkout: switch/create from local/remote |\n| `worktree_pr` | Checkout GitHub PR by number or URL |\n| `worktree_switch` | Switch to existing worktree |\n| `worktree_remove` | Remove worktree (with merge safety checks) |\n| `worktree_setup` | Convert repo to worktree structure |\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `worktree clone \u003curl\u003e` | Clone repo into worktree-ready structure |\n| `worktree setup` | Convert existing repo to worktrees |\n| `worktree create \u003cbranch\u003e` | Create worktree and branch |\n| `worktree checkout \u003cbranch\u003e` | Smart checkout: switch or create from local/remote |\n| `worktree pr \u003cnumber\\|url\u003e` | Checkout PR branch |\n| `worktree switch [branch]` | Switch to worktree (interactive if no branch) |\n| `worktree list` | List all worktrees |\n| `worktree remove \u003cbranch\u003e` | Remove worktree |\n| `worktree update` | Update CLI to latest version |\n\n## Configuration\n\nCreate `.worktree.json` in your repo root (auto-generated by `setup`/`clone`):\n\n```json\n{\n  \"defaultBranch\": \"main\",\n  \"post_create\": [\"npm install\"],\n  \"pre_remove\": [\"docker compose down\"],\n  \"copy_files\": [\".env\", \".env.local\"]\n}\n```\n\n| Option | Description |\n|--------|-------------|\n| `defaultBranch` | Base branch for new worktrees |\n| `post_create` | Commands to run after creating worktree |\n| `pre_remove` | Commands to run before removing worktree |\n| `post_remove` | Commands to run after removing worktree |\n| `copy_files` | Files to copy from main worktree |\n\nHooks receive environment variables: `WORKTREE_PATH`, `WORKTREE_BRANCH`, `WORKTREE_MAIN_PATH`.\n\n## Comparison\n\n| Task | Manual Git | Worktree CLI |\n|------|------------|--------------|\n| Create feature branch | `git worktree add -b feat/x ../feat-x origin/main` | `worktree create feat/x` |\n| Switch context | `cd ../other-worktree` | `worktree switch other` |\n| Setup new repo | Multiple commands + directory management | `worktree clone \u003curl\u003e` |\n| Post-create setup | Manual: install deps, copy .env | Automatic via hooks |\n| PR review | Stash → checkout → review → checkout → pop | `worktree pr 123` |\n| AI integration | Manual git commands | Native MCP server |\n\n## Directory Structure\n\nAfter setup, your repo looks like:\n\n```\nproject/\n├── main/           # default branch worktree\n├── feat-auth/      # feature worktree\n└── fix-bug/        # bugfix worktree\n```\n\nEach directory is a complete working copy with shared git history.\n\n## Documentation\n\n- [Quick Start Guide](./docs/QUICKSTART.md)\n- [AI Coding Workflows](./docs/AI_WORKFLOWS.md)\n- [Hooks Configuration](./docs/HOOKS.md)\n\n## License\n\nMIT\n\n## Links\n\n- [Issues](https://github.com/fnebenfuehr/worktree-cli/issues)\n- [Discussions](https://github.com/fnebenfuehr/worktree-cli/discussions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnebenfuehr%2Fworktree-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnebenfuehr%2Fworktree-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnebenfuehr%2Fworktree-cli/lists"}