Carp CLI
Command-line tool for the Claude Agent Registry Portal (Carp).
Features
- Search Agents: Find agents in the registry with powerful search functionality
- Pull Agents: Download and extract agents locally for use
- Publish Agents: Package and upload your agents to the registry
- Create Templates: Generate new agent projects with built-in templates
Installation
From Source
The binary will be available at cli/target/release/carp.
From Crates.io (Coming Soon)
Usage
Search for Agents
# Basic search
# Limit results
# Exact match only
Pull an Agent
# Pull latest version
# Pull specific version
# Pull to specific directory
# Force overwrite existing directory
Create a New Agent
# Create basic agent template
# Create with specific template
# Create in specific directory
# Available templates: basic, advanced, python
Publish an Agent
# Publish from current directory (requires Carp.toml)
# Publish with specific manifest
# Dry run (validate without publishing)
# Skip confirmation prompts
Configuration
Configuration is stored in ~/.config/carp/config.toml:
= "https://api.carp.refcell.org"
= "your-api-token"
= 30
= true
= "/path/to/agents"
Agent Manifest (Carp.toml)
= "my-agent"
= "1.0.0"
= "A Claude AI agent that does amazing things"
= "Your Name <your.email@example.com>"
= "MIT"
= "https://github.com/username/my-agent"
= "https://github.com/username/my-agent"
= ["claude", "ai", "automation"]
= [
"README.md",
"agent.py",
"config.toml",
"src/"
]
= "agent.py"
[]
# Optional: dependencies on other agents
# other-agent = "1.0.0"
Development
Building
Testing
Linting
Formatting
Security
The Carp CLI includes several security features:
- Secure Config Storage: API tokens stored with restricted file permissions (600)
- Path Traversal Protection: ZIP extraction validates paths to prevent directory traversal
- HTTPS by Default: All network requests use HTTPS
- URL Validation: Registry URLs are validated for format and security
- Input Validation: All user inputs are validated and sanitized
Architecture
The CLI is built with a modular architecture:
src/
├── main.rs # CLI entry point and argument parsing
├── lib.rs # Library exports
├── commands/ # Command implementations
│ ├── search.rs # Agent search functionality
│ ├── pull.rs # Agent download and extraction
│ ├── publish.rs # Agent packaging and upload
│ └── new.rs # Template generation
├── config/ # Configuration management
├── api/ # HTTP client for registry API
├── auth/ # Authentication handling
└── utils/ # Shared utilities and error handling
Error Handling
The CLI provides comprehensive error handling with user-friendly messages:
- Network connectivity issues
- Authentication failures
- File system errors
- Manifest validation errors
- API rate limiting and server errors
Contributing
This CLI tool follows Rust best practices:
- MSRV: 1.82
- No warnings policy (clippy warnings treated as errors)
- Comprehensive error handling
- Security-first design
- Full test coverage (coming soon)
License
MIT License - see LICENSE for details.