This file provides guidance to agents when working with code in this repository.
This repository provides command completion signatures ("specs") for Warp terminal. It contains two Rust crates:
warp-command-signatures: The main library that embeds and exposes command specs. Used as a dependency by the mainwarpapp.warp-completion-metadata: Core types for signatures, arguments, options, generators, and the Fig-compatible JSON schema.
Repository-level agent skills are located in .agents/skills/. These provide specialized workflows for working with this codebase. Always use these skills when creating or editing command completion signatures.
Specs are JSON files based on the Fig completion spec schema, but Warp does not use Fig's JavaScript generators. Instead:
- The
generatorNamefield references Rust-based generators (see below) - Fig's
generateSpecJavaScript field is present in some imported specs but is ignored by Warp - Static suggestions, templates (
filepaths,folders), and subcommand/option definitions work as documented
| Location | Description |
|---|---|
command-signatures/json/*.json |
Hand-written specs |
command-signatures/json/autogenerated/powershell/*.json |
Auto-generated PowerShell cmdlet specs |
command-signatures/json/overrides/powershell/*.json |
Hand-written overrides for autogenerated specs |
The assets.rs module uses rust-embed to flatten these directories into a single namespace at compile time, so callers just use signature_by_name("git").
Generators produce dynamic completions by running shell commands. They are defined in command-signatures/src/generators/ (one file per command or command family).
A generator consists of:
- A
GeneratorProcess(either a staticCommandBuilderor a function that builds a command from tokens) - An
on_complete_callbackthat parses the command output intoSuggestions
JSON specs reference generators via the generatorName field (e.g. "generatorName": "branches"). The mapping from name → Rust code is established in generators/mod.rs via dynamic_command_signature_data().
Example from brew.rs:
CommandSignatureGenerators::new("brew")
.add_generator(
"formulae_generator", // Referenced in JSON as "generatorName": "formulae_generator"
Generator::script(CommandBuilder::single_command("brew list -1"), |output| {
output.trim().lines()
.map(|line| Suggestion::with_description(line, "Installed formula"))
.collect_unordered_results()
}),
)For autogenerated specs (currently PowerShell only), hand-written augmentations live in json/overrides/. Overrides are matched by option name or argument index and merged at generation time. Only template and generatorName fields are currently supported for overrides.
Signature: Defines a command/subcommand (name, options, arguments, subcommands)Argument: A positional parameter with types (Template, Generator, or literal Suggestion)Opt: A flag/option with optional argumentsGenerator: Produces dynamic suggestions by running shell commandsTemplate: Built-in generators for files/folders
Tests in lib.rs verify:
- All
GeneratorNames referenced in specs exist indynamic_command_signature_data() - All JSON specs deserialize without error
- Generator commands contain no unsafe (unquoted) newlines (required for TMUX control mode)