Module framework

Module framework 

Source
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§

ClaudeAdapter
Claude Code framework adapter.
CodexAdapter
OpenAI Codex CLI framework adapter.
GeminiAdapter
Gemini CLI framework adapter.
InitOptions
Options for hook initialization and activation.
InitResult
Result of initialization.
ParsedHookInput
Parsed hook input with normalized fields.

Enums§

ConfigFormat
Configuration file format used by a framework.
FrameworkResolutionMode
Mode for auto-detecting frameworks when no names are specified.

Traits§

FrameworkAdapter
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.