The agentir CLI is the developer interface for inspecting, validating, analyzing, compiling, simulating, and running AgentIR systems.
- Zero-Config Auto-Discovery: When
PATHis omitted fromvalidate,inspect,check,export,verify, orrun, AgentIR automatically discoversagentir.yaml,agentir.yml, oragentir.jsonin the current directory or parent directories. - Framework Auto-Detection: When importing or migrating code,
--frameworkand--fromcan be omitted; AgentIR statically inspects imports and AST structure to fingerprint the source framework automatically. - Interactive Scaffolding Wizard: Running
agentir initin an interactive terminal prompts with friendly defaults. - Interactive Simulation REPL: Running
agentir runwithout an input prompt launches an interactive conversational chat session with the simulated agent. - Fuzzy Target Matching: Catches typos like
--target open_agentsand suggestsDid you mean 'openai_agents'?. - Command Aliases:
agentir sim: Alias foragentir runagentir doc: Alias foragentir doctoragentir cap: Alias foragentir capabilitiesagentir show: Alias foragentir inspect
-v,--verbose: Enable detailed debug logging.-q,--quiet: Suppress non-essential terminal output.--help: Display command options and exit.
Print version, IR specification version, runtime platform, and registered adapters.
Flags:
--json: Output structured JSON.
Example:
agentir version
agentir version --jsonPerform system health diagnostics (Python version, dependency verification, registered adapters, write permissions).
Flags:
--json: Output structured JSON.
Example:
agentir doctorScaffold a starter AgentIR manifest file with best practices.
Arguments:
NAME: Name of the agent system (default:my_agent).
Options:
-o,--output PATH: Target file path (default:agentir.yaml).-t,--template TEMPLATE: Template preset:minimal|tools|multi-agent.
Example:
agentir init customer_support --template tools -o support.yamlValidate syntax, schema, and domain invariants of an AgentIR manifest.
Arguments:
PATH: Path to the manifest file (default:agentir.yaml).
Options:
--json: Output machine-readable JSON.
Exit Codes:
0: Valid manifest.1: Validation error or schema violation.
Example:
agentir validate support.yamlDisplay an interactive Rich terminal tree of agents, tools, workflows, state channels, and canonical hash.
Arguments:
PATH: Path to the manifest file.
Options:
--json: Output full structural JSON representation.
Example:
agentir inspect support.yamlView the 23-dimension canonical capability taxonomy or declared support matrices for target frameworks.
Options:
-f,--framework NAME: Framework name (langgraph,agno,openai_agents,crewai,lyzr,mcp).--json: Output JSON representation.
Example:
agentir capabilities --framework langgraph
agentir capabilities --jsonAnalyze compatibility between an AgentIR manifest and a target framework before compiling.
Arguments:
PATH: Path to the manifest file.
Options:
-t,--target FRAMEWORK: Target framework name (required).--json: Output structured compatibility report JSON.
Exit Codes:
0: Compatible.1: General error.2: Incompatible (target framework cannot support required capabilities).
Example:
agentir check support.yaml --target openai_agentsIngest source code, declarative configurations, or fixtures into canonical AgentIR.
Arguments:
SOURCE: Path to source file or fixture.
Options:
-f,--framework FRAMEWORK: Source framework name (required).-o,--output PATH: Output path for generated AgentIR YAML/JSON.--format yaml|json: Serialization format (default:yaml).--json: Machine-readable confirmation.
Example:
agentir import sample_graph.py --framework langgraph -o imported_graph.yamlCompile an AgentIR manifest into target framework source code and dependency manifests.
Arguments:
PATH: Path to AgentIR manifest.
Options:
-t,--target FRAMEWORK: Target framework name (required).-o,--output DIR: Target output directory (default:dist).--json: Output JSON manifest of generated files.
Example:
agentir export support.yaml --target agno -o ./dist_agnoExecute an end-to-end multi-framework migration (Source -> AgentIR -> Target + Audit Report).
Arguments:
SOURCE: Source artifact file to migrate.
Options:
--from FRAMEWORK: Source framework name (required).--to FRAMEWORK: Target framework name (required).-o,--output DIR: Destination output directory (default:migrated_project).--force: Force compilation despite capability incompatibilities.--json: Machine-readable output.
Example:
agentir migrate langgraph_app.py --from langgraph --to agno -o ./migrated_agno --forceCompare two AgentIR definitions semantically, classifying each change as EQUIVALENT, METADATA_ONLY, ADDITIVE, BEHAVIORAL, or BREAKING.
Arguments:
PATH_A: First manifest file.PATH_B: Second manifest file.
Options:
--json: Output structured diff entries JSON.
Exit Codes:
0: Manifests are canonically equivalent.1: Manifests have differences.
Example:
agentir diff v1.yaml v2.yamlRun security, topology, and integrity verification suite. Checks for leaked secrets, unreachable nodes, graph loops, and parameter schema completeness.
Arguments:
PATH: Path to AgentIR manifest.
Options:
--json: Output validation report JSON.
Example:
agentir verify support.yamlSimulate agent turns, tool calls, and state transitions offline without external LLM API keys (or connect to real models with --live).
Arguments:
PATH: Path to AgentIR manifest (auto-discovered if omitted).
Options:
-i,--input TEXT: User prompt message (default:"Hello").--max-turns N: Maximum simulated turns (default: 10).--live: Connect to live foundation model (delegates toagentir chat).--json: Output step-by-step trace JSON.
Example:
agentir run support.yaml --input "Check order #1042"
agentir run --liveChat live with an AgentIR agent using real foundation models (OpenAI, local Ollama, OpenRouter, Groq).
Arguments:
PATH: Path to AgentIR manifest (auto-discovered if omitted).
Options:
--base-url URL: Endpoint base URL (e.g.http://localhost:11434/v1for local Ollama).--api-key KEY: API key (or readsOPENAI_API_KEYfrom environment).-m,--model ID: Override model identifier.
Example:
# Chat using OpenAI
export OPENAI_API_KEY=sk-...
agentir chat
# Chat using local Ollama (100% private, free)
agentir chat --base-url http://localhost:11434/v1 -m llama3Export tools from an AgentIR manifest as an executable Model Context Protocol (MCP) server.
Options:
-o,--output DIR: Directory formcp_server.pyandclaude_desktop_config.json.
Example:
agentir mcp export support.yaml -o ./my_mcp_serverImport tools from an MCP tool catalog JSON into an AgentIR manifest.
Arguments:
SOURCE: Path to MCP tools JSON catalog.
Options:
-o,--output PATH: Target AgentIR YAML file.
Example:
agentir mcp import catalog.json -o tools_manifest.yaml