Usage Guide
Commands
lantern lint [project] [--strict] [--format text|json|sarif]
Analyzes an agent project for design issues without using an LLM.
# From the project root
cd my-agent-project
lantern lint
# From anywhere
lantern lint /path/to/my-agent-project
# Exit with code 1 on any finding (CI-friendly)
lantern lint --strict
# Machine-readable output for CI pipelines and integrations
lantern lint --json
lantern lint --format sarif > agentlantern.sarifSee the Linter reference for all rules and codes.
lantern inspect [project]
Outputs the full project model as JSON for integrations and debugging.
lantern inspect /path/to/my-agent-projectlantern play [project] [--ws-port PORT] [--http-port PORT] [--name NAME] [--command CMD]
Runs a supported agent project and opens the live animated Play UI.
# From the project root
cd my-agent-project
lantern play
# From anywhere
lantern play /path/to/my-agent-project
# Custom ports
lantern play /path/to/my-agent-project --ws-port 8790 --http-port 8791
# Save the run for replay and auto-start it
lantern play /path/to/my-agent-project --name demo-run
# Override entrypoint auto-detection without invoking a shell
lantern play . --command "uv run my-agent-command"The browser UI starts in a ready state. If --name is omitted, the UI asks for a run name before START. Use STOP to terminate the active run.
The Play UI includes dynamic 1-10 agent layouts, a central Tool Hub for tool calls, timeline/thoughts/tools/comms/log panels, clickable agent history, and final report.md display when available.
See the Play reference.
lantern replay NAME [--speed FLOAT]
Replays a saved lantern play --name run.
lantern replay demo-run
lantern replay last
lantern replay demo-run --speed 2.0
lantern replay /path/to/.lantern_replays/demo-run.jsonllantern compare BEFORE AFTER [--json]
Compares runtime, errors, agents, tools, token usage, and cost fields recorded in two replays.
lantern compare baseline candidate
lantern compare baseline candidate --json > replay-diff.jsonlantern docs [project] [-o OUTPUT_DIR] [--dry-run] [--force] [--clean]
Generates documentation for an agent project.
# From the project root
cd my-agent-project
lantern docs
# From anywhere
lantern docs /path/to/my-agent-project
# Custom output directory
lantern docs /path/to/my-agent-project -o /path/to/output
# Safe preview and one-time adoption of output from AgentLantern < 0.2
lantern docs --dry-run
lantern docs --force --cleanlantern web [project]
Generates (unless --no-generate) and serves the documentation for an agent project over local HTTP.
# From the project root
cd my-agent-project
lantern web
# From anywhere
lantern web /path/to/my-agent-project
# Custom port
lantern web --port 9000
# Serve without regenerating
lantern web --no-generate
# Accessible on the local network
lantern web --host 0.0.0.0By default, lantern web serves http://localhost:9000 over local HTTP, so the browser should not show a certificate warning.
Supported Frameworks
AgentLantern detects the framework automatically from pyproject.toml dependencies or project structure.
| Framework | Detection signal | Analysis level |
|---|---|---|
| CrewAI | crewai dep or crew.py + @CrewBase | Full — agents, tasks, diagrams, env vars |
| LangGraph | langgraph dep or StateGraph usage | Full — graphs, nodes, routes, tools, lint |
| AutoGen | dependency or AutoGen imports | Full — agents, teams, tools, runs, lint |
| Smolagents | dependency or Smolagents imports | Full — agents, managed agents, tools, runs, lint |
| Google ADK | google-adk dep | Full — agents, tools, hierarchy, workflows |
| OpenAI Agents SDK | openai-agents dep or agents imports | Full — agents, handoffs, tools, runners, lint |
| PydanticAI, LlamaIndex, Semantic Kernel, Agno | dependency or SDK imports | Dedicated agents, tools, teams/workflows and runs |
| LangChain, Haystack, Strands, CAMEL-AI | dependency, imports or factories | Dedicated agents, tools, workflows and invocations |
| MetaGPT, BeeAI, OpenAI Swarm | dependency or SDK imports | Dedicated roles/agents, teams and runs |
| Mastra, Vercel AI SDK Agents | npm dependency and agent API | JavaScript/TypeScript agents, tools, workflows and scripts |
| Semantic Kernel .NET/Java | project dependency or agent API | Agent initializers, instructions and invocations |
| Other Python or JS/TS frameworks | common constructors/factories | Generic agents, tools, relationships and entrypoints |
For frameworks with full analysis, AgentLantern parses agents, tasks, tools, environment variables, and generates Mermaid diagrams.
The generic fallbacks cover conventional Python and JavaScript/TypeScript agent APIs. Additional analyzers can be installed through the agentlantern.analyzers entry-point interface.
Generated Files
| File | Content |
|---|---|
overview.md | Project snapshot, entrypoints, high-level flow |
architecture.md | System map, key files, dependencies, environment variables |
diagrams.md | Mermaid diagrams: agent-task graph, execution flow, sequence |
agents.md | Agent roles, goals, tools, backstories |
tasks.md | Task descriptions, agents assigned, expected outputs |
runbook.md | Install, configure, run, static checks, troubleshooting |
contact.md | Project contacts from pyproject.toml |
index.html | Docsify site — publishable to GitHub Pages |
_sidebar.md | Navigation menu |
agentlantern-docs.html | Single-file HTML bundle; Mermaid rendering uses a CDN |
Typical Workflow
# 1. Navigate to (or point at) your agent project
cd my-agent-project
# 2. Generate and view documentation
lantern web
# 3. Open http://localhost:9000
# 4. Press Ctrl+C to stop the serverMultiple Projects
# Terminal 1
lantern web ~/projects/crew-project --port 9000
# Terminal 2
lantern web ~/projects/adk-project --port 9001Sharing Documentation
The generated docs/ folder is a static site. To share it:
- GitHub Pages — push
docs/and enable GitHub Pages in repository settings - Single-file share — send
docs/agentlantern-docs.html(no server; diagram rendering requires network access) - Any web server —
docs/works on Nginx, Vercel, Netlify, etc.
