Runbook Generator
Generate operational runbooks by scanning project infrastructure files. Produces structured Markdown runbooks with procedures for common ops tasks.
Quick Generate
python3 scripts/generate_runbook.py /path/to/project
Output Formats
# Markdown (default)
python3 scripts/generate_runbook.py /path/to/project
# JSON (structured)
python3 scripts/generate_runbook.py /path/to/project --format json
# Specific output file
python3 scripts/generate_runbook.py /path/to/project -o RUNBOOK.md
What It Scans
| File | What It Extracts |
|---|---|
| Dockerfile | Base image, exposed ports, entrypoint, build steps |
| docker-compose.yml | Services, ports, volumes, dependencies, env vars |
| systemd units (.service) | ExecStart/Stop/Reload, dependencies, restart policy |
| Makefile | Targets (build, test, deploy, clean, etc.) |
| package.json | Scripts (start, build, test, dev, deploy) |
| .env / .env.example | Required environment variables |
| nginx.conf | Upstream servers, listen ports, locations |
Generated Sections
- Overview — Service name, description, tech stack
- Prerequisites — Required tools, access, credentials
- Environment Variables — Required vars with descriptions
- Build — How to build the project
- Deploy — Step-by-step deployment procedure
- Start/Stop/Restart — Service lifecycle commands
- Health Check — How to verify the service is running
- Rollback — How to revert to previous version
- Troubleshooting — Common issues and solutions
- Monitoring — Logs, metrics, alerts
- Contacts — On-call, escalation (template)
Workflow
- User points to a project directory
- Script scans for infrastructure files
- Extracts operational information
- Generates structured runbook
- Present to user for review and customization