Spec-tacular Citizen
Specs are now first-class citizens in carapace. They are integrated on root level and should behave similar to the existing completers (carapace [spec.name] <TAB>
).
List
Completers based on Specs are highlighted in shells that support colors (details: carapace --list=json
):
Bridge
Using Specs for bridging is from now on the recommended approach.
As these are auto-loaded with carapace _carapace
and provide support for embedded completion like sudo [spec.name] <TAB>
.
Existing completers with the same name will also be overridden.
E.g. kubectl
(which is currently a bit outdated) can be configured to use the official completer:
# ${UserConfigDir}/carapace/specs/kubectl.yaml
name: kubectl
description: kubectl controls the Kubernetes cluster manager
completion:
positionalany: ["$_bridge.Cobra(kubectl)"]
Note that bridging adds a slight overhead (~7-9ms?) for each invocation and is limited to supported frameworks / commands.
Plugin
Taking this one step further plugin completion like cargo-[plugin]
, gh-[plugin]
, git-[plugin]
can now also be defined by Specs.
E.g. the gh-repo-collab extension for github-cli:
# ${UserConfigDir}/carapace/specs/gh-repo-collab.yaml
name: gh-repo-collab
description: manage repository collaborators
commands:
-
name: list
completion:
positional:
- ["$_tools.gh.OwnerRepositories"]
-
name: add
flags:
--permission=: set permission
completion:
flag:
permission: ["pull", "triage", "push", "maintain", "admin\t\tred"]
positional:
- ["$_tools.gh.OwnerRepositories"]
- ["$_tools.gh.Users"]
-
name: remove
completion:
positional:
- ["$_tools.gh.OwnerRepositories"]
- ["$_tools.gh.Users"]
Nushell
With nushell/nushell#6652 (upcoming v0.70.0) the nushell integration is now working on positional arguments.
The recommended configuration is equivalent to the example configuration in config.nu
:
let carapace_completer = {|spans|
carapace $spans.0 nushell $spans | from json
}
let-env config = {
external_completer: $carapace_completer
}
Be sure to remove the
module completions
example so that it won't override the carapace completion
Changelog
- 92fa7ad ActionCarapaceBin: support spec completion
- 0a15137 ActionPathExecutables: added man descriptions
- 516b6a5 ActionPathExecutables: improve performance
- a9a0894 Merge pull request #1301 from rsteube/add-git-abort
- 70be8d4 Merge pull request #1302 from rsteube/git-alias-help
- 1be7a6f Merge pull request #1303 from rsteube/git-others-description
- 04b67ed Merge pull request #1304 from rsteube/add-git-standup
- 6f8a2e1 Merge pull request #1305 from rsteube/git-clang-format-fix-use
- a6ab2c6 Merge pull request #1307 from rsteube/git-restore-filter
- 271b550 Merge pull request #1308 from rsteube/gh-extension-cmpletion
- da64eb5 Merge pull request #1309 from rsteube/actionpathexecutables-performance
- 161691b Merge pull request #1310 from rsteube/bridge-spec
- 5dfecf7 Merge pull request #1311 from rsteube/xargs-actioncarapacebin
- 88ce5c0 Merge pull request #1312 from rsteube/updates-from-2.16.0
- 02fcc60 Merge pull request #1313 from rsteube/dependabot/go_modules/github.com/rsteube/carapace-0.24.1
- 428078e Merge pull request #1314 from rsteube/fix-gh-extension-exec
- 26a8597 Merge pull request #1315 from rsteube/docker-use-actioncarapacebin
- 412805e Merge pull request #1316 from rsteube/caraparse-completion
- bae5cd3 Merge pull request #1317 from rsteube/xargs-fix-completion
- edfb6a3 Merge pull request #1318 from rsteube/go-fix-buildflags
- 773984c Merge pull request #1319 from rsteube/helix-fix-health
- 87c6625 Merge pull request #1320 from rsteube/actionpathexecutables-man-descriptions
- 7029ba4 Merge pull request #1321 from rsteube/add-bash-lsp
- 3b529e5 Merge pull request #1322 from rsteube/tig-file-completion
- b00d2d5 Merge pull request #1323 from rsteube/add-redis-cli
- 316f614 Merge pull request #1324 from rsteube/tig-multiple-args
- 2a3afb5 Merge pull request #1325 from rsteube/add-terraform-ls
- 9ef0f0d Merge pull request #1327 from rsteube/git-clone-reposearch
- 7d9ef47 Merge pull request #1329 from rsteube/cargo-prevent-synch
- f20e14c Merge pull request #1330 from rsteube/cargo-plugins
- 7c023f7 Merge pull request #1331 from rsteube/cargo-nightly-flags
- 5ce0ecd Merge pull request #1332 from rsteube/add-cargo-metadata
- df308e6 Merge pull request #1335 from rsteube/spec-integrate-root
- 71b5192 added bash-language-server
- b042883 added cargo-metadata
- 0a8b588 added git-abort
- de7bdad added git-standup
- b07a46e added resdis-cli
- 61ce48e added terraform-ls
- e567c59 build(deps): bump github.com/rsteube/carapace from 0.24.0 to 0.24.1
- 887f07e caraparse: added completion
- 88d2f14 cargo: moved plugins
- f71408a cargo: nightly flag completion
- 510e24e cargo: prevent
synching channel updates
- 3ef4454 docker: use ActionCarapaceBin
- 2797897 gh: extension completion
- 2eda2df gh: extension exec - fix completion
- 0bcd584 gh: updates from 2.16.0
- 74bff0c git-alias: added help flag
- e0b43da git-clang-format: fix Use
- f3a5201 git: clone - complete repos
- 1d1d2c7 git: others description
- 5f2bc99 git: restore - filter args
- 8d98921 go: fix build flags
- c013f7a helix: fix health
- 4f22458 spec: integrate on root level
- 136fdca tig: allow multiple refs/files
- 333f4ca tig: support file completion
- 12cd77b xargs: fix command completion
- 8be59f0 xargs: fix completion
- bc80ddc xargs: use bridge.ActionCarapaceBin