infrawiki
v0.0.1
Published
Writes and maintains your infrastructure documentation for agents in Open Knowledge Format (OKF)
Maintainers
Readme
- Grounded, not guessed — every page is written from resources the agent actually inspected. It never invents infrastructure and never writes secrets.
- Plain markdown — the wiki is a directory of
.mdfiles with typed frontmatter. Read it, grep it, commit it, feed it to your coding agent. - A real graph — pages are OKF concepts linked by relationship edges, with trust tiers and freshness built into the format.
infrawiki visualizerenders it interactively.
Quick start
infrawiki runs on Bun (the CLI executes TypeScript directly — no build step):
npm i -g infrawikiThen initialize a wiki in any directory:
cd your-project
infrawiki initThe wizard walks you through:
- Model — pick an LLM provider and sign in (OAuth with your existing Claude / ChatGPT / Copilot subscription, or an API key).
- Sources — connect AWS: pick a profile from
~/.aws, choose regions, and let the wizard create a Resource Explorer index if one is missing. - Output — where the wiki lives (default
infrawiki/). - Instructions — a brief the agent follows; edit it in
$EDITORor accept the default. - Generate — sources sync, then the agent inventories your resources, inspects them with the AWS CLI, and writes the wiki.
Init is resumable — if you quit halfway, infrawiki init picks up where you left off.
When your infrastructure changes, refresh with:
infrawiki updateIt re-fetches every source, diffs the new snapshot against the last documented one, and rewrites only the affected pages (and logs the delta in log.md).
The wiki it writes
The output is a self-contained OKF v0.2 bundle:
infrawiki/
├── index.md # root navigation + okf_version
├── log.md # change log, newest first
├── instructions.md # your brief — the agent never edits it
└── aws/
├── index.md
├── accounts/706436713848.md
└── eks/acme-model.mdEvery concept page carries typed frontmatter, so the wiki doubles as structured data:
---
type: aws_account
title: Opsy management account (706436713848)
description: Management AWS account hosting the acme-model EKS platform.
resource: arn:aws:iam::706436713848:root
tags: [706436713848, management]
generated:
by: infrawiki/gpt-5.6-sol
at: 2026-08-17
---Links between pages are relationship edges — which is what makes visualize possible.
Commands
| Command | What it does |
| --- | --- |
| infrawiki | Show the wiki path, state dir, and configured model |
| infrawiki init | Initialize a wiki in the current directory (interactive, resumable) |
| infrawiki update | Re-fetch sources, diff against the last snapshot, rewrite affected pages |
| infrawiki visualize | Render the wiki as an interactive graph and open it (--no-open to skip the browser) |
The viewer supports search by title / id / tag, filtering by concept type, multiple layouts, trust and freshness badges, and a light/dark theme toggle.
How it works
- Connectors and sources. A connector is an integration (AWS today); a source is a configured instance of one (profile + account + regions). Each
updatesnapshots the source's full resource inventory; the agent diffs snapshots to know what changed. - The agent loop. The wiki is written by an LLM agent with
read/write/edit/ls/grep/find/bashtools, sandboxed to the output directory for writes. It shells out to the AWS CLI to inspect resources beyond the raw inventory, and compacts its own context in-flight on large estates. - State. Project config lives in
infrawiki.json(no secrets). Credentials, source snapshots, run logs, andvisualize.htmllive in a per-project state dir under~/.infrawiki/projects/(auth.jsonis chmod 600); setstateDirininfrawiki.jsonto keep state in-project instead.
Providers
| Provider | Auth | | --- | --- | | Anthropic | Claude Pro/Max OAuth or API key | | OpenAI | ChatGPT Plus/Pro OAuth (Codex) or API key | | GitHub Copilot | Device-code OAuth | | OpenRouter | OAuth (mints an API key) | | xAI | SuperGrok / X Premium OAuth or API key | | Google Gemini | API key | | Azure OpenAI | API key + resource name | | OpenAI-compatible | Custom base URL + optional key |
API keys can also be picked up from environment variables.
Requirements
- Bun — the CLI runs from TypeScript source.
- AWS CLI with profiles in
~/.aws— used both for auth and for the agent's deep inspection. - AWS Resource Explorer 2 — an index in each region you connect; the init wizard can create local indexes or promote one to aggregator for you.
License
Elastic License 2.0. Portions adapted from other projects — see THIRD_PARTY_NOTICES.md.
