CATS - Coding Agent ToolS
A comprehensive toolkit for building AI-powered coding agents. CATS provides structured, LLM-friendly tools for file manipulation, code editing, search, and execution that work seamlessly with language models.
Features
- π File Navigation: Windowed file viewing with line-by-line navigation and scrolling
- π Search Tools: Fast file discovery and content search across files and directories
- βοΈ Code Editing: Intelligent text editing with search/replace, insert, delete operations
- π File Management: Create, move, copy, and delete files and directories
- β‘ Command Execution: Safe command execution with timeout and validation
- π State Management: Persistent tool state and session history
- πΊοΈ Project Mapping: Visualize project structure with intelligent elision
- π― Task Classification: Built-in task classification for agent workflows
Quick Start
Add CATS to your Cargo.toml:
[]
= "0.1.0"
Basic Usage
use ;
With Custom Window Size
use create_tool_registry_with_open_window_size;
Available Tools
File Navigation
open- Opens a file and displays a window of linesgoto- Jumps to a specific line number in the current filescroll_up- Scrolls the viewing window upscroll_down- Scrolls the viewing window down
Search
find_file- Search for files by name patternsearch_file- Search for text within a specific filesearch_dir- Search for text across all files in a directory
Editing
create_file- Create a new file with contentreplace_text- Replace text using search/replace patterninsert_text- Insert text at a specific linedelete_text- Delete a range of linesdelete_line- Delete a specific lineoverwrite_file- Replace entire file contentsdelete_function- Delete a Rust function by name (Rust-aware)
File Management
delete_path- Delete a file or directorymove_path- Move or rename a file/directorycopy_path- Copy a file or directorycreate_directory- Create a new directory
Execution
run_command- Execute shell commands with timeout and validation
Utilities
_state- Display current tool state and contextcount_tokens- Count tokens in a file (requirestiktokenfeature)filemap- Generate a project structure visualizationsubmit- Mark task as completeclassify_task- Classify task type for workflow routing
Tool Execution Patterns
Using Named Arguments (Recommended for LLMs)
use ;
use HashMap;
Using Positional Arguments
use ;
Features Flags
tiktoken (Optional)
Enable token counting functionality using the cl100k_base tokenizer:
[]
= { = "0.1.0", = ["tiktoken"] }
With this feature enabled, you can use the count_tokens tool:
use ;
Architecture
CATS is designed with LLM integration as a first-class concern:
- Structured Outputs: All tools return structured
ToolResulttypes with clear success/error states - Schema Generation: Tools provide JSON schemas for LLM function calling
- Error Handling: Comprehensive error messages with suggestions for resolution
- State Tracking: Maintains context about open files and operations
- Token Awareness: Optional token counting for context management
Integration Examples
With OpenAI Function Calling
use create_tool_registry;
As a CLI Tool
CATS includes a binary that can be used standalone:
# Install the CLI
# Use tools from command line
Platform Support
- Linux (x86_64, aarch64) - Tier 1 (fully supported and tested)
- macOS (x86_64, aarch64) - Tier 2 (builds and tests pass)
- Windows (x86_64) - Tier 3 (best-effort support)
Migration from simpaticoder-tools
CATS is the successor to simpaticoder-tools. The crate has been renamed and extracted for independent use:
# Old (deprecated)
[]
= "0.1.0"
# New
[]
= "0.1.0"
Update imports:
// Old
use ;
// New
use ;
The API surface remains identical - only the crate name has changed.
Documentation
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Acknowledgments
CATS is inspired by and builds upon concepts from:
- SWE-agent - Agent-Computer Interface design
- The broader AI coding agent community
Built for the future of AI-assisted software development. π