gh vibe shell-setup
Prints a shell snippet that wraps gh so that gh vibe review <PR> will
cd your shell into the freshly-created worktree on success.
gh vibe shell-setup [--shell=<bash|zsh|fish|pwsh>]Without --shell, the calling shell is auto-detected from $SHELL (or
$PSModulePath for PowerShell). Pass --shell= explicitly when generating
a snippet to commit to a different shell’s rc file.
Install
Section titled “Install”bash / zsh
Section titled “bash / zsh”# ~/.bashrc or ~/.zshrceval "$(gh vibe shell-setup)"gh vibe shell-setup --shell=fish | sourcePowerShell
Section titled “PowerShell”# $PROFILEgh vibe shell-setup --shell=pwsh | Out-String | Invoke-ExpressionAfter reloading the shell:
gh vibe review 123 # creates the worktree AND cd's you into itSupported shells
Section titled “Supported shells”| Shell | Tested |
|---|---|
bash | ✅ bash -n parse-check + end-to-end |
zsh | ✅ zsh -n parse-check |
fish | ✅ fish -n parse-check |
pwsh (PowerShell 7+) | ✅ [scriptblock]::Create parse-check |
bash and zsh share one POSIX-compatible snippet; fish and pwsh get
shell-specific wrappers.
Safety
Section titled “Safety”The shell-setup snippets are designed not to compromise your interactive shell:
- The wrapper detects an existing user-defined
ghfunction or alias and refuses to install in that case (prints a warning to stderr). - The wrapper only evaluates output fenced by the
# __ghvibe_v1_begin__…# __ghvibe_v1_end__sentinels (regular#comments in every supported shell), so unrelatedghstdout can never be executed as shell code. - The binary itself only emits shell commands when invoked via the wrapper
(it looks for
GH_VIBE_SHELL=v1in env) and stdout is not a TTY. If you set the env var manually in an interactive shell, gh-vibe falls back to normal mode with a warning.
Uninstall
Section titled “Uninstall”Remove the corresponding line from your shell rc / profile file and reload the shell.