Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Core

Core macros provided by carapace-spec.

directories

$directories completes directories.

["$directories"]

exec

Executes given command in a shell.

["$(echo one two three)"]
  • $(<command>) (sh on unix and cmd on windows)
  • $bash(<command>)
  • $cmd(<command>)
  • $elvish(<command>)
  • $fish(<command>)
  • $nu(<command>)
  • $osh(<command>)
  • $pwsh(<command>)
  • $sh(<command>)
  • $xonsh(<command>)
  • $zsh(<command>)

Environment contains Variables of parsed flags and arguments.

executables

$executables completes executables either from PATH or given directories.

["$executables", "$executables([~/.local/bin])"]

files

$files([<suffixes>]) completes files with an optional list of suffixes to filter on.

["$files([.go, go.mod, go.sum])"]

message

$message(<message>) adds given error message to completion.

["$message(some error)"]

spec

$spec(<file>) completes arguments using the given spec file. This implicitly disables flag parsing for the corresponding (sub)command.

["$spec(example.yaml)"]