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)
  • 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§

ClaudeAdapter
Claude Code framework adapter.
CodexAdapter
OpenAI Codex CLI framework adapter.
CursorAdapter
Cursor IDE framework adapter.
GeminiAdapter
Gemini CLI framework adapter.
InitOptions
Options for hook initialization and activation.
InitResult
Result of initialization.
InstallHooksResult
Result of hook installation.
OpenCodeAdapter
OpenCode framework adapter.
ParsedHookInput
Parsed hook input with normalized fields.
PiAdapter
Pi Coding Agent framework adapter.
UninstallHooksResult
Result of hook uninstallation.

Enums§

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

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