016f93ab4f
Add a monorepo for small single-purpose CLI tools that share a common library, so tools reuse TUI primitives and Kubernetes client bootstrapping instead of duplicating them. - common/tui: direction markers, style palette, width-aware padding/layout - common/kube: in-cluster→kubeconfig client loading + core/metrics clients - podgap: live TUI comparing pod requests/limits vs actual usage, with up/down markers showing per-pod change since the last refresh - Makefile auto-discovers tool directories: make <tool> | all | install
45 lines
1.6 KiB
Markdown
45 lines
1.6 KiB
Markdown
# benvin-utils
|
|
|
|
A monorepo of small, single-purpose command-line tools. Each tool is its own
|
|
directory (a `package main`); shared code lives under [`common/`](./common) so
|
|
tools reuse the same TUI primitives and Kubernetes client bootstrapping instead
|
|
of copy-pasting them.
|
|
|
|
```
|
|
benvin-utils/
|
|
├── common/ # shared library, imported by tools
|
|
│ ├── tui/ # direction markers, style palette, padding/layout helpers
|
|
│ └── kube/ # in-cluster→kubeconfig client loading
|
|
├── podgap/ # tool: pod requests/limits vs actual usage (live TUI)
|
|
└── Makefile # auto-discovers tools — no edits when you add one
|
|
```
|
|
|
|
## Tools
|
|
|
|
| Tool | What it does |
|
|
|------|--------------|
|
|
| [`podgap`](./podgap) | Live TUI comparing pod CPU/memory **requests & limits vs actual usage**, with ▲/▼ change markers. |
|
|
|
|
## Build & install
|
|
|
|
Tools are auto-discovered (any directory with a `package main`), so the targets
|
|
below need no editing when you add a new tool.
|
|
|
|
```sh
|
|
make all # build every tool into ./bin
|
|
make podgap # build just one tool into ./bin/podgap
|
|
make install # go install every tool into $GOBIN (or $GOPATH/bin)
|
|
make test # run all tests
|
|
make list # list discovered tools
|
|
make help # show all targets
|
|
```
|
|
|
|
## Adding a new tool
|
|
|
|
1. `mkdir mytool && $EDITOR mytool/main.go` with `package main`.
|
|
2. Import shared helpers as needed:
|
|
`git.unkin.net/unkin/benvin-utils/common/tui`,
|
|
`git.unkin.net/unkin/benvin-utils/common/kube`.
|
|
3. That's it — `make mytool`, `make all`, and `make install` pick it up
|
|
automatically.
|