Kubed
Reduce AI agent token usage with two small files.
CLI and context tooling for Kubernetes, Docker, Terraform, and Helm. Kubed gives AI agents two lightweight files instead of expensive discovery:
| File | What it stores | Size |
|---|---|---|
.kubed/layout.json |
Infra layout: Dockerfiles, Terraform, Helm, K8s, project structure, shared infra | ~1,500–3,000 tokens |
.kubed/learned.json |
Accumulated knowledge: architecture facts, important paths, dependencies, patterns | ~500 tokens |
Without Kubed: Agents run find, ls -laR, kubectl get, grep -r → 50,000+ tokens, 10+ tool calls, repeated every session.
With Kubed: Agents read two files → ~2,000–3,500 tokens, 1–2 file reads, knowledge persists across sessions.
- Docs: cmds.daleyarborough.com
- Layout index:
kubed layout capturewrites.kubed/layout.json. Schema: docs/LAYOUT_SCHEMA.md. - Learned cache:
kubed learned add-fact "..."persists discoveries. Agents read it first to avoid re-discovering. - Reducing tokens: docs/reducing-token-usage.md
Installation (Python package)
pip install kubed
kubed-setup
Non-interactive: kubed-setup --force-yes. See cmds.daleyarborough.com for full docs.
Layout commands (Go binary)
Build the binary (requires Go 1.21+):
make build # outputs build/kubed
# or: go build -o build/kubed ./cmd/kubed
kubed layout capture— Index infra paths, project structure, shared infra, and (optionally) K8s resources; write.kubed/layout.json. Optional:--all-namespaces.kubed layout show— Printlayout.jsonto stdout.
Learned cache (accumulated knowledge)
kubed learned show— Print.kubed/learned.json(facts, paths, deps, patterns accumulated across sessions).kubed learned summary— Quick summary: "3 facts, 2 paths, 5 deps, 1 patterns".kubed learned add-fact "fact" [--category=X] [--source=Y]— Add a discovered fact.kubed learned add-path "/path" "description" [--tags=a,b]— Add an important path.kubed learned add-dep "name" [--kind=X] [--version=Y]— Add a dependency.
Agents read learned.json first to avoid re-discovering the same things. When the agent learns something useful (architecture, dependencies, patterns), it persists it so future sessions benefit.
This repo does not use Kubernetes; we validate layout with make test (fixture-based agent-query tests).
Development: test before pushing
Run make verify before pushing to main (same idea as Kubernetes: only working, quality code).
make verify # runs go vet + tests (unit + agent-query tests)
make test # tests only
make build # build binary
make help # list targets
Tests include agent-query tests: given a layout fixture, they assert that the data passed to an agent/LLM answers questions like "what workloads exist?", "what does service X select?", "what configmaps does deployment Y use?". See internal/layout/query_test.go.
Kubed Documentation (site)
This is the documentation website for the Kubed CLI tool, built with Jekyll and Tailwind CSS.
Setup
Prerequisites
- Ruby 2.7+ with Bundler
- Node.js 14+ with npm
Installation
- Install Ruby dependencies:
bundle install
- Install Node.js dependencies:
npm install
Development
To run the site locally with live reload:
npm run dev
You can then access the site at http://localhost:4000
Building for Production
npm run build:css
bundle exec jekyll build
The site will be generated in the _site directory.
Content
index.md: The home page/docker/,/kubernetes/,/terraform/,/helm/: Tool-specific documentationinstallation.md: Installation instructions
License
MIT. See the LICENSE file for details.
Contributing
Contributions are welcome. Please open an issue or submit a pull request.
Contact
Metadata
Release files for kubed 2.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kubed-2.4.1.tar.gz | 14.2 kB | Without provenance | Details for kubed-2.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kubed-2.4.1-py3-none-any.whl | Python 3 | none | any | Details for kubed-2.4.1-py3-none-any.whl |
Total release size: 27.3 kB
Release files / kubed-2.4.1.tar.gz
| Download URL | kubed-2.4.1.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f8337410ca8422f4f40b8740814f145ac18d2d6585022c7bac7c15e8a7bb8a7
|
|
BLAKE2b-256 checksum How to use checksums |
dbe494edc28826aae32c3d9027d6b37e41dd2b2bb179ad46dcc34552af0820b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / kubed-2.4.1-py3-none-any.whl
| Download URL | kubed-2.4.1-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99b0766f23e96741b17f9f64ef78bb899233c69cbe9d89e8376216d01b82b921
|
|
BLAKE2b-256 checksum How to use checksums |
d236d247533237751115de38cdaf305295670eaadb5b836a8ddeac411e5b64d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Security for kubed 2.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.