vibe shell-setup
The shell-setup command prints a shell wrapper function that lets vibe change your current working directory after creating or cleaning up worktrees. It can also emit a fish or zsh autocompletion script alongside the wrapper.
vibe shell-setupvibe shell-setup --shell <name>vibe shell-setup --shell fish --with-completionvibe shell-setup --shell zsh --with-completionBy default the command detects your shell from $SHELL and prints the wrapper to stdout. Pipe the output to eval (bash / zsh) or source (fish) — see Shell Setup for per-shell installation snippets.
Options
Section titled “Options”--shell <name>
Section titled “--shell <name>”Force the output for a specific shell, bypassing $SHELL detection. Supported values: bash, zsh, fish, nushell, powershell.
vibe shell-setup --shell zsh--with-completion
Section titled “--with-completion”Append a shell autocompletion script after the wrapper function. Currently supported for fish and zsh; using it with bash/nushell/powershell exits with an error.
vibe shell-setup --shell fish --with-completion | sourceeval "$(vibe shell-setup --shell zsh --with-completion)"The completion script covers:
- All subcommands and their descriptions (
vibe <Tab>) - Per-subcommand flags (
vibe start --<Tab>) - Local branch names for
vibe start <Tab>(viagit for-each-ref refs/heads) - Worktree branch names for
vibe jump <Tab>(viagit worktree list --porcelain)
Zsh users must call
autoload -Uz compinit && compinitin~/.zshrcbefore theevalline. Ifcompinithas not run, the completion registration is silently skipped and thevibewrapper is still defined.
-V, --verbose
Section titled “-V, --verbose”Show the detected shell on stderr in addition to the wrapper on stdout.
vibe shell-setup --verbose-q, --quiet
Section titled “-q, --quiet”Suppress non-essential output.
Behavior
Section titled “Behavior”stdout receives the wrapper function (and completion script when --with-completion is set) so the output can be piped directly to eval / source without extra parsing. Logs, warnings, and errors go to stderr so they never leak into the eval pipeline.
If $SHELL cannot be detected and --shell is not provided, the command exits with code 1 and prints an error to stderr.
Examples
Section titled “Examples”# Auto-detect shell (zsh / bash style)eval "$(vibe shell-setup)"
# Force fish wrapper outputvibe shell-setup --shell fish | source
# Fish wrapper + tab completion in one linevibe shell-setup --shell fish --with-completion | source
# Zsh wrapper + tab completion in one line (requires compinit beforehand)eval "$(vibe shell-setup --shell zsh --with-completion)"Related
Section titled “Related”- Shell Setup - End-to-end setup instructions per shell
- Installation - Install vibe and provision your shell