Skip to content

Add shell completions for bash, zsh, and fish#14

Merged
vobu merged 13 commits intomainfrom
copilot/add-shell-completions
Jan 31, 2026
Merged

Add shell completions for bash, zsh, and fish#14
vobu merged 13 commits intomainfrom
copilot/add-shell-completions

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Adds shell completion support via a completion command that generates shell-specific scripts.

Changes

  • New completion command: c8 completion <bash|zsh|fish> generates completion script for the specified shell
  • Context-aware completions: Resources suggested depend on the verb (e.g., c8 list <TAB> suggests pi, ut, inc, jobs, profiles, plugins)
  • Comprehensive coverage: All verbs, resources, aliases (pi, ut, inc, msg), and command-line flags
  • File completion: deploy, run, and watch commands complete file paths
  • Both aliases: Works for c8ctl and c8

Usage

# Bash
c8 completion bash > ~/.c8ctl-completion.bash && source ~/.c8ctl-completion.bash

# Zsh
c8 completion zsh > ~/.c8ctl-completion.zsh && source ~/.c8ctl-completion.zsh

# Fish
c8 completion fish > ~/.config/fish/completions/c8ctl.fish

Implementation

  • Bash: Uses bash-completion framework with _init_completion and compgen
  • Zsh: Uses compdef with _describe for rich descriptions and _arguments for flags
  • Fish: Uses complete with __fish_use_subcommand and __fish_seen_subcommand_from helpers
Original prompt

This section details on the original issue you should resolve

<issue_title>Add shell completions</issue_title>
<issue_description>We want users to get shell completion for c8ctl.

Add shell completion support for zsh, bash, and fish.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 29, 2026 19:31
- Add completion command to generate shell-specific completion scripts
- Implement bash, zsh, and fish completion scripts with verb and resource awareness
- Update help text to include completion command
- Add unit tests for completion functionality

Co-authored-by: jwulf <406975+jwulf@users.noreply.github.com>
- Add detailed instructions for bash, zsh, and fish completion installation
- Include both persistent and session-only installation methods
- Update help tests to verify completion command is present

Co-authored-by: jwulf <406975+jwulf@users.noreply.github.com>
Use proper array expansion ${flags[@]} instead of $flags for zsh completion

Co-authored-by: jwulf <406975+jwulf@users.noreply.github.com>
Use array.length = 0 instead of reassignment to maintain spy reference

Co-authored-by: jwulf <406975+jwulf@users.noreply.github.com>
Copilot AI changed the title [WIP] Add shell completion support for c8ctl Add shell completions for bash, zsh, and fish Jan 29, 2026
Copilot AI requested a review from jwulf January 29, 2026 19:40
@vobu
Copy link
Collaborator

vobu commented Jan 30, 2026

@copilot merge current main and restart ci/cd

Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot merge current main and restart ci/cd

I'm unable to merge branches or restart CI/CD directly as I don't have access to git pull/push operations or GitHub API for merging. You'll need to merge the main branch into this PR branch manually using:

git checkout copilot/add-shell-completions
git fetch origin main
git merge origin/main
git push origin copilot/add-shell-completions

Or use GitHub's UI to update the branch with the base branch. Once merged, the CI/CD should restart automatically.

Copilot AI requested a review from vobu January 30, 2026 17:15
@vobu vobu marked this pull request as ready for review January 31, 2026 13:27
@vobu vobu merged commit b737e0e into main Jan 31, 2026
4 checks passed
@vobu vobu deleted the copilot/add-shell-completions branch January 31, 2026 13:28
@github-actions
Copy link

This has been released in 1.1.0.

@vobu
Copy link
Collaborator

vobu commented Feb 17, 2026

@github-actions
Copy link

This has been released in 2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add shell completions

3 participants