kabu automates repetitive setup when creating a git worktree / jj workspace.
- Create directories (
mkdir) - Create symlinks (
link) - Copy files (
copy) - Run hooks before/after add/remove (requires trust)
Supported VCS: Git (git worktree), jj (jj workspace), and colocated repositories.
Install (see INSTALL.md for other methods):
cargo install kabuCreate .kabu/config.yaml:
# yaml-language-server: $schema=https://raw.githubusercontent.com/h-michael/kabu/main/schema/kabu.schema.json
on_conflict: backup
mkdir:
- path: .cache
link:
- source: .env.local
copy:
- source: .env.example
target: .envCreate a worktree/workspace:
kabu add ../feature-xValidate config if needed:
kabu config validateShell integration is optional, but required for kabu cd.
Bash:
eval "$(kabu init bash)"Zsh:
eval "$(kabu init zsh)"Fish:
kabu init fish | sourcePowerShell:
Invoke-Expression (& kabu init powershell | Out-String)Elvish:
eval (kabu init elvish | slurp)# Create with setup
kabu add ../feature-x
# Create new branch/bookmark
kabu add -b feature-x ../feature-x
# Preview only
kabu add --dry-run ../feature-x
# Skip setup and run only VCS add
kabu add --no-setup ../feature-xkabu list
kabu ls
kabu list --path-only# Safe remove (warns on dirty or unpushed state)
kabu remove ../feature-x
# Remove current worktree/workspace
kabu remove --current
# Preview only
kabu remove --dry-run ../feature-x
# Skip checks and confirmation
kabu remove --force ../feature-x# Requires shell integration
kabu cd
# Works without shell integration
cd "$(kabu path)"Config files:
- Repo local:
.kabu/config.yamlor.kabu/config.toml - YAML is used when both exist
- JSON Schema:
schema/kabu.schema.json
Use {{...}} placeholders in templates (for example {{branch}}, {{repository}}).
For full config keys and behavior, use CLI help:
kabu config --help
kabu config <subcommand> --helpHooks are opt-in by trust:
kabu trust
kabu trust --check
kabu untrustkabu remove warns about:
- Uncommitted changes
- Unpushed commits (git)
- Commits not on remote bookmarks (jj)
Use --force only when you intentionally want to bypass checks.
kabu auto-detects VCS and maps commands:
- git:
git worktree add/remove/list - jj:
jj workspace add/forget/list - colocated repo: jj commands are preferred
CLI terminology keeps worktree/workspace together to avoid ambiguity.
- Command overview:
kabu --help - Command details:
kabu <subcommand> --help - Config reference:
kabu config --help - Man page:
kabu man - Task-oriented examples:
examples/README.md
View generated man page directly:
kabu man | man -l -This project is licensed under the MIT License. See LICENSE-MIT.