{"id":47593773,"url":"https://github.com/eval/bonchi","last_synced_at":"2026-04-01T17:49:34.144Z","repository":{"id":344157990,"uuid":"1180669785","full_name":"eval/bonchi","owner":"eval","description":"A git worktree manager 🌳","archived":false,"fork":false,"pushed_at":"2026-03-13T21:41:25.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-13T22:17:22.115Z","etag":null,"topics":["git","worktree-manager"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/eval.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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-03-13T09:32:37.000Z","updated_at":"2026-03-13T21:41:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eval/bonchi","commit_stats":null,"previous_names":["eval/bonchi"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/eval/bonchi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Fbonchi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Fbonchi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Fbonchi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Fbonchi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eval","download_url":"https://codeload.github.com/eval/bonchi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Fbonchi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["git","worktree-manager"],"created_at":"2026-04-01T17:49:33.459Z","updated_at":"2026-04-01T17:49:34.132Z","avatar_url":"https://github.com/eval.png","language":"Ruby","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"bonchi.svg\" alt=\"Bonchi\" width=\"120\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eBonchi\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eGit worktree manager with automatic port allocation, file copying, and project setup\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rubygems.org/gems/bonchi\"\u003e\u003cimg src=\"https://img.shields.io/gem/v/bonchi.svg?style=flat-square\u0026color=blue\" alt=\"Gem Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/eval/bonchi/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/eval/bonchi/ci.yml?branch=main\u0026style=flat-square\u0026label=CI\" alt=\"CI Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://rubygems.org/gems/bonchi\"\u003e\u003cimg src=\"https://img.shields.io/gem/dt/bonchi.svg?style=flat-square\u0026color=orange\" alt=\"Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#project-config\"\u003eProject Config\u003c/a\u003e •\n  \u003ca href=\"#global-config\"\u003eGlobal Config\u003c/a\u003e\n\u003c/p\u003e\n\nInspired by [tree-me](https://github.com/haacked/dotfiles/blob/main/bin/README-tree-me.md).\n\n## Install\n\n```sh\ngem install bonchi\n```\n\n## Setup\n\nAdd to your `~/.zshrc` or `~/.bashrc`:\n\n```sh\nsource \u003c(bonchi shellenv)\n```\n\nThis gives you auto-cd (jumps into the worktree after create/switch/pr) and tab completions.\n\n## Usage\n\n```sh\n  bonchi init                  # Generate a .worktree.yml in the current project\n  bonchi create BRANCH [BASE]  # Create new branch + worktree (alias for switch -c)\n  bonchi pr NUMBER_OR_URL      # Checkout GitHub PR in worktree\n  bonchi switch BRANCH         # Switch to branch in worktree\n  bonchi remove BRANCH         # Remove a worktree (and merged branch)\n  bonchi rmf BRANCH            # Force-remove a worktree (and merged branch)\n  bonchi rmrf BRANCH           # Force-remove a worktree and branch\n  bonchi list                  # List all worktrees\n  bonchi setup [-- ARGS...]    # Run setup in current worktree (ports, copy, pre_setup, setup cmd)\n  bonchi shellenv              # Output shell function for auto-cd + completions\n  bonchi prune                 # Prune stale worktree admin files\n  bonchi version               # Print version\n  bonchi help [COMMAND]        # Describe available commands or one specific command\n```\n\nRun `bonchi help \u003ccommand\u003e` for detailed info on any command.\n\nWorktrees are created at `~/dev/worktrees/\u003crepo\u003e/\u003cbranch\u003e`. Customize via global config or `WORKTREE_ROOT` env var (env var takes precedence).\n\n## Project config\n\nDrop a `.worktree.yml` in your project root:\n\n```yaml\nmin_version: 0.4.0\n\ncopy:\n  - mise.toml\n  - .env.local\n\nlink:\n  - node_modules\n  - vendor/bundle\n\nports:\n  - PORT\n  - WEBPACK_PORT\n\nreplace:\n  mise.toml:\n    - \"^PORT=.*\": \"PORT=$PORT\"\n\npre_setup:\n  - mise trust\n\nsetup: mise exec -- bin/setup\n```\n\n| Key | Description |\n|-----|-------------|\n| `min_version` | Minimum bonchi version required (aborts with upgrade message if not met) |\n| `copy` | Files copied from main worktree before setup |\n| `link` | Files symlinked from main worktree (useful for large directories like `node_modules`) |\n| `ports` | Env var names — unique ports allocated from a global pool |\n| `replace` | Regex replacements in files — env vars (`$VAR`) are expanded (see below) |\n| `pre_setup` | Commands run before the setup command (env vars are available) |\n| `setup` | The setup command to run (default: `bin/setup`) |\n\n`bonchi create` auto-runs setup when `.worktree.yml` exists. Skip with `--no-setup`.\n\n### Replace\n\nUse `replace` to do regex-based find-and-replace in files. Env vars (`$VAR`) are expanded in replacement values.\n\n```yaml\nreplace:\n  # Short form\n  mise.toml:\n    - \"^PORT=.*\": \"PORT=$PORT\"\n  # Full form (with optional missing: warn, default: halt)\n  .env.local:\n    - match: \"^DATABASE_URL=.*\"\n      with: \"DATABASE_URL=postgres:///myapp_$WORKTREE_BRANCH_SLUG\"\n      missing: warn\n```\n\n### Environment variables\n\nThe following env vars are available in `replace` values and `pre_setup` commands:\n\n| Variable | Example | Description |\n|----------|---------|-------------|\n| `$WORKTREE_MAIN` | `/Users/me/projects/myapp` | Full path to the main worktree |\n| `$WORKTREE_LINKED` | `/Users/me/dev/worktrees/myapp/my-feature` | Full path to the linked worktree |\n| `$WORKTREE_ROOT` | `/Users/me/dev/worktrees` | Root directory for all worktrees |\n| `$WORKTREE_BRANCH` | `feat/new-login` | Branch name |\n| `$WORKTREE_BRANCH_SLUG` | `feat_new_login` | Branch name with non-alphanumeric chars replaced by `_` |\n| `$PORT`, ... | `4012` | Any port names listed under `ports` |\n\n## Global config\n\nSettings are stored in `~/.bonchi.yml` (or `$XDG_CONFIG_HOME/bonchi/config.yml`):\n\n```yaml\nworktree_root: ~/worktrees\n\nport_pool:\n  min: 4000\n  max: 5000\n```\n\n| Key | Description |\n|-----|-------------|\n| `worktree_root` | Where worktrees are created (default: `~/dev/worktrees`) |\n| `port_pool.min` | Minimum port number (default: 4000) |\n| `port_pool.max` | Maximum port number (default: 5000) |\n\nStale port allocations for removed worktrees are pruned automatically.\n\n## Development\n\n```bash\n# Setup\nbin/setup  # Make sure it exits with code 0\n\n# Run tests\nrake\n```\n\nUsing [mise](https://mise.jdx.dev/) for env-vars is recommended.\n\n### Releasing\n\n1. Update `lib/bonchi/version.rb`  \n   ```\n   bin/rake 'gem:write_version[0.5.0]'\n   # commit\u0026push\n   # check CI\n   ```\n1. Tag\n   ```\n   gem_push=no bin/rake release\n   ```\n1. Release workflow from GitHub Actions...\n   - ...publishes to RubyGems (with Sigstore attestation)\n   - ...creates git GitHub release after successful publish\n1. Update `version.rb` for next dev-cycle\n   ```\n   bin/rake 'gem:write_version[0.6.0.dev]'\n   ```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feval%2Fbonchi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feval%2Fbonchi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feval%2Fbonchi/lists"}