Skip to content

lantern docs

lantern docs generates a complete, browsable documentation site from your agent project. It reads your code and configuration files statically — no LLM, no API keys.

Usage

bash
# 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

# Generate and serve immediately
lantern web
lantern web /path/to/my-agent-project --port 9000

# Serve without regenerating
lantern web --no-generate

What Gets Generated

All files are written to <project>/docs/ by default.

FileContent
overview.mdProject snapshot, entrypoints, high-level flow
architecture.mdSystem map, key files, dependencies, environment variables
diagrams.mdMermaid diagrams — agent-task graph, execution flow, sequence
agents.mdAgent roles, goals, backstories, tools, LLM, delegation flags
tasks.mdTask descriptions, assigned agents, expected outputs, context
runbook.mdInstall, configure, run, static checks, troubleshooting
contact.mdProject contacts from pyproject.toml
index.htmlDocsify site — publishable to GitHub Pages
_sidebar.mdNavigation sidebar
agentlantern-docs.htmlSingle-file HTML bundle (no server; Mermaid uses a CDN)

How It Works

  1. Detection — AgentLantern scans pyproject.toml and the project structure to identify the framework
  2. Analysis — the framework-specific analyzer parses agents, tasks, tools, LLM config, and env vars from code and YAML files (static AST parsing — no imports, no execution)
  3. Rendering — a Markdown file is generated for each section, then assembled into a Docsify site

Sharing Documentation

MethodHow
Locallantern web → open http://localhost:9000
Single fileSend docs/agentlantern-docs.html — no server needed; diagrams require network access
GitHub PagesPush docs/ and enable Pages in repository settings
Any web serverdocs/ is a static site — works on Nginx, Vercel, Netlify

CI — Auto-generate on Push

yaml
# .github/workflows/docs.yml
name: Generate Docs

on: [push]

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - run: pip install "agentlantern @ git+https://github.com/brellsanwouo/agentlantern.git"
      - run: lantern docs
      - uses: actions/upload-pages-artifact@v3
        with:
          path: docs/

Quick Start (No API Keys Needed)

You can test lantern docs on a minimal CrewAI project without any LLM or API keys.

bash
# 1. Create a scaffold project
pip install crewai
crewai create my_test_project
cd my_test_project

# 2. Generate documentation
pip install "agentlantern @ git+https://github.com/brellsanwouo/agentlantern.git"
lantern docs

# 3. Browse it
lantern web
# → http://localhost:9000

Supported Frameworks

FrameworkAnalysis levelWhat is extracted
CrewAIFullAgents, tasks, tools, LLM, delegation, memory, Mermaid diagrams
Google ADKFullAgents, tools, workflows, Mermaid pipeline diagrams
LangGraphFullGraphs, nodes, routes, tools and Mermaid diagrams
AutoGenFullAgents, teams, tools, runs and Mermaid diagrams
SmolagentsFullAgents, managed agents, tools and Mermaid diagrams
OpenAI Agents SDKFullAgents, handoffs, tools, runners and Mermaid diagrams
Additional Python ecosystemsDedicatedAgents/roles, tools, teams/workflows, factories and runs
Mastra / Vercel AI SDK / JS/TSDedicatedAgents, tools, workflows, npm scripts and diagrams
Semantic Kernel .NET/JavaDedicatedAgent initializers, instructions and invocations
Other Python or JS/TS frameworksGenericConventional agents, tools, relations and entrypoints

Released under the MIT License.