Skip to content

rickintveld/agent_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent CLI

A Rust CLI tool that wraps AI agent prompts with predefined context, designed for use with Warp AI.

Build & Install

# Build
cargo build --release

# Install globally
cargo install --path .

This installs the agent binary to your Cargo bin directory.

Usage

Built-in agents

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"

Dynamic agent dispatch

Use run to invoke any agent defined in config.toml:

agent run php "create a REST API endpoint"

List available agents

agent list

Flags

  • --dry-run — Print the composed prompt without sending it
  • --verbose / -v — Show debug information
agent php "create a service" --dry-run --verbose

Adding a new agent

  1. Create a context file in contexts/ (e.g. contexts/python.txt)
  2. Add an entry to config.toml
  3. Use it immediately via agent run

To add a named subcommand (like agent python), add a new variant to AgentCommand in src/cli.rs.

Example: creating a Python agent

Step 1 — use the CLI itself to generate the context file:

agent rust "Create a Python context for agent_cli" > contexts/python.txt

This 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 line

Step 3 — run it:

agent run python "build a FastAPI CRUD service for a users resource"

Project Structure

├── 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

Warp AI Integration

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.

About

Agent CLI for Warp terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages