ggcode provides built-in shell completion powered by Cobra. No external tools are needed.
Add to ~/.bashrc:
source <(ggcode completion bash)For persistent completion file installation:
ggcode completion bash > /etc/bash_completion.d/ggcodeAdd to ~/.zshrc:
source <(ggcode completion zsh)If you get "compinit" errors, ensure the completion directory is in fpath:
ggcode completion zsh > "${fpath[1]}/_ggcode"Write to the fish completions directory:
ggcode completion fish > ~/.config/fish/completions/ggcode.fishAdd to your PowerShell profile:
ggcode completion powershell | Out-String | Invoke-Expression| Category | Examples |
|---|---|
| Subcommands | config, completion, resume, mcp |
| Flags | --help, --model, --resume, --vendor |
| Session IDs | Previous session IDs for --resume |
| MCP server names | Configured server names for tab completion |
After installing, open a new shell and test:
ggcode <TAB>
ggcode config <TAB>
ggcode --resume <TAB>