Document CLI shell completion (viam completion)#5005
Document CLI shell completion (viam completion)#5005shannonbradshaw wants to merge 2 commits intomainfrom
Conversation
rdk#5947 enabled urfave/cli v3 shell completion, adding a hidden `viam completion` subcommand that outputs completion scripts for bash, zsh, fish, and PowerShell. Add setup instructions to the CLI overview and a reference entry for the completion command. https://claude.ai/code/session_01EFZQ9UyvXPCRPfr1XcAXC7
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Adds documentation for the newly introduced viam completion subcommand so users can enable interactive shell tab-completion across supported shells.
Changes:
- Documented the
viam completioncommand and its supported shell arguments in the CLI reference. - Added an “Enable shell completion” section to the CLI overview with per-shell setup instructions and tab-completion examples.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/cli/reference.md | Adds a new completion command entry and links back to setup instructions. |
| docs/cli/overview.md | Adds shell-specific setup steps (bash/zsh/fish/PowerShell) and example usage for tab completion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{% /tab %}} | ||
| {{% tab name="fish" %}} | ||
|
|
||
| ```sh {class="command-line" data-prompt="$"} |
There was a problem hiding this comment.
Fixed in 15b6345. Added mkdir -p ~/.config/fish/completions before the redirect.
Generated by Claude Code
| The CLI supports tab completion for commands, subcommands, and flag names. | ||
| To enable it, source the completion script for your shell. | ||
|
|
There was a problem hiding this comment.
| ### `completion` | ||
|
|
||
| The `completion` command outputs a shell completion script. | ||
| Source the output in your shell to enable tab completion for commands, subcommands, and flag names. |
There was a problem hiding this comment.
- Replace "source" with "load" in both overview and reference since fish and PowerShell do not use source - Add mkdir -p for the fish completions directory https://claude.ai/code/session_01EFZQ9UyvXPCRPfr1XcAXC7
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |

Source changes
viamcommand. Adds a hiddenviam completionsubcommand that emits completion scripts for bash, zsh, fish, and PowerShell. Every command now responds to--generate-shell-completionso the scripts can query live completions for subcommand names and flag names.Docs changes
docs/cli/overview.md: Added "Enable shell completion" section with setup instructions for bash, zsh, fish, and PowerShell, using tabbed code blocks. Includes usage examples showing tab completion for commands and flags.docs/cli/reference.md: Addedcompletioncommand entry documenting the four supported shell arguments (bash, zsh, fish, pwsh) with a link back to the overview setup instructions.How I found these
EnableShellCompletion: trueadded tocli/app.goroot commandviam completion bash|zsh|fish|pwshGenerated by daily docs change agent