Add a spec
- Create the folder
~/.coder/completions/if it doesn’t exist. (Dev builds of Coder use~/.coder-dev/completions/.) - Save a JSON file named after the command, exactly as you type it: the spec for
devscanisdevscan.json. - Open a Coder terminal and type the command followed by a space.
A small example
mytool.json:
mytoollistsscananddeploy(andship, the alias).mytool scan --lists--pathand--verbose, because--verboseis marked persistent and applies in every subcommand.mytool scan --pathlists the folders in your current directory.mytool deploylistsstagingandproduction.
Reference
A
generators script may only run the same command you are typing (mytool in the example), and it runs as you type, so keep it quick. Results are cached for a few seconds.Built-in specs
A spec in yourcompletions folder replaces the built-in one of the same name. Use that to trim a noisy built-in list, or to add your own subcommands. Delete the file to go back to the built-in.
Cloud CLIs: aws, gcloud and az
To keep the app small, the huge subcommand trees for the AWS CLI (aws), Google Cloud (gcloud) and Azure CLI (az) are not bundled. Typing aws , gcloud or az still lists the services or command groups, but hints stop below that level (aws s3 and az vm show nothing).
If you want hints for one of them, ask your AI agent to use the coder-command-hints skill to generate a spec for the part you use, for example “write Coder terminal hints for the aws s3 and aws ec2 commands”. Keep it to the services you actually run: your file replaces the built-in spec for that command, so anything you leave out is no longer suggested.
If hints don’t show up
- The file name must match the command exactly.
Mytool.jsonwon’t matchmytool. - The JSON must be valid. No comments, no trailing commas. Coder ignores a file it can’t parse and writes a line about it to the app log. Check it with
node -e "JSON.parse(require('fs').readFileSync('mytool.json','utf8'))". - Hints only work in zsh and bash terminals opened inside Coder, and only when Settings > General > Terminal > Command hints is on.
- A flag that takes a value but has no
argsmakes the next word complete as a flag instead of a value, and the reverse for a switch that hasargs.