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)
- cursor: Cursor IDE with agent mode hooks
- gemini: Google’s Gemini CLI tool
- codex: OpenAI’s Codex CLI tool
- opencode: OpenCode AI coding agent
- pi: Pi Coding Agent (TypeScript extension-based)
Future support planned for:
- Additional framework integrations
Re-exports§
pub use common::ParsedHookInputBuilder;pub use common::get_first_array_element;pub use crate::model::error::InitError;
Modules§
- common
- Common helper functions for framework adapters.
Structs§
- Claude
Adapter - Claude Code framework adapter.
- Codex
Adapter - OpenAI Codex CLI framework adapter.
- Cursor
Adapter - Cursor IDE framework adapter.
- Gemini
Adapter - Gemini CLI framework adapter.
- Init
Options - Options for hook initialization and activation.
- Init
Result - Result of initialization.
- Install
Hooks Result - Result of hook installation.
- Open
Code Adapter - OpenCode framework adapter.
- Parsed
Hook Input - Parsed hook input with normalized fields.
- PiAdapter
- Pi Coding Agent framework adapter.
- Uninstall
Hooks Result - Result of hook uninstallation.
Enums§
- Config
Format - Configuration file format used by a framework.
- Framework
Resolution Mode - Mode for auto-detecting frameworks when no names are specified.
- Otel
Support - OpenTelemetry support status for a framework.
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.
- initialize_
framework - Initialize mi6 for a specific framework.
- 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.