Carapace-bin provides argument completions for many CLI commands

carapace-bin

PkgGoDev GoReportCard documentation Completers

Carapace-bin provides argument completions for many CLI commands: see the full list here, and works across many POSIX and non-POSIX shells. This multi-shell multi-command argument completer is based on rsteube/carapace. You can read more about this tool here: A pragmatic approach to shell completion.

asciicast

Supported shells:

Status

A major part of the completers has been generated from help pages so there will be some quirks here and there. Also completion depends on what rsteube/carapace is capable of so far.

Getting Started

Ensure carapace is added to PATH (Installation). Then register the completers (Setup):

# bash (~/.bashrc)
source <(carapace _carapace)

# elvish (~/.elvish/rc.elv)
eval (carapace _carapace|slurp)

# fish (~/.config/fish/config.fish)
mkdir -p ~/.config/fish/completions
carapace --list | awk '{print $1}' | xargs -I{} touch ~/.config/fish/completions/{}.fish # disable auto-loaded completions (#185)
carapace _carapace | source

# nushell [needs fork: https://github.com/rsteube/nushell]
carapace _carapace nushell | save carapace.nu ; nu -c 'source carapace.nu'

# oil (~/.config/oil/oshrc)
source <(carapace _carapace)

# powershell (~/.config/powershell/Microsoft.PowerShell_profile.ps1)
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
carapace _carapace | Out-String | Invoke-Expression

# tcsh (~/.tcshrc)
set autolist
eval `carapace _carapace`

# xonsh (~/.config/xonsh/rc.xsh)
COMPLETIONS_CONFIRM=True
exec($(carapace _carapace))

# zsh (~/.zshrc)
source <(carapace _carapace)
Comments
  • turn off argument completion

    turn off argument completion

    Firstly, great tool!

    Hi, How can I turn off argument completion? I would prefer filenames/directories to be shown instead. image

    Second question: I loose some key bindings when I invoke ble.sh. For example I am on a mac (with iterm) and use ALT+DELETE to delete a previous word. This is disabled when I use ble.sh

  • What is ${UserConfigDir} in 0.12.1?

    What is ${UserConfigDir} in 0.12.1?

    This is probably a dumb issue. I wanted to link some spec files so that carapace will auto-load them, and I assumed ${UserConfigDir} was going to be $E:XDG_CONFIG_HOME which is ~/.config at least on my machine. So I soft linked two yaml files into ~/.config/carapace/specs/ but on restarting elvish I do not get those completions. The files are named after the commands, e.g. pandocomatic.yaml as the release notes specified.

  • Question about relation to other completion frameworks

    Question about relation to other completion frameworks

    I am bit confused how the relation of carapace-bin is to other completion frameworks like bash-completion, fzf or bleh.sh. Is it supposed to be an addition to them or does it replace them complete? So far I saw no compatibility issues with bash-completion or fzf since it overwrites their handling but ble.sh breaks at least chmod and the result is chmod '0 (none)' carapace-bin_0.9.1_Linux_x86_64.tar.gz.

  • aws completion broken on macOS

    aws completion broken on macOS

    macOS with zsh 5.8.1

    when invoking the completion for aws I am receiving the following error:

    ERR -- exec: "python": executable file not found in $PATH  _
    

    macOS recently removed the deprecated Python 2.7 which it came bundled with. Now python is unbound by default.

    I also tried symlinking python3 (Python 3.9 installed through Homebrew) to python, then I am receiving

    ERR -- Traceback (most recent call last):  _
    

    Please let me know if you need anything else to debug this issue.

  • Configure descriptions format

    Configure descriptions format

    First of all let me say I am totally amazed by carapace. I discovered it thanks to your PR https://github.com/cli/cli/pull/2728# and was blown away when I discovered what it can do.

    One minor thing I'd like to ask/request is how to change the format used for the descriptions?

    In my ZSH setup using the standard completion source (e.g. for gh) the descriptions are separated by --, which I like.

    before

    After loading carapace (source <(carapace gh zsh)) the descriptions change to this format (using parentheses)

    after

    If possible I'd like to keep my existing description format so that it stays uniform across different commands.

    Here's my zshrc for reference: https://github.com/disrupted/dotfiles/blob/4957c485b2b7bf2a73af9393bf8d599fd6afbfec/.zshrc

  • Fix pulumi's resources urns completion

    Fix pulumi's resources urns completion

    Use pulumi stack export instead of pulumi stack --show-urns to get the resources' urns. The former outputs a json, whereas the latter outputs a table (maybe more user friendly?).

    I think there was an additional carapace.ActionCallback(...) call as well. Or was it intentional? The current implementation does not work for me; it completes with the single entry urn.

  • Pacman completion broken

    Pacman completion broken

    $ carapace pacman nushell pacman -R fil | jaq
    [
        {"value": "filERR", "description": "unknown shorthand flag: 'R' in -R"},
        {"value": "fil_"}
    ]
    

    Similar for other commands

  • Tilde+tab triggers backslash

    Tilde+tab triggers backslash

    description

    Pressing the tab key after the ~ (tilde) symbol adds a \ (backslash) in front of the tilde symbol

    • macOS
      • default terminal
    • zsh setup
      • romkatv/zsh4humans

    to reproduce

    1. Type mv ~/
    2. Press the tab key
    3. a backslash appears before the tilde symbol
    4. see GIF below for more clarity

    GIF

    issue

    PS: Found out about this repo from a post in the cli/cli repo. Besides the ~ (tilde) issue very happy with it.

  • Improve TMUX completer?

    Improve TMUX completer?

    tmux has a large number of commands:

    https://man.openbsd.org/tmux#COMMANDS

    Currently carapace only completes the small number of flags, and it would be great to get the main commands to complete (they do at least in zsh). I do realise it is a complex command to support!

  • performance tweaks

    performance tweaks

    with increasing amount of completers might need to use yaegi to only initialize the needed command (assuming all init methods are called on invokation - need to check this)

  • Documentation for spec files?

    Documentation for spec files?

    In general spec files are fairly straight-forwards to understand, but I was wondering exactly what pos1 and pos2 do in the example yaml you show?

      positional:
      -  ["pos1", "pos2"]
      -  ["$_files"]
    
  • nix commands

    nix commands

    Add nix commmands.

    • [ ] nix
    • [ ] nix-build
    • [x] nix-channel
    • [ ] nix-collect-garbage
    • [ ] nix-common-options
    • [ ] nix-copy-closure
    • [ ] nix-env
    • [ ] nix-hash
    • [ ] nix-install-package
    • [ ] nix-instantiate
    • [ ] nix-prefetch-url
    • [ ] nix-push
    • [ ] nix-shell
    • [ ] nix-store
    • [ ] nixops
    • [ ] nixos-build-vms
    • [ ] nixos-container
    • [ ] nixos-generate-config
    • [ ] nixos-install
    • [ ] nixos-option
    • [ ] nixos-rebuild
    • [ ] nixos-version

    https://github.com/hedning/nix-bash-completions https://github.com/spwhitt/nix-zsh-completions

  • spec: suppport system-wide folder

    spec: suppport system-wide folder

    additional to ~/.config/carapace/spec support a system-wide folder (e.g. /usr/share/carapace/specs)

    preference:

    1. user generated spec (style.Blue)
    2. system-wide spec (style.Yellow)
    3. embedded completer (style.Default)
  • add `completers/${GOOS}` subfolders

    add `completers/${GOOS}` subfolders

    Not all completers are applicable for each OS. Use GOOS names: https://golang.org/doc/install/source#environment go:generate and references need to be updated.

    e.g.

    completers/common (for all, e.g. `git`)
    completers/linux
    completers/darwin
    
Count once - Just once? no, when appear many it run once, but it can run many times

countOnce just once? no, when appear many it run once, but it can run many times

Jan 29, 2022
painless task queue manager for shell commands with an intuitive cli interface (execute shell commands in distributed cloud-native queue manager).

EXEQ DOCS STILL IN PROGRESS. Execute shell commands in queues via cli or http interface. Features Simple intuitive tiny cli app. Modular queue backend

Dec 14, 2022
Struct-based argument parsing in Go
Struct-based argument parsing in Go

go-arg Struct-based argument parsing for Go Declare command line arguments for your program by defining a struct. var args struct { Foo string Bar b

Jan 8, 2023
minigli is a tiny command argument parser for Go.

minigli is a tiny command argument parser for Go.

Jan 29, 2022
command argument completion generator for spf13/cobra

Command argument completion generator for cobra. You can read more about it here: A pragmatic approach to shell completion.

Dec 26, 2022
A simple way for CLI command to have many subcommands

subcommands This is a modified fork of google/subcommands that uses lucasepe/pflag Subcommands is a Go package that implements a simple way for a sing

Oct 12, 2021
CLI tool to convert many common document types to plane text.

Textify. CLI tool to convert many common document types to plane text. Goals. SO many different document types exist today. PDFs, EPUB books, Microsof

Nov 19, 2021
A CLI to execute AT Commands via serial port connections.
A CLI to execute AT Commands via serial port connections.

AT Command CLI A CLI to execute AT Commands via serial port connections. Development Install Go Run go run main.go

Dec 13, 2022
A CLI tool for running Go commands with colorized output
A CLI tool for running Go commands with colorized output

Goli Goli is a CLI Tool for running Go commands with colorized output. Note: Goli is still a WIP. It has very basic commands and limitations. Feel fre

Nov 24, 2022
Cobra CLI tool to generate applications and commands

Cobra Generator Cobra provides its own program that will create your application and add any commands you want. It's the easiest way to incorporate Co

Jan 3, 2023
PingMe is a CLI tool which provides the ability to send messages or alerts to multiple messaging platforms & email.
PingMe is a CLI tool which provides the ability to send messages or alerts to multiple messaging platforms & email.

PingMe is a personal project to satisfy my needs of having alerts, most major platforms have integration to send alerts but its not always useful, either you are stuck with one particular platform, or you have to do alot of integrations. I needed a small app which i can just call from my backup scripts, cron jobs, CI/CD pipelines or from anywhere to send a message with particular information. And i can ship it everywhere with ease. Hence, the birth of PingMe.

Dec 28, 2022
K-Mesh is an experimental Knative distribution which provides a fresh, CLI-focused, holistic user experience of running and managing Knative.

K-Mesh is an experimental Knative distribution which provides a fresh, CLI-focused, holistic user experience of running and managing Knative. N

Feb 14, 2022
🧑‍💻📊 Show off your most used shell commands
🧑‍💻📊 Show off your most used shell commands

tsukae ??‍?? ?? Tsukae, 使え - means use in Japanese (so it refers to commands that you use) Built on top of termui and cobra Big shoutout to jokerj40 f

Dec 17, 2022
cTRL is a server for remote execution of pending tasks and commands in real time, supporting a queue with continuous thread limiting and throttling.

Документация на русском: https://github.com/eltaline/ctrl/blob/master/README-RUS.md cTRL is a server written in Go language that uses a modified versi

Mar 3, 2022
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Sampler. Visualization for any shell command. Sampler is a tool for shell commands execution, visualization and alerting. Configured with a simple YAM

Dec 28, 2022
Go Library to Execute Commands Over SSH at Scale
Go Library to Execute Commands Over SSH at Scale

Go library to handle tens of thousands SSH connections and execute the command(s) with higher-level API for building network device / server automation.

Dec 9, 2022
miscellaneous useful commands, including 'gosh' the Go scripting tool

utilities Miscellaneous useful commands. gosh This is a tool for running Go code from the command line. See here. findCmpRm This finds files with copi

Oct 31, 2022
ag is a tool for defining an alias for a group of commands

AG Introduction ag is a command line tool that similar to Makefile. with ag you can make an alias for group of commands with custom flags. This tool i

Jul 17, 2022
Commando - run commands against networking devices in batch mode
Commando - run commands against networking devices in batch mode

Commando is a tiny tool that enables users to collect command outputs from a single or a multiple networking devices defined in an inventory file.

Oct 30, 2022