{"id":28546252,"url":"https://github.com/tobiase/worktree-utils","last_synced_at":"2025-07-07T06:31:20.434Z","repository":{"id":297007053,"uuid":"995228047","full_name":"tobiase/worktree-utils","owner":"tobiase","description":"A command-line tool that enhances Git worktrees with project-specific navigation, environment syncing, and seamless branch switching. Single binary, self-installing, works everywhere Git does.","archived":false,"fork":false,"pushed_at":"2025-06-27T17:47:17.000Z","size":326,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T18:55:39.062Z","etag":null,"topics":["cli","command-line","developer-tools","git","git-tools","golang","productivity","workflow","worktree"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tobiase.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2025-06-03T06:53:46.000Z","updated_at":"2025-06-27T05:56:13.000Z","dependencies_parsed_at":"2025-06-03T21:22:10.429Z","dependency_job_id":"f84577cc-89c3-41bb-b8d4-48e238b9c7ad","html_url":"https://github.com/tobiase/worktree-utils","commit_stats":null,"previous_names":["tobiase/worktree-utils"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tobiase/worktree-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiase%2Fworktree-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiase%2Fworktree-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiase%2Fworktree-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiase%2Fworktree-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobiase","download_url":"https://codeload.github.com/tobiase/worktree-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobiase%2Fworktree-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264027552,"owners_count":23546096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","command-line","developer-tools","git","git-tools","golang","productivity","workflow","worktree"],"created_at":"2025-06-09T23:09:09.124Z","updated_at":"2025-07-07T06:31:20.429Z","avatar_url":"https://github.com/tobiase.png","language":"Go","readme":"# wt - Git Worktree Manager\n\n![Tests](https://github.com/tobiase/worktree-utils/workflows/Tests/badge.svg)\n![contributions not accepted](https://img.shields.io/badge/contributions-not%20accepted-red.svg)\n\nA fast, project-aware Git worktree manager that simplifies working with multiple branches.\n\n## Status\n\nThis is a personal utility project. While public for ease of access, I'm not accepting external contributions at this time.\n\n## Features\n\n- 🚀 **Quick Navigation** - Switch between worktrees instantly with `wt go` or `wt 0`, `wt 1`\n- 🧠 **Smart Commands** - `wt new feature` works regardless of branch state (new/existing/has worktree)\n- 🔍 **Fuzzy Matching** - `wt go mai` automatically switches to `main`, with smart suggestions\n- 📖 **Universal Help** - All commands support `--help`/`-h` with detailed documentation\n- 📁 **Project-Specific Commands** - Define custom navigation shortcuts per project\n- 🔄 **Environment Sync** - Copy `.env` files between worktrees\n- 🛠️ **Self-Installing** - Single binary that sets itself up\n- 🎯 **Smart Detection** - Automatically loads commands based on current project\n- ⌨️ **Shell Completion** - Intelligent tab completion for commands, branches, and flags\n\n## Installation\n\n### Quick Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/tobiase/worktree-utils/main/get.sh | sh\n```\n\n### Prebuilt Binaries\n\nDownload the latest releases from the [GitHub releases page](https://github.com/tobiase/worktree-utils/releases).\n\n### Build from Source\n\n```bash\ngit clone https://github.com/tobiase/worktree-utils.git\ncd worktree-utils\nmake build\n./wt-bin setup\n```\n\n## Usage\n\n### Core Commands\n\n```bash\n# List all worktrees\nwt list                    # or: wt ls\n\n# Smart worktree creation (handles any branch state)\nwt new feature-branch      # Creates branch + worktree OR switches if exists\nwt new feature --base main # Create from specific base branch\n\n# Quick navigation with fuzzy matching\nwt go 1                    # Switch by index\nwt go feature-branch       # Switch by exact name\nwt go feat                 # Fuzzy match to 'feature-branch'\nwt go mai                  # Auto-switches to 'main'\nwt 0                       # Direct shortcut to first worktree\nwt 1                       # Direct shortcut to second worktree\n\n# Smart removal with suggestions\nwt rm feature-branch       # Remove by exact name\nwt rm feat                 # Fuzzy match for removal\n\n# Get help for any command\nwt go --help               # Detailed help for 'go' command\nwt new -h                  # Short help flag also works\n```\n\n### Intelligent Behavior\n\n`wt` uses \"Do What I Mean\" design - commands understand your intent and provide helpful guidance:\n\n```bash\n# Fuzzy matching with auto-resolution\n$ wt go mai\n# → Automatically switches to 'main' (unambiguous match)\n\n# Smart suggestions for ambiguous input\n$ wt go te\n# → Shows interactive picker: [test-branch, test-feature, temp-fix]\n\n# Helpful error messages\n$ wt go xyz\n# → \"branch 'xyz' not found. Did you mean:\n#     1. main\n#     2. fix-xyz-bug\n#     3. feature-xyz\"\n\n# Smart worktree creation\n$ wt new existing-branch\n# → \"Switched to existing worktree 'existing-branch'\" (no error!)\n\n$ wt new new-branch\n# → Creates branch + worktree + switches (handles everything)\n```\n\n### Utility Commands\n\n```bash\n# Copy .env files to another worktree\nwt env-copy feature-branch\nwt env-copy feature-branch --recursive\n\n# Initialize project configuration\nwt project init myproject\n```\n\n### Project-Specific Commands\n\nCreate project-specific navigation commands that only appear when you're in that project:\n\n```yaml\n# ~/.config/wt/projects/myproject.yaml\nname: myproject\nmatch:\n  paths:\n    - /Users/you/projects/myproject\n    - /Users/you/projects/myproject-worktrees/*\ncommands:\n  dash:\n    description: \"Go to dashboard\"\n    target: \"apps/dashboard\"\n  api:\n    description: \"Go to API\"\n    target: \"services/api\"\n```\n\nNow `wt dash` and `wt api` are available only in the myproject repository.\n\n## Shell Completion\n\nwt provides intelligent shell completion for commands, branches, and flags to enhance your workflow.\n\n### Installation\n\nCompletion is automatically installed when you run the setup command:\n\n```bash\nwt setup\n```\n\n### Manual Installation\n\nFor existing installations or custom setups:\n\n```bash\n# Bash users\nwt completion bash \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n\n# Zsh users\nwt completion zsh \u003e\u003e ~/.zshrc\nsource ~/.zshrc\n\n# Or use with eval for temporary testing\neval \"$(wt completion bash)\"\neval \"$(wt completion zsh)\"\n```\n\n### Features\n\n- **Command completion**: Tab-complete all wt commands and aliases (`list`, `ls`, `go`, `switch`, etc.)\n- **Branch completion**: Intelligent branch name suggestions for relevant commands\n- **Flag completion**: Complete command flags with descriptions (e.g., `--base`, `--recursive`)\n- **Project commands**: Auto-complete project-specific commands when available\n- **Context-aware**: Different completions based on command position and context\n\n### Setup Options\n\nControl completion installation during setup:\n\n```bash\n# Install with auto-detected shell completion (default)\nwt setup\n\n# Install with specific shell completion\nwt setup --completion bash\nwt setup --completion zsh\n\n# Install without completion\nwt setup --no-completion\n```\n\n## Configuration\n\nConfiguration files are stored in `~/.config/wt/`:\n\n```\n~/.config/wt/\n├── init.sh              # Shell integration\n├── completion.bash      # Bash completion script\n├── completion.zsh       # Zsh completion script\n└── projects/            # Project-specific configs\n    ├── project1.yaml\n    └── project2.yaml\n```\n\n## Documentation\n\n- [Git Commands Reference](docs/GIT_COMMANDS.md) - Detailed documentation of the underlying git commands\n\n## Uninstall\n\n```bash\nwt setup --uninstall\n```\n\nThen remove the initialization line from your shell config (`.bashrc`, `.zshrc`, etc.).\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobiase%2Fworktree-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobiase%2Fworktree-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobiase%2Fworktree-utils/lists"}