drmikecrowe / argc-completions

Completions for any shell. Supports 1000+ commands. Automaticlly generate completion definition from help text and man page.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Argc-completions

Argc-completions provides completion definitions that work for any shell.

argc-completions

Features

  • Add 1000+ completion definitions (full list)
  • Automatically generate a completion script from the command's help text or man page.
  • Lazy completing, lower memory consumption and faster startup time
  • Support multiple shells: bash/zsh/powershell/fish/nushell/elvish/xonsh/tcsh
  • Support multiple platforms: windows/macOS/linux

Amazing features that native completion lacks or is difficult to implement

Feature Showcase
Parallel Computing complete-git-checkout
 _choice_ref() { 
   _argc_util_parallel _choice_branch ::: _choice_tag ::: _choice_head
}
Fetch remote data complete-cargo-add
Complete multiple values
(comma-spereated)
complete-dd-iflag
Complete multiple parts complete-rustup-target-add
Complete key-value pairs complete-ssh-o
Complete for plugins
(git,cargo ...)
complete-cargo-nextest
Delegate to another command
(sudo,doas,npx...)
complete-yarn-workspace
Style & color complete-xtest-color

Getting Started

git clone https://github.com/sigoden/argc-completions.git
cd argc-completions
./scripts/download-tools.sh
./scripts/setup-shell.sh bash  # bash/zsh/powershell/fish/nushell/elvish/xonsh/tcsh

For Windows, please run the above code in Git Bash.

Tools downloaded by ./scripts/download-tools.sh:

  • argc: completion engine
  • yq: YAML/JSON/XML/CSV/TOML processor
  • macOS only: brew install bash gawk gnu-sed

Uninstall easily

  1. Delete the argc-completions directory that you have downloaded.
  2. Undo the changes made to the shell rcfile (~/.bashrc, ~/.zshrc, ...).

Generate your own completion script

./scripts/generate.sh your-command

generate

To learn how generate works, see docs/generate.md

To learn various complete patterns, see docs/complete-patterns.md

License

Argc-completions is made available under the terms of the MIT License.

See the LICENSE file for license details.

About

Completions for any shell. Supports 1000+ commands. Automaticlly generate completion definition from help text and man page.

License:MIT License


Languages

Language:Shell 99.4%Language:Awk 0.6%