Crate caro

Crate caro 

Source
Expand description

caro - Natural Language to Shell Command CLI Tool

This library provides core functionality for converting natural language descriptions into safe, POSIX-compliant shell commands using local LLMs.

§Core Modules

  • models - Core data types (CommandRequest, GeneratedCommand, enums)
  • safety - Safety validation with dangerous command detection
  • backends - Command generation backends (Embedded, Ollama, vLLM)
  • context - Execution context detection and platform-specific rules
  • agent - Agentic loop for iterative command refinement
  • cli - CLI interface and argument parsing
  • cache - Model caching with integrity validation
  • config - Configuration management with TOML support
  • execution - Execution context capture and shell detection
  • logging - Structured logging with sensitive data redaction

§Example

use caro::models::{CommandRequest, ShellType, SafetyLevel};

let request = CommandRequest::new("list all files", ShellType::Bash)
    .with_safety(SafetyLevel::Moderate);

Re-exports§

pub use model_catalog::ModelCatalog;
pub use model_catalog::ModelInfo;
pub use model_catalog::ModelSize;
pub use models::BackendInfo;
pub use models::BackendType;
pub use models::CacheManifest;
pub use models::CachedModel;
pub use models::CommandRequest;
pub use models::ConfigSchema;
pub use models::ExecutionContext;
pub use models::GeneratedCommand;
pub use models::LogEntry;
pub use models::LogLevel;
pub use models::Platform;
pub use models::RiskLevel;
pub use models::SafetyLevel;
pub use models::ShellType;
pub use models::UserConfiguration;
pub use models::UserConfigurationBuilder;
pub use cache::CacheError;
pub use cache::CacheManager;
pub use cache::CacheStats;
pub use cache::IntegrityReport;
pub use config::ConfigError;
pub use config::ConfigManager;
pub use execution::ExecutionError;
pub use execution::PlatformDetector;
pub use execution::ShellDetector;
pub use logging::LogConfig;
pub use logging::LogConfigBuilder;
pub use logging::LogError;
pub use logging::LogFormat;
pub use logging::LogOutput;
pub use logging::Logger;
pub use logging::Redaction;
pub use model_loader::ModelLoader;
pub use platform::PlatformContext;
pub use platform::PlatformContextBuilder;
pub use platform::PlatformContextError;
pub use platform::UtilityType;
pub use backends::embedded::CpuBackend;
pub use backends::embedded::EmbeddedConfig;
pub use backends::embedded::EmbeddedModelBackend;
pub use backends::embedded::InferenceBackend;
pub use backends::embedded::ModelVariant;
pub use backends::BackendInfo as BackendInfoTrait;
pub use backends::CommandGenerator;
pub use backends::GeneratorError;

Modules§

agent
backends
cache
Cache module for managing Hugging Face model downloads and local storage
cli
config
Configuration module for managing user preferences and settings
context
execution
Execution module for capturing runtime context and shell detection
logging
Logging module with tracing integration and sensitive data redaction
model_catalog
model_loader
models
platform
Platform detection and context for command validation
safety
Safety module - Command safety validation and risk assessment
version
Version information module for Caro