Skip to content

Document CLI shell completion (viam completion)#5005

Open
shannonbradshaw wants to merge 2 commits intomainfrom
claude/cli-shell-completion
Open

Document CLI shell completion (viam completion)#5005
shannonbradshaw wants to merge 2 commits intomainfrom
claude/cli-shell-completion

Conversation

@shannonbradshaw
Copy link
Copy Markdown
Collaborator

Source changes

  • cli: enable shell autocomplete rdk#5947: Enable urfave/cli v3 shell completion on the root viam command. Adds a hidden viam completion subcommand that emits completion scripts for bash, zsh, fish, and PowerShell. Every command now responds to --generate-shell-completion so 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: Added completion command entry documenting the four supported shell arguments (bash, zsh, fish, pwsh) with a link back to the overview setup instructions.

How I found these

  • Diff scan: EnableShellCompletion: true added to cli/app.go root command
  • Grep: searched entire docs repo for "shell completion", "tab completion", "autocomplete", "bash completion", "zsh completion", "completions", "--generate-bash-completion" — zero existing references found
  • Verified command behavior by building the CLI and testing viam completion bash|zsh|fish|pwsh

Generated by daily docs change agent

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
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 15b6345
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/69e89806f55fc40008cfacff
😎 Deploy Preview https://deploy-preview-5005--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 43 (🟢 up 4 from production)
Accessibility: 99 (no change from production)
Best Practices: 92 (🟢 up 9 from production)
SEO: 89 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Apr 22, 2026
@shannonbradshaw shannonbradshaw requested a review from Copilot April 22, 2026 09:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 completion command 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.

Comment thread docs/cli/overview.md
{{% /tab %}}
{{% tab name="fish" %}}

```sh {class="command-line" data-prompt="$"}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 15b6345. Added mkdir -p ~/.config/fish/completions before the redirect.


Generated by Claude Code

Comment thread docs/cli/overview.md
Comment on lines +208 to +210
The CLI supports tab completion for commands, subcommands, and flag names.
To enable it, source the completion script for your shell.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 15b6345. Changed "source" to "load" throughout.


Generated by Claude Code

Comment thread docs/cli/reference.md Outdated
### `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.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 15b6345. Changed "Source" to "Load" to be shell-agnostic.


Generated by Claude Code

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants