AI Context & Integration¶
ai-export — AI Context Export (Recommended for AI prompts)¶
Splits the scanned database into a token-efficient directory structure under build/ai-context/. AI agents read metadata.json first, then load only the class files they need — reducing token usage by 95%+.
Positional Arguments:
[output-dir]: Optional target output directory to save AI context files (default:build/ai-context/)
Optional Parameters:
--db <file>: Index database JSON file path to read from (default:build/library-insight-index.json)
Example with options:
Example output:
mcp — MCP Server¶
Start the Model Context Protocol server on stdio. Connect Cursor, Claude Desktop, or any MCP-compatible IDE to use scan_library, search_symbols, explain_class, and dsl_report tools natively.
Optional Parameters:
--db <file>: Index database JSON file path to read from and write to (default:build/library-insight-index.json)
Example with options:
Example output (JSON-RPC tools list response):
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": [
{
"name": "scan_library",
"description": "Scans a Java/Kotlin library and creates an API index.",
"inputSchema": {
"type": "object",
"properties": { "pathOrCoordinate": { "type": "string" } }
}
},
{
"name": "search_symbols",
"description": "Search for symbols in the active library index.",
"inputSchema": {
"type": "object",
"properties": { "query": { "type": "string" } }
}
}
]
}
}
MCP vs CLI: If an MCP server is already configured in your IDE, prefer it over running CLI commands directly.
init — Initialize Workspace Skill¶
Write a SKILL.md into .agents/skills/library-insight/ so local AI agents auto-discover the CLI.
Example output:
Initializing Library Insight agent environment...
Creating directory: .agents/skills/library-insight/
Successfully initialized workspace skill instructions!
skills — Manage Agent Skills¶
Add skill to the current workspace:
List registered skills in the current workspace:
Example output (skills list):
export — Export Index¶
Export the scanned index to Markdown or JSON.
For large libraries, Markdown files can be huge. Use
ai-exportfor AI prompts instead.
Export to Markdown format:
Export to JSON format:
Positional Arguments:
[output-file]: Optional target output file path to write export content to. If not specified, defaults tobuild/API_REFERENCE.mdorbuild/library-insight-index.json. Use-to print to stdout.
Optional Parameters:
--db <file>: Index database JSON file path to read from (default:build/library-insight-index.json)
Example with options:
Example output: