Skip to content

Add shell completions (CLI subcommand + nix packaging)#107

Open
antono wants to merge 2 commits into
bartolli:mainfrom
antono:feature/shell-completion
Open

Add shell completions (CLI subcommand + nix packaging)#107
antono wants to merge 2 commits into
bartolli:mainfrom
antono:feature/shell-completion

Conversation

@antono
Copy link
Copy Markdown
Contributor

@antono antono commented May 22, 2026

Summary

  • New codanna completions <bash|zsh|fish|elvish|powershell> subcommand, generated from the clap definitions via clap_complete so it stays in sync with the CLI automatically.
  • The Nix flake package now ships bash/zsh/fish completions (installShellFiles + postInstall), so they're installed automatically with the package — no extra config for home-manager / NixOS users.
  • Surfaces the previously-undocumented profile command (and the new completions) in the custom help text.

Details

  • completions is emitted immediately after argument parsing — before any config/index/provider setup — so it works without an initialized project.
  • Bumps rust-overlay in flake.lock to a rustc 1.95 revision. This is required because the committed Cargo.lock pins sysinfo 0.39.2 (needs rustc ≥1.95); the flake previously resolved to 1.94 and failed to build.

Testing

  • cargo check and cargo fmt --all clean.
  • Built .#packages.default with the committed flake.lock; confirmed completions ship to:
    • share/bash-completion/completions/codanna.bash
    • share/zsh/site-functions/_codanna
    • share/fish/vendor_completions.d/codanna.fish
  • Sourced the generated bash script; top-level commands and retrieve subcommands complete correctly.

Usage

codanna completions bash > ~/.local/share/bash-completion/completions/codanna
source <(codanna completions bash)   # current shell only

antono added 2 commits May 22, 2026 17:59
- Generate bash/zsh/fish/elvish/powershell scripts via clap_complete
- Emit before any config/index setup runs
- Surface previously-hidden `profile` + new `completions` in help
- postInstall installs bash/zsh/fish completions via installShellFiles
- bump rust-overlay to rustc 1.95 (Cargo.lock sysinfo 0.39.2 needs >=1.95)
@github-actions
Copy link
Copy Markdown
Contributor

✅ Quick checks success

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant