Skip to main content

AI agent that reads Terraform, Helm, Kubernetes, and CI/CD files and auto-generates DevOps documentation.

Project description

๐Ÿ—๏ธ IaC-to-Docs

AI agent that reads your Terraform, Helm, Kubernetes, and CI/CD files โ€” and writes your DevOps documentation automatically.

Python 3.10+ License: MIT Powered by Gemini


The Problem

Every DevOps team has the same documentation debt:

  • Terraform modules nobody can explain
  • Helm charts with mystery values
  • Kubernetes manifests that "just work" until they don't
  • Zero onboarding docs for new engineers

Writing docs manually is slow and they go stale immediately. IaC-to-Docs solves this with one command.


Install & Run in 60 Seconds

# 1. Install
pip install iac-to-docs

# 2. Set your API key (get one free at https://aistudio.google.com)
export GOOGLE_API_KEY=your_key_here

# 3. Run against any repo
iac-to-docs --repo ./your-infra-repo

That's it. A complete DEVOPS_DOCS.md is written to your repo root.


What Gets Generated

Each run produces a structured DEVOPS_DOCS.md with:

Section What it contains
System Overview What the system does, tech stack, environments
Architecture Diagram Mermaid diagram of services and their relationships
Services & Components Per-service: image, ports, env vars, health checks, resources
Infrastructure (IaC) Terraform resources, state backend, variables, outputs
Deployment Instructions Step-by-step deploy guide with real commands
CI/CD Workflow Pipeline stages, triggers, promotion flow, secrets needed
Environment Setup Required env vars, secrets, namespaces, RBAC
Operations Runbook Scale, restart, rollback, log access, shell exec
Troubleshooting Guide Common issues table + debug commands

Anything inferred (not explicitly in files) is labelled [Assumed] so you always know what's fact vs inference.


Demo Output

๐Ÿ‘‰ See a real generated DEVOPS_DOCS.md โ†’

Generated from the sample_repo/ in this repository, which contains:

  • Terraform (EKS cluster + RDS + VPC)
  • Kubernetes manifests (3 services)
  • Helm chart
  • GitHub Actions CI/CD pipeline
  • Dockerfile

Usage

Basic

iac-to-docs --repo ./my-infra

Specify output location

iac-to-docs --repo ./my-infra --output ./docs/DEVOPS_DOCS.md

Point at a GitHub repo directly

iac-to-docs --repo https://github.com/org/infra-repo

Generate only specific sections

iac-to-docs --repo ./my-infra --sections deployment runbook troubleshooting

Use a faster/cheaper model

iac-to-docs --repo ./my-infra --model models/gemini-2.0-flash

Full options

iac-to-docs --help

options:
  --repo,     -r   Path to local repo OR GitHub URL         [required]
  --output,   -o   Output path (default: <repo>/DEVOPS_DOCS.md)
  --api-key,  -k   Gemini API key (or set GOOGLE_API_KEY env var)
  --model,    -m   Gemini model (default: models/gemini-2.5-pro)
  --sections, -s   Generate specific sections only
  --no-mermaid     Skip architecture diagram
  --verbose,  -v   Detailed progress output

Supported File Types

Type Files
Terraform .tf, .tfvars
Kubernetes .yaml, .yml in k8s/, manifests/, deploy/
Helm Chart.yaml, values.yaml, templates/*.yaml
Docker Dockerfile, docker-compose.yml
CI/CD GitHub Actions, Jenkinsfile, .gitlab-ci.yml, CircleCI
Scripts .sh, .bash, .py
Config .env.example, config.yaml, config.json

Architecture

iac-to-docs --repo ./infra
       โ”‚
       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Smart File Loader                  โ”‚
โ”‚  โ€ข Walks repo, skips noise          โ”‚
โ”‚  โ€ข Classifies by type               โ”‚
โ”‚  โ€ข Truncates oversized files        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚ Context Builderโ”‚  Groups files by type
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  (terraform, k8s, cicd, full)
               โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚  Multi-Section Agent               โ”‚
       โ”‚  Each section gets a focused promptโ”‚
       โ”‚  + the most relevant context only  โ”‚
       โ”‚  โ†’ Gemini 2.5 Pro                  โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚  Assembler     โ”‚  Table of contents
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  Metadata header
               โ”‚           File index appendix
               โ–ผ
         DEVOPS_DOCS.md

Development Setup

git clone https://github.com/lakra-sashank/IaC-to-Docs-An-AI-Agent-for-DevOps-Documentation
cd IaC-to-Docs-An-AI-Agent-for-DevOps-Documentation

pip install -e ".[dev]"

export GOOGLE_API_KEY=your_key
iac-to-docs --repo ./sample_repo --verbose

Built by

Sashank Lakra โ€” Senior Platform & DevOps Engineer
LinkedIn ยท GitHub

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iac_to_docs-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iac_to_docs-0.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file iac_to_docs-0.1.0.tar.gz.

File metadata

  • Download URL: iac_to_docs-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for iac_to_docs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f7ee59ee39e7dd6eadf4b579f1ea3b239b7bf0efb621835fb0f6d3fc97df177
MD5 592a7188eba47f9c22fa32026afeda37
BLAKE2b-256 d813eccd9ce99f928bd8abe6404dda3987bd645651cc7b69d02c488a1dfaca0c

See more details on using hashes here.

File details

Details for the file iac_to_docs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iac_to_docs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for iac_to_docs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49f272047dc551c3e884bf03277317c1beb24b0535ecd652b1a0dba310ba7db2
MD5 b871b4600d25e810a4d733e2c6989d89
BLAKE2b-256 6c2419ab752e15a507232eedeaac52e5c1723a6a46d9178fe7d37cb51842ea36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page