{"id":50120209,"url":"https://github.com/sauravpanda/bonsai","last_synced_at":"2026-05-23T18:05:30.788Z","repository":{"id":349466851,"uuid":"1200694733","full_name":"sauravpanda/bonsai","owner":"sauravpanda","description":"Friendly CLI for managing git worktrees.","archived":false,"fork":false,"pushed_at":"2026-04-16T19:02:29.000Z","size":83,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T20:16:07.105Z","etag":null,"topics":["ai-workflow","claude-code","cli","cursor","developer-tools","git","git-worktree","golang"],"latest_commit_sha":null,"homepage":null,"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/sauravpanda.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-03T18:07:48.000Z","updated_at":"2026-04-16T18:11:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sauravpanda/bonsai","commit_stats":null,"previous_names":["sauravpanda/bonsai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sauravpanda/bonsai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2Fbonsai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2Fbonsai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2Fbonsai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2Fbonsai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sauravpanda","download_url":"https://codeload.github.com/sauravpanda/bonsai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2Fbonsai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33406518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","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":["ai-workflow","claude-code","cli","cursor","developer-tools","git","git-worktree","golang"],"created_at":"2026-05-23T18:05:08.009Z","updated_at":"2026-05-23T18:05:30.769Z","avatar_url":"https://github.com/sauravpanda.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bonsai\n\n`bonsai` is a friendly CLI for managing git worktrees.\n\nIf AI coding tools keep spawning branches and worktrees all over a repo, bonsai helps keep things tidy. It shows what exists, what is stale, what has a PR, what still has unpushed work, and what is safe to clean up.\n\n## Why bonsai?\n\n`git worktree` is powerful, but the day-to-day experience is still pretty manual:\n\n- hard to see everything at a glance\n- easy to forget stale worktrees\n- annoying to tell what has been pushed or merged\n- no quick cleanup flow\n\n`bonsai` fixes that with a small CLI that feels made for real branch-heavy workflows.\n\n## Install\n\n```bash\ngo install github.com/sauravpanda/bonsai@latest\n```\n\nOr from source:\n\n```bash\ngit clone https://github.com/sauravpanda/bonsai\ncd bonsai\nmake install\n```\n\nRequirements:\n\n- Go 1.21+\n- Optional: [GitHub CLI](https://cli.github.com/) for PR status and PR creation\n\n## Quick Start\n\n```bash\nbonsai new feat/search\nbonsai list\nbonsai push --pr --remove\nbonsai clean\n```\n\nTypical flow:\n\n1. Create a worktree for a task.\n2. See all active worktrees in one place.\n3. Push and open a PR when the work is ready.\n4. Clean up merged or stale worktrees without guesswork.\n\n## Core Commands\n\n### `bonsai list`\n\nSee every worktree with branch, age, last commit, ahead/behind status, and PR state.\n\n```bash\nbonsai list\nbonsai list --no-pr\nbonsai list --offline\n```\n\nExample output:\n\n```text\n  #   PATH                              BRANCH                AGE    LAST COMMIT              +/-      PR\n  ──────────────────────────────────────────────────────────────────────────────────────────────────────\n      ~/projects/myapp                  main                  2h     chore: bump deps         +0/-0    -\n  1   .claude/worktrees/feat-auth       feat/auth             3d     add OAuth flow           +4/-0    open\n  2   .claude/worktrees/fix-payments    fix/payments          21d    fix stripe webhook       +0/-0    merged\n  3   .claude/worktrees/feat-dashboard  feat/dashboard        8d     WIP: new dashboard       +2/-0    none\n```\n\n### `bonsai new \u003cbranch\u003e`\n\nCreate a new worktree and branch from the configured base branch.\n\n```bash\nbonsai new feat/search\nbonsai new fix/login --base develop\nbonsai new spike/idea --open\n```\n\n### `bonsai push [branch-or-path]`\n\nPush a worktree branch, optionally create a PR, and optionally remove the worktree afterward.\n\n```bash\nbonsai push\nbonsai push feat/search\nbonsai push --pr\nbonsai push --web\nbonsai push --pr --remove\n```\n\n### `bonsai clean`\n\nOpen an interactive picker for merged, stale, or otherwise removable worktrees.\n\n```bash\nbonsai clean\nbonsai clean --all\nbonsai clean --stale 7\nbonsai clean --force\n```\n\nKeys: `up/down` move, `space` toggle, `a` select all, `n` select none, `enter` confirm, `q` quit\n\n### `bonsai prune`\n\nReview deletion candidates one by one in a non-TUI flow.\n\n```bash\nbonsai prune\nbonsai prune --dry-run\nbonsai prune -y\n```\n\n### `bonsai rm \u003cn\u003e [n...]`\n\nRemove worktrees by the numbers shown in `bonsai list`.\n\n```bash\nbonsai rm 2\nbonsai rm 1 3 5\nbonsai rm --dry-run 2\nbonsai rm --force 2\n```\n\n## More Useful Commands\n\n```bash\nbonsai switch      # interactive picker that prints a cd command\nbonsai status      # dashboard view of working tree state\nbonsai stats       # summary across all worktrees\nbonsai sync        # rebase or merge all worktrees from base\nbonsai open 2      # open a worktree in your editor\nbonsai snapshot    # archive a worktree before deleting it\nbonsai doctor      # detect broken or orphaned worktrees\n```\n\n## Safety Defaults\n\n- Never deletes worktrees with unpushed commits unless `--force` is used\n- Supports `--dry-run` on destructive flows\n- Gracefully works without GitHub auth\n- Uses the `gh` CLI instead of managing GitHub tokens directly\n\n## Configuration\n\nGlobal config lives at `~/.config/bonsai/config.toml`.\n\n```toml\nstale_threshold_days = 14\ndefault_remote = \"origin\"\ndefault_base = \"main\"\nticket_pattern = \"([A-Z]+-\\\\d+)\"\n```\n\nPer-repo overrides are supported with `.bonsai.toml` at the repo root.\n\n## GitHub Integration\n\nIf `gh` is installed and authenticated, bonsai can:\n\n- show PR status in `bonsai list`\n- detect merged branches for cleanup\n- open PRs from `bonsai push --pr`\n\nSetup:\n\n```bash\ngh auth login\n```\n\nWithout `gh`, bonsai still works. GitHub-specific fields just fall back to unknown status.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravpanda%2Fbonsai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsauravpanda%2Fbonsai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravpanda%2Fbonsai/lists"}