Skip to main content

tf2okf

tf2okf generates deterministic Open Knowledge Format v0.2 Markdown from Terraform-family repositories.

Install and run

Requires Python 3.10 or newer.

Install from this repository (local source)

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
python3 -m pip install .
tf2okf --help

Install for use in other repositories

Install once, then run tf2okf from any Terraform/Terragrunt project.

If published on PyPI:

python3 -m pip install tf2okf

If not published on PyPI, install directly from Git:

python3 -m pip install "git+https://github.com/<owner>/tf2okf.git"

For isolated global CLI usage across projects (pipx):

pipx install "git+https://github.com/<owner>/tf2okf.git"

Common commands:

tf2okf frameworks
tf2okf discover .
tf2okf init .
tf2okf generate .
tf2okf check .
tf2okf diff .

Framework selection

tf2okf frameworks
tf2okf discover .
tf2okf init . --framework auto
tf2okf init . --framework tfscaffold
tf2okf init . --framework terragrunt
tf2okf init . --framework plain-terraform

Configuration:

version: '2'
framework:
  type: auto

auto detects known framework signatures. Explicit selection always wins.

tfscaffold adapter

Discovers independent components/, reusable modules/, and etc/*.tfvars environment metadata.

Terragrunt adapter

Discovers each terragrunt.hcl unit, static terraform.source, include, dependency.config_path, shared HCL and terragrunt.stack.hcl files. .terragrunt-cache and generated .terragrunt-stack content are ignored.

Plain Terraform adapter

Parses Terraform source directly from the configured root.

Commands

  • init — create configuration, detect/select framework, create initial OKF and Copilot instructions
  • discover — show detected framework and reasons without changing files
  • generate — regenerate machine-owned OKF
  • check — fail when committed generated OKF has drifted
  • diff — show generated knowledge diff
  • frameworks — list supported adapters

No LLM is needed for generation.

Security defaults

tf2okf is intentionally source-only: it does not read Terraform state, plans, cloud credentials, or execute Terraform. Repository-relative configuration paths are containment-checked; symlinked Terraform files are ignored; source files over 2 MiB are skipped; likely secret-bearing attributes are redacted; and optional terraform-docs execution has a timeout and captured-output limit. See SECURITY.md for the threat model.

Open-source release checklist

Before publishing: enable GitHub private vulnerability reporting, branch protection/rulesets, required CI/CodeQL/dependency review checks, Dependabot security updates, secret scanning/push protection where available, and PyPI trusted publishing for the pypi environment. Run python -m build && python -m twine check dist/* locally or in CI.

Metadata

Release files for tf2okf 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tf2okf 0.4.0
File Size Uploaded
tf2okf-0.4.0.tar.gz 25.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tf2okf 0.4.0
File Interpreter ABI Platform
tf2okf-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.2 kB

Release files / tf2okf-0.4.0.tar.gz

Download URL tf2okf-0.4.0.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5df91c1f60b6ecae2305d8ad93cf8e843dddc32ccebf3aecb7eb9ec9608acd82
BLAKE2b-256 checksum
How to use checksums
0091049c869e625ba7f0e261c19757f80eb2ad7f0e1551fce1bdfc6b06ff2666
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.15.0rc1

Release files / tf2okf-0.4.0-py3-none-any.whl

Download URL tf2okf-0.4.0-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6c12c860dd74544229780a5e1b50b0a3bc4cb4e2405437b05bf6274d06bd6b3
BLAKE2b-256 checksum
How to use checksums
fb04021bb59211d5b47ab971b589b845b2a621e49e52298aaba5e837d44fb499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.15.0rc1

Release history Release notifications | RSS feed

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page