Expand description
RiceCoder Custom Commands System
This crate provides a system for defining and managing custom commands in RiceCoder. Commands can be executed with template substitution and output injection into chat.
§Examples
ⓘ
use ricecoder_commands::{CommandDefinition, CommandRegistry, ArgumentType, CommandArgument};
let mut registry = CommandRegistry::new();
// Create a custom command
let cmd = CommandDefinition::new("greet", "Greet User", "echo Hello {{name}}")
.with_description("Greet a user by name")
.with_argument(
CommandArgument::new("name", ArgumentType::String)
.with_description("User name")
.with_required(true)
)
.with_inject_output(true);
// Register the command
registry.register(cmd)?;
// Get the command
let cmd = registry.get("greet")?;Re-exports§
pub use config::ConfigManager;pub use error::CommandError;pub use error::Result;pub use executor::CommandExecutor;pub use manager::CommandManager;pub use output_injection::OutputFormat;pub use output_injection::OutputInjectionConfig;pub use output_injection::OutputInjector;pub use registry::CommandRegistry;pub use template::TemplateProcessor;pub use types::ArgumentType;pub use types::CommandArgument;pub use types::CommandContext;pub use types::CommandDefinition;pub use types::CommandExecutionResult;