caro: fast Rust CLI that turns natural‑language tasks into a safe POSIX command. Built for macOS (MLX/Metal) with a built‑in model; supports vLLM/Ollama/LM Studio. JSON‑only output, safety checks, confirmation, multi‑step goals, devcontainer included.
See the code✨ Now Generally Available! - Published on crates.io with all core features working. Visit caro.sh for more info.
🆕 CaroML preview — Caro now interprets
.carotask files: an eight-keyword line-keyword DSL that lets you commit intent and have Caro generate the script. Per-platform variants, A/B challengers, runbook drift detection, and the bundledcaro-scaffoldskill for any skill-aware coder agent. Seedocs/caroml/intro.mdandexamples/library/system/.
caro (formerly cmdai) converts natural language descriptions into safe POSIX shell commands using local LLMs. Built with Rust for blazing-fast performance, single-binary distribution, and safety-first design with intelligent platform detection.
$ caro "list all PDF files in Downloads folder larger than 10MB"
Generated command:
find ~/Downloads -name "*.pdf" -size +10M -ls
Execute this command? (y/N) y
Have questions or want to discuss caro with other users? Join the community!
Current Version: 1.5.0 (General Availability)
This project is generally available with all core features implemented, tested, and working. The CLI achieves 93.1% pass rate on comprehensive test suite with zero false positives in safety validation.
Note: The project was originally named
cmdaibut has been renamed tocaro. See Naming History for details.
cargo install carocaro do <job>) — commit intent in .caro files, generate per-platform runbooks, track drift, run A/B experimentsIn 2026, Gartner named Guardian Agents as a formal market category: autonomous oversight layers that monitor, constrain, and govern AI agent behavior in production. Microsoft's Agent Governance Toolkit (OWASP + EU AI Act compliance) and Orchid Security's zero-trust identity layer are two early category leaders.
Most guardian agent products focus on policy, identity, and observability — who is the agent, what permissions does it have, what did it do. Caro occupies a complementary but distinct layer: execution safety for shell and tool calls. It sits at the exact point where a prompt becomes a command, applying deterministic validation before anything reaches the OS.
| Guardian concern | Caro's contribution |
|---|---|
| Prompt injection → RCE | Deterministic regex + CVE rule validation breaks the injection→execution chain (see CVE-2026-25592, CVE-2026-26030) |
| Tool-call governance | Every shell command passes through SafetyValidator regardless of which agent or backend produced it |
| Risk-tiered approval | CRITICAL / HIGH / MEDIUM / LOW risk levels map directly onto tiered human-in-the-loop approval patterns |
| Auditability | Structured JSON output and telemetry hooks give guardian orchestrators a machine-readable safety signal |
| Defense in depth | 5-layer validation pipeline (allowlist → built-in patterns → CVE rules → custom patterns → user confirmation) — no single bypass produces execution |
In short: if your guardian agent stack needs a safety primitive that sits between "the LLM decided to run a command" and "the command hits the shell", Caro is that layer.
See docs/GUARDIAN_AGENT.md for the full explainer.
caro is available via Homebrew, Cargo, and as a standalone binary.
| Install | Upgrade |
|---|---|
brew install wildcard/tap/caro | brew upgrade caro |
cargo install caro
# For Apple Silicon with MLX GPU acceleration:
cargo install caro --features embedded-mlx
Download from the releases page or use the install script:
curl -fsSL https://setup.caro.sh | bash
caro is available via Cargo and as precompiled binaries for most Linux distributions.
cargo install caro
# Add repository (coming soon)
# sudo apt install caro
# For now, use the install script:
curl -fsSL https://setup.caro.sh | bash
# Package coming soon. For now, use:
curl -fsSL https://setup.caro.sh | bash
Download from the releases page:
| Platform | Download |
|---|---|
| Linux x86_64 | caro-linux-amd64 |
| Linux ARM64 | caro-linux-arm64 |
caro is available via WinGet, Cargo, and as a standalone binary.
# Coming soon
# winget install wildcard.caro
cargo install caro
Download caro-windows-amd64.exe from the releases page.
git clone https://github.com/wildcard/caro.git
cd caro
cargo build --release
./target/release/caro --version
Prerequisites: Rust 1.85+, CMake. For Apple Silicon GPU acceleration, install Xcode.
See BUILD.md for detailed build instructions.
# Generate a shell command from natural language
caro "list all PDF files larger than 10MB"
# Output:
# Generated command:
# find . -name "*.pdf" -size +10M
#
# Execute this command? (y/N)
caro [OPTIONS] <PROMPT>
# Basic command generation
caro "list all files in the current directory"
# With specific shell
caro --shell zsh "find large files"
# JSON output for scripting
caro --output json "show disk usage"
# Adjust safety level
caro --safety permissive "clean temporary files"
# Auto-confirm dangerous commands
caro --confirm "remove old log files"
# Verbose mode with timing info
caro --verbose "search for Python files"
| Option | Description | Status |
|---|---|---|
-s, --shell <SHELL> | Target shell (bash, zsh, fish, sh, powershell, cmd) | ✅ Implemented |
-b, --backend <BACKEND> | Inference backend (embedded, ollama, exo, vllm, mesh, ai-horde, hybrid) | ✅ Implemented |
-m, --model-name <NAME> | Model name for the backend (e.g., codellama:7b) | ✅ Implemented |
--safety <LEVEL> | Safety level (strict, moderate, permissive) | ✅ Implemented |
-o, --output <FORMAT> | Output format (json, yaml, plain) | ✅ Implemented |
-y, --confirm | Auto-confirm dangerous commands | ✅ Implemented |
-v, --verbose | Enable verbose output with timing | ✅ Implemented |
-c, --config <FILE> | Custom configuration file | ✅ Implemented |
--show-config | Display current configuration | ✅ Implemented |
-x, --execute | Execute the generated command after validation | ✅ Implemented |
-i, --interactive | Interactive mode with step-by-step confirmation | ✅ Implemented |
--dry-run | Show execution plan without running | ✅ Implemented |
--force-llm | Force LLM inference, bypass static pattern matcher | ✅ Implemented |
# Simple command generation
caro "compress all images in current directory"
# With specific backend
caro --backend ollama "find large log files"
# Force LLM inference (bypass cached patterns)
caro --backend embedded --force-llm "list files"
# Verbose mode for debugging
caro --verbose "show disk usage"
Caro is built to be called by other coder agents and agentic IDEs. Pick the surface that matches your stack:
| Tool | How | Status |
|---|---|---|
| Claude Code | Auto-discovered skill at .claude/skills/caro-shell/SKILL.md (bundled with this repo). Triggers when the user asks for shell-command synthesis. | ✅ Working |
| Claude Code (MCP) | caro mcp serve — exposes generate_command / validate_command / explain_safety over the Model Context Protocol. | 🚧 In progress |
| Codex / Cursor / Continue / Aider / Tabby | Point at caro serve --openai (an OpenAI Chat Completions endpoint backed by caro's safety validator). | 🚧 In progress |
| opencode / crush / droid / Sourcegraph Amp / Letta | Via the upcoming caro mcp serve MCP server. | ⏳ Planned |
| Gemini CLI / Jules | Native Gemini backend. | 🚧 In progress (PR #782) |
OpenRouter (incl. auto) | Native backend wrapping openrouter.ai/api/v1. | ⏳ Planned |
Full matrix with copy-paste configs and live status: caro.sh/integrations — maintained by the caro-integrator nightly agent (validates each surface against the published binary every night at 23:00 local time and updates the matrix).
Want caro to integrate with a tool not listed? File an integration request.
For the best experience, add caro's shell integration to your shell configuration. This enables the Edit feature, which lets you modify generated commands directly in your shell before executing them.
zsh - Add to ~/.zshrc:
eval "$(caro init zsh)"
bash - Add to ~/.bashrc:
eval "$(caro init bash)"
fish - Add to ~/.config/fish/config.fish:
caro init fish | source
After adding the integration, restart your shell or run source ~/.zshrc (or equivalent).
When caro generates a command, you'll see three options:
Generated command:
find ~/Downloads -name "*.pdf" -size +10M
Execute this command? (Y)es / (n)o / (e)dit: e
Selecting (e)dit places the command directly into your shell prompt for editing before execution - just like if you had typed it yourself.
Note: Without shell integration, selecting Edit will copy the command to your clipboard instead.
Caro provides a config subcommand for managing persistent settings:
# Show all configuration
caro config show
# Set inference backend
caro config set backend ollama
# Set model name for the backend
caro config set model-name codellama:7b
# Set default shell
caro config set shell zsh
# Set safety level
caro config set safety strict
# Get a specific setting
caro config get backend
# Reset to defaults
caro config reset
Available config keys:
| Key | Values | Description |
|---|---|---|
backend | embedded, ollama, exo, vllm, mesh, ai-horde, hybrid | Inference backend |
model-name | Any valid model name | Model for the backend (e.g., codellama:7b) |
shell | bash, zsh, fish, sh, powershell, cmd | Default target shell |
safety | strict, moderate, permissive | Safety validation level |
Config file location: ~/.config/caro/config.toml (Linux/macOS)
Priority order: CLI flags (--backend, --model-name) > Environment variables > Config file > Auto-detect
[backends])Remote endpoint URLs and keys are configurable, so you can point Caro at a non-default port or a self-hosted service without recompiling:
[backends]
# Mesh-LLM: pool GPUs across your own machines (OpenAI-compatible, :9337)
mesh_url = "http://localhost:9337"
# AI-Horde: free crowdsourced cluster (anonymous key works out of the box)
ai_horde_url = "https://aihorde.net/api"
ai_horde_key = "0000000000"
# Hybrid gateway: which remote enhancer to wrap (mesh | ai-horde)
hybrid_remote = "mesh"
# Send prompts verbatim to a (trusted) remote instead of sanitizing PII first.
# Leave false to keep the privacy guarantee on public networks.
allow_public = false
mesh — Mesh-LLM pools GPU/RAM
across machines you own, behind one OpenAI-compatible API. Best when a model
is too big for one box but you want it private.ai-horde — AI-Horde is a free
volunteer cluster needing no GPU and no API key. Explicit opt-in only.hybrid (recommended for remote use) — runs a local sanitizer that
redacts PII (paths, usernames, IPs, emails) into reversible placeholders
before sending to the remote enhancer, then restores real values in the
returned command locally. The network never sees your private data unless you
set allow_public = true. See
ADR-015.Caro can assess your system's hardware capabilities and recommend optimal model configurations:
# Basic assessment
caro assess
# Export to JSON
caro assess --export json --output assessment.json
# Export to Markdown
caro assess --export markdown --output assessment.md
The assessment command detects:
Supported Platforms: macOS, Linux, Windows
Backends: MLX (Apple Silicon), CUDA (NVIDIA), CPU-only
For more details, run caro assess --help.
caro/
├── src/
│ ├── main.rs # CLI entry point
│ ├── backends/ # LLM backend implementations
│ │ ├── mod.rs # Backend trait definition
│ │ ├── mlx.rs # Apple Silicon MLX backend
│ │ ├── vllm.rs # vLLM remote backend
│ │ └── ollama.rs # Ollama local backend
│ ├── safety/ # Command validation
│ │ └── mod.rs # Safety validator
│ ├── cache/ # Model caching
│ ├── config/ # Configuration management
│ ├── cli/ # CLI interface
│ ├── models/ # Data models
│ └── execution/ # Command execution
├── tests/ # Contract-based tests
└── specs/ # Project specifications
caro uses a sophisticated 2-iteration agentic loop for generating platform-appropriate commands:
Iteration 1: Context-Aware Generation
Iteration 2: Smart Refinement (triggered when needed)
Example Flow:
User: "show top 5 processes by CPU"
↓
Context Detection: macOS 14.2, arm64, zsh
↓
Iteration 1: Generates with macOS rules
↓
Smart Refinement: Fixes BSD sort syntax
↓
Result: ps aux | sort -nrk 3,3 | head -6
#[async_trait]
trait CommandGenerator {
async fn generate_command(&self, request: &CommandRequest)
-> Result<GeneratedCommand, GeneratorError>;
async fn is_available(&self) -> bool;
fn backend_info(&self) -> BackendInfo;
}
Caro supports pluggable vector database backends for storing and retrieving command knowledge:
Backend Options:
Feature Flag:
# Build with ChromaDB support
cargo build --features chromadb
Usage Examples:
# LanceDB (default - automatic)
caro "list all python files"
# Local ChromaDB server
caro --knowledge-backend chromadb --chromadb-url http://localhost:8000 "list files"
# Chroma Cloud
export CHROMA_API_KEY=your-api-key
caro --knowledge-backend chromadb --chromadb-url https://api.trychroma.com "list files"
Configuration:
# ~/.config/caro/config.toml
# LanceDB (default)
[knowledge]
backend = "lancedb"
# ChromaDB (local server)
[knowledge]
backend = "chromadb"
[knowledge.chromadb]
url = "http://localhost:8000"
# ChromaDB (Chroma Cloud)
[knowledge]
backend = "chromadb"
[knowledge.chromadb]
url = "https://api.trychroma.com"
auth_token = "${CHROMA_API_KEY}"
⚠️ Current Limitations:
The ChromaDB integration is functional but has the following known limitations that are planned for Phase 6:
Single Collection Storage - All knowledge entries are stored in a single ChromaDB collection
Profile Field Not Persisted - User profiles exist but don't affect knowledge storage/retrieval yet
None when reading entriescommand_count and last_used tracking not yet wiredStats Aggregation - Backend stats count all entries together
No Migration Tool - Cannot migrate existing LanceDB knowledge to ChromaDB
caro knowledge migrate --from lancedb --to chromadbWhat Works:
CHROMA_API_KEYComing in Phase 6: (Tracked in GitHub issues)
For current usage, ChromaDB works well for basic command storage and retrieval, but advanced features (profiles, collections) are foundations for future work.
# Clone and enter the project
git clone https://github.com/wildcard/caro.git
cd caro
# Install dependencies and build
cargo build
# Run tests
cargo test
# Check formatting
cargo fmt -- --check
# Run clippy linter
cargo clippy -- -D warnings
caro supports multiple inference backends with automatic fallback:
Configure in ~/.config/caro/config.toml:
[backend]
primary = "embedded" # or "ollama", "vllm"
enable_fallback = true
[backend.ollama]
base_url = "http://localhost:11434"
model_name = "codellama:7b"
[backend.vllm]
base_url = "http://localhost:8000"
model_name = "codellama/CodeLlama-7b-hf"
api_key = "optional-api-key"
caro can use vector databases to learn from your command history and provide smarter suggestions. Two backends are supported:
Requirements:
--features chromadbWhy 0.5.18+?
The chromadb-rs v2.3.0 crate requires /api/v2 endpoints which were added in ChromaDB 0.5.x.
Quick Start:
# Start ChromaDB server
docker run -p 8000:8000 chromadb/chroma:0.5.18
# Build caro with ChromaDB support
cargo build --features chromadb --release
# Use ChromaDB backend
caro --knowledge-backend chromadb "list files"
Configuration:
# Via environment variable
export CHROMADB_URL=http://localhost:8000
export CHROMADB_AUTH_TOKEN=your-token-here
# Or via config file (~/.config/caro/config.toml)
[knowledge]
backend = "chromadb"
[knowledge.chromadb]
url = "http://localhost:8000"
auth_token = "your-token-here" # Optional - for production deployments
Use Cases:
The project uses several configuration files:
Cargo.toml - Rust dependencies and build configuration~/.config/caro/config.toml - User configurationclippy.toml - Linter rulesrustfmt.toml - Code formatting rulesdeny.toml - Dependency audit configurationThe project uses contract-based testing:
caro includes comprehensive safety validation to prevent dangerous operations:
rm -rf /, rm -rf ~):(){:|:&};:)mkfs, dd if=/dev/zero)sudo su, chmod 777 /)/bin, /usr, /etc)Configure safety levels in ~/.config/caro/config.toml:
[safety]
enabled = true
level = "moderate" # strict, moderate, or permissive
require_confirmation = true
custom_patterns = ["additional", "dangerous", "patterns"]
Caro's safety layer is kept current against newly-disclosed CVEs and 0day attack signatures by a back-office authoring pipeline (spec 010). It runs only during development/CI — end users make zero network calls to any CVE source at runtime.
.github/workflows/cve-rule-sync.yml)
— queries NVD + CISA KEV + GHSA for new shell-invocation CVEs (CVSS ≥ 7.0)
and opens a PR adding a draft data/cve_rules/CVE-*.yaml file.caro.security.update maintainer skill) —
invoke via claude --skill caro.security.update --arg CVE-<id> when a 0day
lands between cron runs; same authoring flow, runs on demand.build.rs compiles data/cve_rules/*.yaml into a
bincode blob included in the binary via include_bytes!. The caro --version output lists the embedded rule count as cve rules: N.Runtime behaviour is unchanged: CVE patterns run through the same regex
validation loop as the built-in patterns (src/safety/mod.rs) against
locally-embedded rules — no network, no added latency, no telemetry. See
specs/010-nimble-cve-pipeline/ for the full
design.
Caro includes optional usage telemetry to help us improve the product.
Telemetry is disabled by default. Enable it to help improve Caro:
caro config set telemetry.enabled true
Your privacy is our top priority. All data is anonymous, stored locally first, and validated before any upload.
# View collected data
caro telemetry show
# Check status
caro telemetry status
# Disable telemetry
caro config set telemetry.enabled false
# Export for air-gapped environments
caro telemetry export --output telemetry.json
# Clear all data
caro telemetry clear
Full details: See docs/TELEMETRY.md for complete privacy policy and technical details.
We're building the safety layer for AI-to-terminal interactions, and we need your help.
cmdai is more than a CLI tool - it's a collective knowledge base of terminal expertise. Every safety pattern you contribute, every edge case you document, every test you write helps make the terminal safer and more accessible for everyone.
New to open source? We want to be your first project!
👉 Start here: FIRST_TIME_CONTRIBUTORS.md
We've created 10 fabulous first-time issues designed for newcomers:
See all issues in .github/first-time-issues/
Your expertise matters:
What's in it for you:
Never contributed to OSS before? We have good first issues with step-by-step guidance.
Experienced developer? Check out our roadmap and feature specs.
Domain expert (non-technical)? Submit safety patterns or share your use cases.
Code contributions:
Non-code contributions:
good-first-issueQuestions? Open a discussion or comment on an issue. We're here to help.
Every contribution moves us closer to a safer, more accessible terminal for everyone. Thank you for being part of this journey.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
The Kyaro character artwork in assets/kyaro/ is NOT covered by the AGPL license. These assets are separately licensed under a proprietary license that restricts their use to this project only. See assets/kyaro/README.md for full terms. If you fork or redistribute this project, you must exclude the Kyaro assets unless you have explicit permission from the copyright holders (Kobi Kadosh and Alrezky Caesaria).
/specs directory for detailed specificationsBuilt with Rust | Safety First | Open Source
Note: This is an active development project. Features and APIs are subject to change. See the specs directory for detailed design documentation.
The caro crate name was generously provided by its previous maintainer. If you're looking for the original "creation-addressed replicated objects" project, it remains available at crates.io/crates/caro/0.7.1.
Rust
44.6%
Astro
26.0%
TypeScript
8.9%
Makefile
7.4%
Shell
4.3%
JavaScript
2.2%
Python
2.2%
CSS
1.6%
caro: fast Rust CLI that turns natural‑language tasks into a safe POSIX command. Built for macOS (MLX/Metal) with a built‑in model; supports vLLM/Ollama/LM Studio. JSON‑only output, safety checks, confirmation, multi‑step goals, devcontainer included.
See the code✨ Now Generally Available! - Published on crates.io with all core features working. Visit caro.sh for more info.
🆕 CaroML preview — Caro now interprets
.carotask files: an eight-keyword line-keyword DSL that lets you commit intent and have Caro generate the script. Per-platform variants, A/B challengers, runbook drift detection, and the bundledcaro-scaffoldskill for any skill-aware coder agent. Seedocs/caroml/intro.mdandexamples/library/system/.
caro (formerly cmdai) converts natural language descriptions into safe POSIX shell commands using local LLMs. Built with Rust for blazing-fast performance, single-binary distribution, and safety-first design with intelligent platform detection.
$ caro "list all PDF files in Downloads folder larger than 10MB"
Generated command:
find ~/Downloads -name "*.pdf" -size +10M -ls
Execute this command? (y/N) y
Have questions or want to discuss caro with other users? Join the community!
Current Version: 1.5.0 (General Availability)
This project is generally available with all core features implemented, tested, and working. The CLI achieves 93.1% pass rate on comprehensive test suite with zero false positives in safety validation.
Note: The project was originally named
cmdaibut has been renamed tocaro. See Naming History for details.
cargo install carocaro do <job>) — commit intent in .caro files, generate per-platform runbooks, track drift, run A/B experimentsIn 2026, Gartner named Guardian Agents as a formal market category: autonomous oversight layers that monitor, constrain, and govern AI agent behavior in production. Microsoft's Agent Governance Toolkit (OWASP + EU AI Act compliance) and Orchid Security's zero-trust identity layer are two early category leaders.
Most guardian agent products focus on policy, identity, and observability — who is the agent, what permissions does it have, what did it do. Caro occupies a complementary but distinct layer: execution safety for shell and tool calls. It sits at the exact point where a prompt becomes a command, applying deterministic validation before anything reaches the OS.
| Guardian concern | Caro's contribution |
|---|---|
| Prompt injection → RCE | Deterministic regex + CVE rule validation breaks the injection→execution chain (see CVE-2026-25592, CVE-2026-26030) |
| Tool-call governance | Every shell command passes through SafetyValidator regardless of which agent or backend produced it |
| Risk-tiered approval | CRITICAL / HIGH / MEDIUM / LOW risk levels map directly onto tiered human-in-the-loop approval patterns |
| Auditability | Structured JSON output and telemetry hooks give guardian orchestrators a machine-readable safety signal |
| Defense in depth | 5-layer validation pipeline (allowlist → built-in patterns → CVE rules → custom patterns → user confirmation) — no single bypass produces execution |
In short: if your guardian agent stack needs a safety primitive that sits between "the LLM decided to run a command" and "the command hits the shell", Caro is that layer.
See docs/GUARDIAN_AGENT.md for the full explainer.
caro is available via Homebrew, Cargo, and as a standalone binary.
| Install | Upgrade |
|---|---|
brew install wildcard/tap/caro | brew upgrade caro |
cargo install caro
# For Apple Silicon with MLX GPU acceleration:
cargo install caro --features embedded-mlx
Download from the releases page or use the install script:
curl -fsSL https://setup.caro.sh | bash
caro is available via Cargo and as precompiled binaries for most Linux distributions.
cargo install caro
# Add repository (coming soon)
# sudo apt install caro
# For now, use the install script:
curl -fsSL https://setup.caro.sh | bash
# Package coming soon. For now, use:
curl -fsSL https://setup.caro.sh | bash
Download from the releases page:
| Platform | Download |
|---|---|
| Linux x86_64 | caro-linux-amd64 |
| Linux ARM64 | caro-linux-arm64 |
caro is available via WinGet, Cargo, and as a standalone binary.
# Coming soon
# winget install wildcard.caro
cargo install caro
Download caro-windows-amd64.exe from the releases page.
git clone https://github.com/wildcard/caro.git
cd caro
cargo build --release
./target/release/caro --version
Prerequisites: Rust 1.85+, CMake. For Apple Silicon GPU acceleration, install Xcode.
See BUILD.md for detailed build instructions.
# Generate a shell command from natural language
caro "list all PDF files larger than 10MB"
# Output:
# Generated command:
# find . -name "*.pdf" -size +10M
#
# Execute this command? (y/N)
caro [OPTIONS] <PROMPT>
# Basic command generation
caro "list all files in the current directory"
# With specific shell
caro --shell zsh "find large files"
# JSON output for scripting
caro --output json "show disk usage"
# Adjust safety level
caro --safety permissive "clean temporary files"
# Auto-confirm dangerous commands
caro --confirm "remove old log files"
# Verbose mode with timing info
caro --verbose "search for Python files"
| Option | Description | Status |
|---|---|---|
-s, --shell <SHELL> | Target shell (bash, zsh, fish, sh, powershell, cmd) | ✅ Implemented |
-b, --backend <BACKEND> | Inference backend (embedded, ollama, exo, vllm, mesh, ai-horde, hybrid) | ✅ Implemented |
-m, --model-name <NAME> | Model name for the backend (e.g., codellama:7b) | ✅ Implemented |
--safety <LEVEL> | Safety level (strict, moderate, permissive) | ✅ Implemented |
-o, --output <FORMAT> | Output format (json, yaml, plain) | ✅ Implemented |
-y, --confirm | Auto-confirm dangerous commands | ✅ Implemented |
-v, --verbose | Enable verbose output with timing | ✅ Implemented |
-c, --config <FILE> | Custom configuration file | ✅ Implemented |
--show-config | Display current configuration | ✅ Implemented |
-x, --execute | Execute the generated command after validation | ✅ Implemented |
-i, --interactive | Interactive mode with step-by-step confirmation | ✅ Implemented |
--dry-run | Show execution plan without running | ✅ Implemented |
--force-llm | Force LLM inference, bypass static pattern matcher | ✅ Implemented |
# Simple command generation
caro "compress all images in current directory"
# With specific backend
caro --backend ollama "find large log files"
# Force LLM inference (bypass cached patterns)
caro --backend embedded --force-llm "list files"
# Verbose mode for debugging
caro --verbose "show disk usage"
Caro is built to be called by other coder agents and agentic IDEs. Pick the surface that matches your stack:
| Tool | How | Status |
|---|---|---|
| Claude Code | Auto-discovered skill at .claude/skills/caro-shell/SKILL.md (bundled with this repo). Triggers when the user asks for shell-command synthesis. | ✅ Working |
| Claude Code (MCP) | caro mcp serve — exposes generate_command / validate_command / explain_safety over the Model Context Protocol. | 🚧 In progress |
| Codex / Cursor / Continue / Aider / Tabby | Point at caro serve --openai (an OpenAI Chat Completions endpoint backed by caro's safety validator). | 🚧 In progress |
| opencode / crush / droid / Sourcegraph Amp / Letta | Via the upcoming caro mcp serve MCP server. | ⏳ Planned |
| Gemini CLI / Jules | Native Gemini backend. | 🚧 In progress (PR #782) |
OpenRouter (incl. auto) | Native backend wrapping openrouter.ai/api/v1. | ⏳ Planned |
Full matrix with copy-paste configs and live status: caro.sh/integrations — maintained by the caro-integrator nightly agent (validates each surface against the published binary every night at 23:00 local time and updates the matrix).
Want caro to integrate with a tool not listed? File an integration request.
For the best experience, add caro's shell integration to your shell configuration. This enables the Edit feature, which lets you modify generated commands directly in your shell before executing them.
zsh - Add to ~/.zshrc:
eval "$(caro init zsh)"
bash - Add to ~/.bashrc:
eval "$(caro init bash)"
fish - Add to ~/.config/fish/config.fish:
caro init fish | source
After adding the integration, restart your shell or run source ~/.zshrc (or equivalent).
When caro generates a command, you'll see three options:
Generated command:
find ~/Downloads -name "*.pdf" -size +10M
Execute this command? (Y)es / (n)o / (e)dit: e
Selecting (e)dit places the command directly into your shell prompt for editing before execution - just like if you had typed it yourself.
Note: Without shell integration, selecting Edit will copy the command to your clipboard instead.
Caro provides a config subcommand for managing persistent settings:
# Show all configuration
caro config show
# Set inference backend
caro config set backend ollama
# Set model name for the backend
caro config set model-name codellama:7b
# Set default shell
caro config set shell zsh
# Set safety level
caro config set safety strict
# Get a specific setting
caro config get backend
# Reset to defaults
caro config reset
Available config keys:
| Key | Values | Description |
|---|---|---|
backend | embedded, ollama, exo, vllm, mesh, ai-horde, hybrid | Inference backend |
model-name | Any valid model name | Model for the backend (e.g., codellama:7b) |
shell | bash, zsh, fish, sh, powershell, cmd | Default target shell |
safety | strict, moderate, permissive | Safety validation level |
Config file location: ~/.config/caro/config.toml (Linux/macOS)
Priority order: CLI flags (--backend, --model-name) > Environment variables > Config file > Auto-detect
[backends])Remote endpoint URLs and keys are configurable, so you can point Caro at a non-default port or a self-hosted service without recompiling:
[backends]
# Mesh-LLM: pool GPUs across your own machines (OpenAI-compatible, :9337)
mesh_url = "http://localhost:9337"
# AI-Horde: free crowdsourced cluster (anonymous key works out of the box)
ai_horde_url = "https://aihorde.net/api"
ai_horde_key = "0000000000"
# Hybrid gateway: which remote enhancer to wrap (mesh | ai-horde)
hybrid_remote = "mesh"
# Send prompts verbatim to a (trusted) remote instead of sanitizing PII first.
# Leave false to keep the privacy guarantee on public networks.
allow_public = false
mesh — Mesh-LLM pools GPU/RAM
across machines you own, behind one OpenAI-compatible API. Best when a model
is too big for one box but you want it private.ai-horde — AI-Horde is a free
volunteer cluster needing no GPU and no API key. Explicit opt-in only.hybrid (recommended for remote use) — runs a local sanitizer that
redacts PII (paths, usernames, IPs, emails) into reversible placeholders
before sending to the remote enhancer, then restores real values in the
returned command locally. The network never sees your private data unless you
set allow_public = true. See
ADR-015.Caro can assess your system's hardware capabilities and recommend optimal model configurations:
# Basic assessment
caro assess
# Export to JSON
caro assess --export json --output assessment.json
# Export to Markdown
caro assess --export markdown --output assessment.md
The assessment command detects:
Supported Platforms: macOS, Linux, Windows
Backends: MLX (Apple Silicon), CUDA (NVIDIA), CPU-only
For more details, run caro assess --help.
caro/
├── src/
│ ├── main.rs # CLI entry point
│ ├── backends/ # LLM backend implementations
│ │ ├── mod.rs # Backend trait definition
│ │ ├── mlx.rs # Apple Silicon MLX backend
│ │ ├── vllm.rs # vLLM remote backend
│ │ └── ollama.rs # Ollama local backend
│ ├── safety/ # Command validation
│ │ └── mod.rs # Safety validator
│ ├── cache/ # Model caching
│ ├── config/ # Configuration management
│ ├── cli/ # CLI interface
│ ├── models/ # Data models
│ └── execution/ # Command execution
├── tests/ # Contract-based tests
└── specs/ # Project specifications
caro uses a sophisticated 2-iteration agentic loop for generating platform-appropriate commands:
Iteration 1: Context-Aware Generation
Iteration 2: Smart Refinement (triggered when needed)
Example Flow:
User: "show top 5 processes by CPU"
↓
Context Detection: macOS 14.2, arm64, zsh
↓
Iteration 1: Generates with macOS rules
↓
Smart Refinement: Fixes BSD sort syntax
↓
Result: ps aux | sort -nrk 3,3 | head -6
#[async_trait]
trait CommandGenerator {
async fn generate_command(&self, request: &CommandRequest)
-> Result<GeneratedCommand, GeneratorError>;
async fn is_available(&self) -> bool;
fn backend_info(&self) -> BackendInfo;
}
Caro supports pluggable vector database backends for storing and retrieving command knowledge:
Backend Options:
Feature Flag:
# Build with ChromaDB support
cargo build --features chromadb
Usage Examples:
# LanceDB (default - automatic)
caro "list all python files"
# Local ChromaDB server
caro --knowledge-backend chromadb --chromadb-url http://localhost:8000 "list files"
# Chroma Cloud
export CHROMA_API_KEY=your-api-key
caro --knowledge-backend chromadb --chromadb-url https://api.trychroma.com "list files"
Configuration:
# ~/.config/caro/config.toml
# LanceDB (default)
[knowledge]
backend = "lancedb"
# ChromaDB (local server)
[knowledge]
backend = "chromadb"
[knowledge.chromadb]
url = "http://localhost:8000"
# ChromaDB (Chroma Cloud)
[knowledge]
backend = "chromadb"
[knowledge.chromadb]
url = "https://api.trychroma.com"
auth_token = "${CHROMA_API_KEY}"
⚠️ Current Limitations:
The ChromaDB integration is functional but has the following known limitations that are planned for Phase 6:
Single Collection Storage - All knowledge entries are stored in a single ChromaDB collection
Profile Field Not Persisted - User profiles exist but don't affect knowledge storage/retrieval yet
None when reading entriescommand_count and last_used tracking not yet wiredStats Aggregation - Backend stats count all entries together
No Migration Tool - Cannot migrate existing LanceDB knowledge to ChromaDB
caro knowledge migrate --from lancedb --to chromadbWhat Works:
CHROMA_API_KEYComing in Phase 6: (Tracked in GitHub issues)
For current usage, ChromaDB works well for basic command storage and retrieval, but advanced features (profiles, collections) are foundations for future work.
# Clone and enter the project
git clone https://github.com/wildcard/caro.git
cd caro
# Install dependencies and build
cargo build
# Run tests
cargo test
# Check formatting
cargo fmt -- --check
# Run clippy linter
cargo clippy -- -D warnings
caro supports multiple inference backends with automatic fallback:
Configure in ~/.config/caro/config.toml:
[backend]
primary = "embedded" # or "ollama", "vllm"
enable_fallback = true
[backend.ollama]
base_url = "http://localhost:11434"
model_name = "codellama:7b"
[backend.vllm]
base_url = "http://localhost:8000"
model_name = "codellama/CodeLlama-7b-hf"
api_key = "optional-api-key"
caro can use vector databases to learn from your command history and provide smarter suggestions. Two backends are supported:
Requirements:
--features chromadbWhy 0.5.18+?
The chromadb-rs v2.3.0 crate requires /api/v2 endpoints which were added in ChromaDB 0.5.x.
Quick Start:
# Start ChromaDB server
docker run -p 8000:8000 chromadb/chroma:0.5.18
# Build caro with ChromaDB support
cargo build --features chromadb --release
# Use ChromaDB backend
caro --knowledge-backend chromadb "list files"
Configuration:
# Via environment variable
export CHROMADB_URL=http://localhost:8000
export CHROMADB_AUTH_TOKEN=your-token-here
# Or via config file (~/.config/caro/config.toml)
[knowledge]
backend = "chromadb"
[knowledge.chromadb]
url = "http://localhost:8000"
auth_token = "your-token-here" # Optional - for production deployments
Use Cases:
The project uses several configuration files:
Cargo.toml - Rust dependencies and build configuration~/.config/caro/config.toml - User configurationclippy.toml - Linter rulesrustfmt.toml - Code formatting rulesdeny.toml - Dependency audit configurationThe project uses contract-based testing:
caro includes comprehensive safety validation to prevent dangerous operations:
rm -rf /, rm -rf ~):(){:|:&};:)mkfs, dd if=/dev/zero)sudo su, chmod 777 /)/bin, /usr, /etc)Configure safety levels in ~/.config/caro/config.toml:
[safety]
enabled = true
level = "moderate" # strict, moderate, or permissive
require_confirmation = true
custom_patterns = ["additional", "dangerous", "patterns"]
Caro's safety layer is kept current against newly-disclosed CVEs and 0day attack signatures by a back-office authoring pipeline (spec 010). It runs only during development/CI — end users make zero network calls to any CVE source at runtime.
.github/workflows/cve-rule-sync.yml)
— queries NVD + CISA KEV + GHSA for new shell-invocation CVEs (CVSS ≥ 7.0)
and opens a PR adding a draft data/cve_rules/CVE-*.yaml file.caro.security.update maintainer skill) —
invoke via claude --skill caro.security.update --arg CVE-<id> when a 0day
lands between cron runs; same authoring flow, runs on demand.build.rs compiles data/cve_rules/*.yaml into a
bincode blob included in the binary via include_bytes!. The caro --version output lists the embedded rule count as cve rules: N.Runtime behaviour is unchanged: CVE patterns run through the same regex
validation loop as the built-in patterns (src/safety/mod.rs) against
locally-embedded rules — no network, no added latency, no telemetry. See
specs/010-nimble-cve-pipeline/ for the full
design.
Caro includes optional usage telemetry to help us improve the product.
Telemetry is disabled by default. Enable it to help improve Caro:
caro config set telemetry.enabled true
Your privacy is our top priority. All data is anonymous, stored locally first, and validated before any upload.
# View collected data
caro telemetry show
# Check status
caro telemetry status
# Disable telemetry
caro config set telemetry.enabled false
# Export for air-gapped environments
caro telemetry export --output telemetry.json
# Clear all data
caro telemetry clear
Full details: See docs/TELEMETRY.md for complete privacy policy and technical details.
We're building the safety layer for AI-to-terminal interactions, and we need your help.
cmdai is more than a CLI tool - it's a collective knowledge base of terminal expertise. Every safety pattern you contribute, every edge case you document, every test you write helps make the terminal safer and more accessible for everyone.
New to open source? We want to be your first project!
👉 Start here: FIRST_TIME_CONTRIBUTORS.md
We've created 10 fabulous first-time issues designed for newcomers:
See all issues in .github/first-time-issues/
Your expertise matters:
What's in it for you:
Never contributed to OSS before? We have good first issues with step-by-step guidance.
Experienced developer? Check out our roadmap and feature specs.
Domain expert (non-technical)? Submit safety patterns or share your use cases.
Code contributions:
Non-code contributions:
good-first-issueQuestions? Open a discussion or comment on an issue. We're here to help.
Every contribution moves us closer to a safer, more accessible terminal for everyone. Thank you for being part of this journey.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
The Kyaro character artwork in assets/kyaro/ is NOT covered by the AGPL license. These assets are separately licensed under a proprietary license that restricts their use to this project only. See assets/kyaro/README.md for full terms. If you fork or redistribute this project, you must exclude the Kyaro assets unless you have explicit permission from the copyright holders (Kobi Kadosh and Alrezky Caesaria).
/specs directory for detailed specificationsBuilt with Rust | Safety First | Open Source
Note: This is an active development project. Features and APIs are subject to change. See the specs directory for detailed design documentation.
The caro crate name was generously provided by its previous maintainer. If you're looking for the original "creation-addressed replicated objects" project, it remains available at crates.io/crates/caro/0.7.1.
Rust
44.6%
Astro
26.0%
TypeScript
8.9%
Makefile
7.4%
Shell
4.3%
JavaScript
2.2%
Python
2.2%
CSS
1.6%