Doctorial is a Python CLI that turns API documentation into framework-specific tutorials and reusable example bundles.
It parses OpenAPI, markdown, or remote docs, suggests practical scenarios, and generates bundles for targets like LangChain, Codex, Claude Code, MCP, and related tooling.
- Parse API docs into a normalized API profile
- Suggest tutorial scenarios for a chosen framework
- Generate tutorial bundles with markdown, notebooks, and framework-specific files
- Run locally as a CLI with no web app or service layer
- Support built-in and custom framework targets
- Work with local files or remote docs
- Export reusable tutorial assets for developer workflows
Claude CodeCodexOpenClawLangChainOpenAI Agents SDKCrewAIGoogle ADKPydanticAIMastraLlamaIndexMCP
Custom framework targets are also supported.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
cp .env.example .envDoctorial automatically loads .env and .env.local from the repository root.
Generate a LangChain tutorial bundle from the OpenJobs AI API docs:
doctorial generate \
--doc-url "https://platform.openjobs-ai.com/docs/api" \
--framework langchain \
--scenario "Build a LangChain recruiting assistant that uses candidate search, profile lookup, grading, and analytics to shortlist strong candidates." \
--output ./doctorial-output/openjobs-langchainTypical output includes files like:
doctorial-output/openjobs-langchain/
tutorial.md
tutorial.ipynb
README.md
requirements.txt
...
Other useful commands:
List supported frameworks:
doctorial frameworks listParse an API spec:
doctorial parse --doc-url "https://platform.openjobs-ai.com/docs/api"Suggest OpenJobs AI tutorial scenarios for LangChain:
doctorial suggest --doc-url "https://platform.openjobs-ai.com/docs/api" --framework langchainGenerate the OpenJobs AI bundle:
doctorial generate \
--doc-url "https://platform.openjobs-ai.com/docs/api" \
--framework langchain \
--scenario "Build a LangChain recruiting assistant that uses candidate search, profile lookup, grading, and analytics to shortlist strong candidates." \
--output ./doctorial-output/openjobs-langchainRun tests:
python -m unittest discover -s testsdoctorial frameworks list
doctorial frameworks info codex
doctorial parse --doc-url "https://platform.openjobs-ai.com/docs/api"
doctorial suggest --doc-url "https://platform.openjobs-ai.com/docs/api" --framework langchain
doctorial generate --doc-url "https://platform.openjobs-ai.com/docs/api" --framework langchain --scenario "Build a LangChain recruiting assistant that uses candidate search, profile lookup, grading, and analytics to shortlist strong candidates." --output ./doctorial-output/openjobs-langchainDOCTORIAL_LLM_PROVIDER=openrouter
DOCTORIAL_LLM_API_KEY=...
DOCTORIAL_LLM_MODEL=openai/gpt-4.1-mini
DOCTORIAL_LLM_BASE_URL=
# Backward-compatible provider-specific env vars still work:
OPENROUTER_API_KEY=...
OPENROUTER_MODEL=openai/gpt-4.1-mini
OPENAI_API_KEY=...
OPENAI_MODEL=gpt-4.1-mini
ANTHROPIC_API_KEY=...
ANTHROPIC_MODEL=claude-3-5-sonnet-latest
GEMINI_API_KEY=...
GEMINI_MODEL=gemini-2.5-pro
TAVILY_API_KEY=...
DOCTORIAL_HOME=$HOME/.doctorial
DOCTORIAL_TRUST_ENV=1Supported providers:
openrouteropenaianthropicgeminiopenai-compatible
src/doctorial: package sourcetests: unit tests and fixtures.env.example: local configuration template
Start with CONTRIBUTING.md. For vulnerabilities or sensitive reports, follow SECURITY.md.
This project is licensed under the MIT License.