Expand description
Framework adapter system for multi-platform AI coding assistant support.
This module provides a trait-based abstraction for different AI coding assistant platforms (Claude, Cursor, Gemini, OpenCode, Codex), allowing mi6 to capture hook events from any supported platform.
§Architecture
Each platform has its own adapter implementing FrameworkAdapter that handles:
- Hook configuration generation for
mi6 enable - Event parsing and normalization for
mi6 ingest event - Framework detection from environment variables
§Supported Frameworks
- claude: The default, fully supported framework (Anthropic’s Claude Code)
- gemini: Google’s Gemini CLI tool
- codex: OpenAI’s Codex CLI tool
Future support planned for:
- cursor: Cursor IDE with agent mode hooks
- opencode: OpenCode AI assistant
Re-exports§
pub use crate::model::error::InitError;
Structs§
- Claude
Adapter - Claude Code framework adapter.
- Codex
Adapter - OpenAI Codex CLI framework adapter.
- Gemini
Adapter - Gemini CLI framework adapter.
- Init
Options - Options for hook initialization and activation.
- Init
Result - Result of initialization.
- Parsed
Hook Input - Parsed hook input with normalized fields.
Enums§
- Config
Format - Configuration file format used by a framework.
- Framework
Resolution Mode - Mode for auto-detecting frameworks when no names are specified.
Traits§
- Framework
Adapter - Framework adapter trait for AI coding assistant integrations.
Functions§
- all_
adapters - Get all available framework adapters.
- default_
adapter - Get the default framework (Claude Code).
- detect_
all_ frameworks - Detect all frameworks that match current environment variables.
- detect_
framework - Detect the current framework from environment variables.
- generate_
config - Generate hooks configuration without writing to disk.
- get_
adapter - Get a framework adapter by name.
- initialize
- Initialize mi6 for a single framework.
- initialize_
all - Initialize mi6 for multiple frameworks.
- installed_
frameworks - Get all frameworks that are installed on the system.
- json_
to_ toml_ string - Convert a serde_json::Value to a TOML string.
- resolve_
frameworks - Resolve framework names to adapters with deduplication and validation.