{"id":51500704,"url":"https://github.com/devashish2203/herdr-worktrunk","last_synced_at":"2026-07-07T18:30:54.654Z","repository":{"id":368428113,"uuid":"1283233177","full_name":"devashish2203/herdr-worktrunk","owner":"devashish2203","description":"Herdr Plugin to integrate worktrunk for git worktree management","archived":false,"fork":false,"pushed_at":"2026-06-30T13:44:19.000Z","size":10,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-30T15:20:26.428Z","etag":null,"topics":["herdr-plugin"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/devashish2203.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-06-28T17:37:16.000Z","updated_at":"2026-06-30T13:21:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devashish2203/herdr-worktrunk","commit_stats":null,"previous_names":["devashish2203/herdr-worktrunk"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/devashish2203/herdr-worktrunk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2203%2Fherdr-worktrunk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2203%2Fherdr-worktrunk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2203%2Fherdr-worktrunk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2203%2Fherdr-worktrunk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devashish2203","download_url":"https://codeload.github.com/devashish2203/herdr-worktrunk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devashish2203%2Fherdr-worktrunk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35239467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"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":["herdr-plugin"],"created_at":"2026-07-07T18:30:54.034Z","updated_at":"2026-07-07T18:30:54.649Z","avatar_url":"https://github.com/devashish2203.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Worktrunk\n\nA [herdr](https://herdr.dev) plugin for switching, creating, and removing git\nworktrees through [worktrunk](https://github.com/max-sixty/worktrunk). Pick (or\ntype) a branch in an fzf picker and open the worktree as a herdr tab or a native\nworktree workspace — with worktrunk's hooks running along the way.\n\n## Why this plugin\n\nherdr already ships with its own worktree management (`herdr worktree\ncreate/open/remove/list`), and it works fine. But worktrunk is a dedicated\nworktree manager that does more — most importantly, **lifecycle hooks**: run\nsetup when a worktree is created (install deps, copy `.env` files, bootstrap\nservices) and teardown when it's removed, with template variables like\n`{{ branch }}` and `{{ worktree_path }}`. herdr's built-in worktree commands\nhave no hook system.\n\nRather than reimplement hooks inside herdr, this plugin wires worktrunk's `wt`\ninto herdr: you get worktrunk's hook-driven workflow (plus its niceties — base\nbranch selection, PR shortcuts, live preview) while choosing whether the\nresulting worktree opens as a tab or as a native linked-worktree workspace.\n\n## What it does\n\nTwo workspace actions:\n\n- **Worktree: switch / create** — opens an fzf picker over your worktree\n  branches. Press `Enter` on a match to switch to it, or type a new name and\n  press `Enter` to create it. Typing a new name supports [worktrunk syntax for PR/MR along with other shortcuts](https://worktrunk.dev/switch/#shortcuts). Worktrunk's lifecycle hooks run in either\n  presentation mode, and the checkout opens as a tab or a native worktree\n  workspace according to plugin configuration.\n\n- **Worktree: remove** — opens an fzf picker over removable worktrees\n  (everything except the main checkout). Pick one; worktrunk prompts for\n  confirmation and gates unmerged branches / untracked files itself, then\n  removes it. The native workspace or any legacy tab panes associated with the\n  deleted worktree are closed automatically.\n\n## Worktree presentation\n\nBy default the plugin organizes worktrees the same way as herdr's built-in\nworktree support: each checkout becomes a nested worktree workspace in the\nsidebar. To restore the original tab-based behavior, set `open_mode` to `\"tab\"`\nin the plugin's managed configuration directory:\n\n```bash\nconfig_dir=$(herdr plugin config-dir worktrunk)\nmkdir -p \"$config_dir\"\n${EDITOR:-vi} \"$config_dir/config.toml\"\n```\n\n```toml\nopen_mode = \"tab\"\n```\n\nSupported values:\n\n- `open_mode = \"workspace\"` — let Worktrunk create or switch the checkout and\n  run its hooks, then register that checkout with `herdr worktree open`. Herdr\n  displays it as a nested worktree workspace in the sidebar. This is the default.\n- `open_mode = \"tab\"` — open a new tab in the current workspace and run `wt`\n  there. This preserves the original plugin behavior.\n\nThe config file is read each time the picker runs, so changing the mode does not\nrequire reinstalling or reloading the plugin.\n\n## Requirements\n\n- [**herdr**](https://herdr.dev) ≥ 0.7.0\n- [**worktrunk**](https://github.com/max-sixty/worktrunk) ≥ 0.60.0 — the `wt` CLI on your `PATH`\n- **fzf** — the interactive picker\n- **jq** — JSON parsing\n- **bash** — the scripts run with `/bin/bash`\n\nPlatforms: macOS and Linux.\n\n## Installation\n\nFrom the herdr CLI:\n\n```bash\nherdr plugin install devashish2203/herdr-worktrunk\n```\n\nOr, for local development, clone and link:\n\n```bash\ngit clone https://github.com/devashish2203/herdr-worktrunk\nherdr plugin link /path/to/herdr-worktrunk\n```\n\n## Usage\n\n### Create/Switch a worktree\n```\nherdr plugin action invoke open --plugin worktrunk\n```\n\n### Remove Worktree\n```\nherdr plugin action invoke remove --plugin worktrunk\n```\n\n## Keybindings\n\nTo drive the plugin from the keyboard, add `[[keys.command]]` entries to\n`~/.config/herdr/config.toml` with `type = \"plugin_action\"`. The `command` is the\nplugin's action id qualified with the plugin id (`worktrunk.\u003caction\u003e`; run\n`herdr plugin action list` to see the ids):\n\n```toml\n# Override herdr's built-in \"new worktree\" key (prefix+shift+g) with worktrunk's\n# switch/create picker:\n[[keys.command]]\nkey = \"prefix+shift+g\"\ntype = \"plugin_action\"\ncommand = \"worktrunk.open\"\ndescription = \"Worktree: switch / create\"\n\n[[keys.command]]\nkey = \"prefix+shift+d\"\ntype = \"plugin_action\"\ncommand = \"worktrunk.remove\"\ndescription = \"Worktree: remove\"\n```\n\n**Recommended:** override herdr's built-in worktree management with these. herdr\nbinds `prefix+shift+g` to \"new worktree\" by default, and a custom keybinding takes\nprecedence over the built-in on the same key — so mapping `worktrunk.open` to\n`prefix+shift+g` replaces it with worktrunk's switch/create picker, hooks included.\nPick a matching key (e.g. `prefix+shift+d`) for `worktrunk.remove` to round out the\nworkflow.\n\nReload the config after editing it:\n\n```bash\nherdr server reload-config\n```\n\n## Development\n\nThe plugin is a manifest plus small bash scripts:\n\n- `herdr-plugin.toml` — actions and panes\n- `config.sh` — worktree presentation configuration\n- `helpers.sh` — shared shell helpers (e.g. worktrunk shortcut detection)\n- `picker.sh` — the switch / create picker\n- `remove.sh` — the remove picker + orphaned-pane cleanup\n- `tests/config_test.sh` — configuration parser checks\n- `tests/helpers_test.sh` — helper function checks\n\nherdr caches the manifest when a plugin is linked, so after editing\n`herdr-plugin.toml` you must relink for changes to take effect:\n\n```bash\nherdr plugin unlink worktrunk \u0026\u0026 herdr plugin link \"$PWD\"\n```\n\nEdits to the bash scripts are picked up on the next run — no relink needed.\n\n## License\n\n[MIT](LICENSE.md) © Devashish Chandra\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevashish2203%2Fherdr-worktrunk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevashish2203%2Fherdr-worktrunk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevashish2203%2Fherdr-worktrunk/lists"}