# zsh-agy-completion Tab completion for `agy`, the [Antigravity CLI](https://antigravity.google/docs/cli/overview), in zsh. Completion only: no aliases, no wrapper functions. `agy` ships no completion script and exposes no machine-readable description of its commands, so `_agy` is generated by running the CLI's own help (`agy --help`, `agy help `) and parsing it. It reflects the version in [`agy-version`](agy-version). A scheduled workflow regenerates it against the latest release every day and opens a pull request when something changed. ## What it completes - Every subcommand and nested subcommand, with descriptions (`agy mcp add`, `agy plugin install`, `agy remote-control start`, ...) - The `agents` and `plugins` aliases - Flags for the root command and for each subcommand, including short forms such as `-p` and `-c` - Values the help spells out: `--effort`, `--mode`, `--input-format`, `--output-format`, `mcp add --type` - Files and directories for flags and arguments that take a path - `agy help ` Models, agents, conversation IDs, MCP server names and plugin names are not completed. ## Installation ### Oh My Zsh ```bash git clone https://github.com/feRpicoral/zsh-agy-completion.git \ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-agy-completion ``` Add it to the plugins array in `~/.zshrc`: ```bash plugins=(... zsh-agy-completion) ``` Then reload the shell: ```bash exec zsh ``` ### Other plugin managers Load `zsh-agy-completion.plugin.zsh` the way your manager loads any plugin. It adds the directory to `fpath` and registers the completion itself when `compinit` has already run. ### Manual ```bash git clone https://github.com/feRpicoral/zsh-agy-completion.git ``` ```bash fpath=(/path/to/zsh-agy-completion $fpath) autoload -Uz compinit && compinit ``` ## Development The generator needs Node (see `.nvmrc`) and an installed `agy`. It has no dependencies of its own and works without signing in. Regenerate from the `agy` on your `PATH`, or from a specific binary: ```bash scripts/update.sh ``` ```bash scripts/update.sh ~/.local/bin/agy ``` Run the tests, which drive a real interactive zsh through a pty and check what it offers: ```bash scripts/test.zsh ``` ### How flags are classified The help text does not say which flags take a value, and that decides whether the word after a flag is skipped or completed. - Root flags are probed. `agy -- --zz-probe-a --zz-probe-b` is rejected by the argument parser before the CLI does anything, and the error names the unknown flags: both for a boolean flag, only the second when the flag consumed the first as its value. - Subcommand flags are not probed, because some subcommands change the machine (`install`, `remote-control start`) and a parser that behaved differently would run them. They are classified from their description instead: a `(default ...)` or `(repeatable)` marker, a list of choices, a mention of a file or directory, or wording that starts with "Set". A new subcommand flag that takes a value but matches none of those will be treated as a boolean until the rules are extended. ## Troubleshooting If completions do not show up after installing, rebuild the completion cache: ```bash rm -f ~/.zcompdump* exec zsh ``` ## License MIT. Not affiliated with Google.