# cuc ([Clink](https://github.com/chrisant996/clink) [Usage](https://usage.jdx.dev/) Completions)
Generate [Clink](https://github.com/chrisant996/clink) argmatchers from a [Usage](https://usage.jdx.dev/spec/reference/) specification.
## Installation
1. Download the appropriate executable from [Releases](https://github.com/IMXEren/cuc/releases/latest).
2. Make these Lua modules available through `package.path` (for example from `!init.lua` or `.init.lua`):
- [arghelper.lua](./modules/arghelper.lua)
- [base64.lua](./modules/base64.lua)
3. Put the generated Lua file in a Clink scripts directory, or load it explicitly.
See [mise-clink](https://github.com/binyaminyblatt/mise-clink) for a complete integration.
## Generating completions
Read a specification from a file:
```pwsh
cuc generate usage.kdl --out usage.lua
```
Or from stdin:
```pwsh
Use `--complete` when the specification contains runtime `complete run=...` entries or `mount` nodes:
```pwsh
Dynamic completion uses Bash. cuc locates Git Bash automatically, or accepts an explicit executable:
```pwsh
The generated script embeds the paths to `cuc` and the selected shell, which must remain available when Clink requests completions. Without `--complete`, runtime completers and mounts are silently omitted; ordinary flags, arguments, and commands are still generated.
To generate at Clink startup instead of writing a file:
```lua