cai-plugin
Claude Code plugin interface for CAI.
Overview
cai-plugin provides the plugin interface for integrating CAI with Claude Code. It defines the Plugin trait, manages skill registration, and handles session lifecycle hooks.
Key Features
- Plugin trait - Interface for CAI integration
- Skill registration - Define available skills
- Command handling - Process CLI commands
- Session hooks - Initialize/cleanup on session start/end
- FFI exports - WASM-compatible C interface
Usage
use ;
// Create plugin instance
let plugin = new;
// Get plugin configuration
let config = plugin.config;
// Handle skill invocation
let params = json!;
let result = plugin.handle_skill?;
// Handle command
let result = plugin.handle_command?;
Available Skills
- cai.query - Execute SQL queries
- cai.ingest - Ingest data from sources
- cai.stats - Get statistics
- cai.tui - Launch terminal UI
- cai.web - Launch web dashboard
Plugin Configuration
let config = PluginConfig ;
Design Decisions
- Trait-based - Easy to implement custom plugins
- Skill params - JSON parameters for flexibility
- Session context - Access to working directory and environment
- FFI exports - Compatible with WASM runtimes
API Documentation
Full API docs at docs.rs
License
MIT OR Apache-2.0