Kubed

CLI and context tooling for Kubernetes, Docker, Terraform, and Helm. A file-based, agent-friendly infra layout index so tools don't need to run kubectl for discovery—plus shell completions and aliases to keep you in flow.

1 file
instead of 10+ discovery calls
~1.5K tokens
layout snapshot
vs 50K+
typical discovery output

The problem

AI agents burn thousands of tokens just to understand your infrastructure. Every kubectl get, find, and ls -laR adds latency and cost. Discovery-heavy workflows can push context into the tens of thousands of tokens before the agent answers one question.

The solution: two small files

.kubed/layout.json

Static snapshot of your infrastructure:

  • Dockerfiles, Terraform, Helm charts
  • Project structure
  • Cross-repo shared infra
  • K8s resources and relationships

Run kubed layout capture to generate

.kubed/learned.json

Accumulated knowledge across sessions:

  • Architecture facts ("API uses PostgreSQL")
  • Important paths with descriptions
  • Tech stack and dependencies
  • Code patterns and conventions

Run kubed learned add-fact "..." to persist

Both files are section-based with IDs and tags, so agents can query specific parts without loading everything. When the agent discovers something useful, it persists it to learned.json so the next session doesn't re-discover.

For humans, Kubed installs shell completions and aliases for Docker, Kubernetes, Terraform, and Helm so you stay productive at the terminal.

How it reduces tokens

Without Kubed With Kubed
Agent runs find, ls -laR, kubectl get Agent reads layout.json
Discovery output: 50,000+ tokens Layout file: ~1,500–3,000 tokens
Re-discovers same facts every session Reads learned.json (~500 tokens)
10+ tool calls per question 1–2 file reads

Tools

Get started

Install Kubed and run setup for your shell. Restart your terminal after installation for changes to take effect.

Terminal
pip install kubed
kubed-setup
Non-interactive
pip install kubed
kubed-setup --force-yes

Restart your terminal after installation for changes to take effect.

Full installation guide

Found an error or have a suggestion?

Report an issue