ricecoder_commands/lib.rs
1//! RiceCoder Custom Commands System
2//!
3//! This crate provides a system for defining and managing custom commands in RiceCoder.
4//! Commands can be executed with template substitution and output injection into chat.
5//!
6//! # Examples
7//!
8//! ```ignore
9//! use ricecoder_commands::{CommandDefinition, CommandRegistry, ArgumentType, CommandArgument};
10//!
11//! let mut registry = CommandRegistry::new();
12//!
13//! // Create a custom command
14//! let cmd = CommandDefinition::new("greet", "Greet User", "echo Hello {{name}}")
15//! .with_description("Greet a user by name")
16//! .with_argument(
17//! CommandArgument::new("name", ArgumentType::String)
18//! .with_description("User name")
19//! .with_required(true)
20//! )
21//! .with_inject_output(true);
22//!
23//! // Register the command
24//! registry.register(cmd)?;
25//!
26//! // Get the command
27//! let cmd = registry.get("greet")?;
28//! ```
29
30pub mod config;
31pub mod error;
32pub mod executor;
33pub mod manager;
34pub mod output_injection;
35pub mod registry;
36pub mod template;
37pub mod types;
38
39pub use config::ConfigManager;
40pub use error::{CommandError, Result};
41pub use executor::CommandExecutor;
42pub use manager::CommandManager;
43pub use output_injection::{OutputFormat, OutputInjectionConfig, OutputInjector};
44pub use registry::CommandRegistry;
45pub use template::TemplateProcessor;
46pub use types::{
47 ArgumentType, CommandArgument, CommandContext, CommandDefinition, CommandExecutionResult,
48};