Skip to content

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.

Terminal window
vibe shell-setup
vibe shell-setup --shell <name>
vibe shell-setup --shell fish --with-completion
vibe shell-setup --shell zsh --with-completion

By 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.

Force the output for a specific shell, bypassing $SHELL detection. Supported values: bash, zsh, fish, nushell, powershell.

Terminal window
vibe shell-setup --shell zsh

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.

Terminal window
vibe shell-setup --shell fish --with-completion | source
eval "$(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> (via git for-each-ref refs/heads)
  • Worktree branch names for vibe jump <Tab> (via git worktree list --porcelain)

Zsh users must call autoload -Uz compinit && compinit in ~/.zshrc before the eval line. If compinit has not run, the completion registration is silently skipped and the vibe wrapper is still defined.

Show the detected shell on stderr in addition to the wrapper on stdout.

Terminal window
vibe shell-setup --verbose

Suppress non-essential output.

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.

Terminal window
# Auto-detect shell (zsh / bash style)
eval "$(vibe shell-setup)"
# Force fish wrapper output
vibe shell-setup --shell fish | source
# Fish wrapper + tab completion in one line
vibe 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)"