Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carapace-sh/carapace-spec
define simple completions using a spec file
https://github.com/carapace-sh/carapace-spec
bash carapace completion elvish fish ion nushell oil powershell tcsh xonsh xontrib zsh
Last synced: 3 months ago
JSON representation
define simple completions using a spec file
- Host: GitHub
- URL: https://github.com/carapace-sh/carapace-spec
- Owner: carapace-sh
- License: mit
- Created: 2022-04-30T23:13:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T15:56:34.000Z (3 months ago)
- Last Synced: 2024-10-29T17:23:02.606Z (3 months ago)
- Topics: bash, carapace, completion, elvish, fish, ion, nushell, oil, powershell, tcsh, xonsh, xontrib, zsh
- Language: Go
- Homepage: https://carapace.sh
- Size: 1.95 MB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - carapace-spec - Define simple completions using a spec file. (Command Line / Standard CLI)
README
# carapace-spec
[![PkgGoDev](https://pkg.go.dev/badge/github.com/carapace-sh/carapace-spec/pkg/actions)](https://pkg.go.dev/github.com/carapace-sh/carapace-spec)
[![GoReportCard](https://goreportcard.com/badge/github.com/carapace-sh/carapace-spec)](https://goreportcard.com/report/github.com/carapace-sh/carapace-spec)
[![documentation](https://img.shields.io/badge/-documentation-blue?logo=gitbook)](https://carapace-sh.github.io/carapace-spec/)
[![Coverage Status](https://coveralls.io/repos/github/carapace-sh/carapace-spec/badge.svg?branch=master)](https://coveralls.io/github/carapace-sh/carapace-spec?branch=master)
[![Packaging status](https://repology.org/badge/tiny-repos/carapace-spec.svg)](https://repology.org/project/carapace-spec/versions)Define simple completions using a spec file (based on [carapace](https://github.com/carapace-sh/carapace)).
The `carapace-spec` binary can be used to complete spec files, but [carapace-bin](https://github.com/rsteube/carapace-bin) is recommended as it supports a range of [custom macros](https://rsteube.github.io/carapace-bin/spec/macros.html).
```yaml
name: mycmd
description: my command
flags:
--optarg?: optarg flag
-r, --repeatable*: repeatable flag
-v=: flag with value
persistentflags:
--help: bool flag
completion:
flag:
optarg: ["one", "two\twith description", "three\twith style\tblue"]
v: ["$files"]
commands:
- name: sub
description: subcommand
completion:
positional:
- ["$list(,)", "1", "2", "3"]
- ["$directories"]
```## Generators
- [carapace-spec-clap](https://github.com/carapace-sh/carapace-spec-clap) spec generation for clap-rs/clap
- [carapace-spec-kingpin](https://github.com/carapace-sh/carapace-spec-kingpin) spec generation for alecthomas/kingpin
- [carapace-spec-kong](https://github.com/carapace-sh/carapace-spec-kong) spec generation for alecthomas/kong
- [carapace-spec-man](https://github.com/carapace-sh/carapace-spec-man) spec generation for manpages
- [carapace-spec-urfavecli](https://github.com/carapace-sh/carapace-spec-urfavecli) spec generation for urfave/cli
- [carapace-spec-oclif](https://github.com/cristiand391/oclif-carapace-spec-plugin) spec generation for oclif