A Rust CLI tool that wraps AI agent prompts with predefined context, designed for use with Warp AI.
# Build
cargo build --release
# Install globally
cargo install --path .This installs the agent binary to your Cargo bin directory.
agent php "create a REST API endpoint"
agent rust "implement a concurrent hash map"
agent mql5 "build a moving average crossover EA"
agent blog "write an article about Rust error handling"Use run to invoke any agent defined in config.toml:
agent run php "create a REST API endpoint"agent list--dry-run— Print the composed prompt without sending it--verbose/-v— Show debug information
agent php "create a service" --dry-run --verbose- Create a context file in
contexts/(e.g.contexts/python.txt) - Add an entry to
config.toml - Use it immediately via
agent run
To add a named subcommand (like agent python), add a new variant to AgentCommand in src/cli.rs.
Step 1 — use the CLI itself to generate the context file:
agent rust "Create a Python context for agent_cli" > contexts/python.txtThis uses the Rust agent to write a well-structured system prompt for a Python expert agent,
saved directly into the contexts/ directory.
Step 2 — register the agent in config.toml:
[agents]
php = "php.txt"
rust = "rust.txt"
mql5 = "mql5.txt"
blog = "blog.txt"
python = "python.txt" # <-- add this lineStep 3 — run it:
agent run python "build a FastAPI CRUD service for a users resource"├── config.toml # Agent → context file mapping
├── contexts/ # Context files (system prompts)
│ ├── php.txt
│ ├── rust.txt
│ ├── mql5.txt
│ └── blog.txt
└── src/
├── main.rs # Entry point
├── cli.rs # Clap CLI definitions
├── config.rs # TOML config parsing
├── commands/mod.rs # Agent execution logic
├── context/
│ ├── mod.rs
│ └── loader.rs # Context file loading & prompt composition
└── warp/
├── mod.rs
└── client.rs # Warp AI communication
The tool attempts to send prompts via warp-cli ai. If warp-cli is not available, the composed prompt is printed to stdout so you can copy/pipe it manually. The WarpClient in src/warp/client.rs is designed to be easily extended with alternative backends.