https://github.com/vncsmyrnk/compgen
Shell completions generator.
https://github.com/vncsmyrnk/compgen
completions shell zsh
Last synced: 29 days ago
JSON representation
Shell completions generator.
- Host: GitHub
- URL: https://github.com/vncsmyrnk/compgen
- Owner: vncsmyrnk
- License: gpl-3.0
- Created: 2026-05-17T12:32:16.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-24T15:22:31.000Z (about 1 month ago)
- Last Synced: 2026-05-24T15:22:47.799Z (about 1 month ago)
- Topics: completions, shell, zsh
- Language: C
- Homepage:
- Size: 78.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/vncsmyrnk/compgen/actions/workflows/ci-cd.yaml)
[](https://github.com/vncsmyrnk/shell-utils/issues)
# compgen
**Goal**: a runtime dependency-free completions generator for multiple shells configurable via document language.
**Inspiration**: [jdx/usage](https://github.com/jdx/usage). `usage` is a great tool and it is a runtime dependency.
**Secondary goals**
- Define generic parseable completion schema, based on existing [usage's KDL spec](https://usage.jdx.dev/spec/)
- Create a documentation and manpage generator
## Specification
This project's intent is to also define a specification for the completion generation. Inspiring on [usage's KDL spec](https://usage.jdx.dev/spec/), a detailed specification and scoped specifically to completion generation (ignoring help and other runtime features) is at [docs/spec.md](docs/spec.md).
## Roadmap
- [x] KDL specification for commands, flags and arguments
- [x] KDL parsing and AST implementation
- [ ] Completion generation for a particular shell, generic enough to expect future implementations for other shells
- [ ] Document usage for users
- [ ] Document requirements and guidelines and for more shells
[v0.1.0 Milestone](https://github.com/vncsmyrnk/compgen/milestone/1)
## Install
### From source
```sh
make install # run `make uninstall` to uninstall it
cg --shell=zsh ./completions.kdl # Generate completions for `compgen` itself as a demo
```
## Completions
Completions for `compgen` are generated by `compgen` itself at build-time, the official spec is at [completions.kdl](completions.kdl). It should by available after a successfull installation.
## Running tests
```sh
make check
```