Runesmith is a Python CLI tool for automated, high-quality codebase documentation generation and management using Large Language Models (LLMs) such as OpenAI, Azure OpenAI, Anthropic, Gemini, and Ollama (local). It supports both interactive wizard-driven and YAML configuration-driven workflows, and is designed for extensibility, reproducibility, and cloud-agnostic infrastructure-as-code (IaC) blueprints.
- Features
- Architecture
- Installation
- Quick Start
- Configuration
- CLI Reference
- LLM Provider Integration
- Internal Workflow
- Dependency Management
- Project Structure
- Extensibility
- .gitignore Policy
- Versioning
- License
- Changelog
- Planned Enhancements
- Contribution
- Automatic Documentation: One-command generation and updating of documentation (READMEs, API docs, tutorials, quickstarts, etc.).
- Multi-Provider LLM Support: Integrates with OpenAI, Azure OpenAI, Anthropic, Gemini, and Ollama (local, no API key required).
- Context Awareness: Honors
.gitignore, blacklists, and existing documentation; makes minimal, safe changes. - Interactive & Config Modes: Use an interactive CLI wizard or YAML config files.
- Customization: Select doc types, blacklist file extensions, and add custom LLM instructions.
- Token Safety: Warns if codebase exceeds LLM context window.
- IaC Blueprints: Modular, composable infrastructure blueprints for cloud-agnostic deployments.
- Extensibility: Plugin-based architecture for providers and workflows.
- CLI: Built with Typer.
- Modular/Plugin Design: Easily extendable for new providers and workflows.
- Declarative IaC: YAML/JSON blueprints for infrastructure.
- Provider SDK/CLI Integration: For cloud operations.
- State/Version Tracking: For blueprints and deployments.
- Python 3.10 (enforced via
.python-version) - uv (recommended for dependency management and reproducible installs)
pip install runesmithgit clone https://github.com/yourusername/runesmith.git
cd runesmith
uv sync
source .venv/bin/activaterunesmith generaterunesmith generate --config config.yamlprovider: openai
model: gpt-4o
code_path: ./src
output_dir: ./docs
blacklist:
- .pyc
- .pyo
doc_types:
- readme
- api
- tutorial
custom_instruct: "Focus on clarity and conciseness."- Provider/Model: Choose from supported LLM providers and models.
- Code Path: Directory to scan for code.
- Output Directory: Where generated docs are written.
- Blacklist: List of file extensions to ignore.
- Doc Types: Select which documentation types to generate.
- Custom Instructions: Additional instructions for the LLM.
Configuration can be provided interactively or via a YAML file.
runesmith generate [--config config.yaml]- Crawl codebase (respects
.gitignoreand blacklist). - Summarize code chunks via LLM.
- Write summaries to a temporary folder.
- Merge/polish as needed per doc type.
- Clean up temporary files.
- Supported Providers: OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama (local).
- Model Examples:
- OpenAI:
gpt-4o,gpt-4-turbo - Azure OpenAI:
gpt-4o,gpt-4-turbo - Anthropic:
claude-3.5-haiku,claude-3-opus - Gemini:
gemini-1.5-pro,gemini-2.5-pro - Ollama: Any local model (no API key required)
- OpenAI:
- Environment Variables:
- OpenAI:
OPENAI_API_KEY - Azure OpenAI:
AZURE_OPENAI_KEY,AZURE_OPENAI_ENDPOINT,AZURE_OPENAI_API_VERSION - Anthropic:
ANTHROPIC_API_KEY - Gemini:
GEMINI_API_KEY - Ollama: No key needed
- OpenAI:
- .env Support: Place credentials in a
.envfile at the project root.
- Crawling: Uses
.gitignoreand blacklist to collect code chunks. - Token Management: Counts tokens, warns if context window is exceeded.
- Doc Generation: Per-chunk LLM summarization, optional merging/polishing, minimal doc updates.
- IaC Blueprints: Author, compose, validate, and deploy infrastructure blueprints with version/state management.
- Lockfile: Uses
uv.lockwith SHA256 hashes for reproducible installs. - Editable Install: For development.
- Key Packages:
ollama,openai,tiktoken,typer,questionary,rich,pydantic,httpx,requests,python-dotenv,pyyaml,pathspec
- Platform Support: Wheels for all major OS/architectures.
- Security: All dependencies are hash-pinned for integrity.
runesmith/
├── src/runesmith/
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── crawler.py
│ └── llm.py
├── pyproject.toml
├── uv.lock
├── .python-version
├── .gitignore
├── README.md
├── LICENSE
└── examples/
- Custom Providers: Add via plugin interface.
- Hooks: Pre/post-deployment for IaC.
- Blueprints: Authored in
/blueprints(YAML/JSON). - Examples/Docs: In
/examplesand/docs.
- Excludes:
- Python bytecode:
__pycache__/,*.pyc,*.pyo - Build/dist artifacts:
build/,dist/,wheels/,*.egg-info - Virtual environments:
.venv - Environment files:
*.env - Batch/config files:
batch*,config* - Web directory:
web/ - Test scripts:
test.py - Cache files:
cache*
- Python bytecode:
- Purpose: Keeps repository clean by ignoring generated, environment-specific, and temporary files.
- Project Version: 0.1.0
- Python Version: 3.10
MIT License © 2025 yail259
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Initial public release.
- Multi-provider LLM support (OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama).
- Interactive CLI wizard and YAML config-driven workflows.
- Per-chunk code summarization and doc synthesis.
- IaC blueprint authoring, validation, and deployment.
- Plugin-based provider/workflow extensibility.
- Reproducible dependency management with
uv.lock. - .gitignore and blacklist support for code crawling.
- Minimal/safe doc updates; context window/token management.
- MIT License.
- Add generated docs to LLM context for incremental updates.
- Retrieval-Augmented Generation (RAG) for large codebases.
- Standalone binary packaging.
- Multilanguage support.
- Iterative prompting/looping for improved doc quality.
- Open Source: MIT License.
- Guidelines: See
CONTRIBUTING.mdin the repository.
For detailed API documentation, examples, and advanced usage, see the /docs and /examples directories in the repository.