kitops
kitops copied to clipboard
Expose kit library API
Description
Core command logic now lives in a new pkg/kit library with public option/result structs so other Go programs can call Kit operations directly. Each Cobra command became a thin shim that parses flags, builds the corresponding kit options, and delegates to the library, eliminating the old per-command helper files. Shared pieces like network handling and doc guidance were realigned to match the new API, leaving CLI behaviour unchanged while enabling reuse from Go code.
updated docs to explain how to use the library, and verified the CLI still behaves the same with go test ./... plus manual pack/list/info/unpack smoke tests.
Testing
- go test ./...
- KITOPS_HOME=$(mktemp -d) ./kit list
- KITOPS_HOME=$(mktemp -d) ./kit pack "$CTX_DIR" -t localhost/sample:latest
- KITOPS_HOME=$(mktemp -d) ./kit info localhost/sample:latest
- KITOPS_HOME=$(mktemp -d) ./kit unpack localhost/sample:latest --dir "$UNPACK_DIR"
Linked issues
Closes #905
AI-Assisted Code
- [x] This PR contains AI-generated code that I have reviewed and tested
- [x] I take full responsibility for all code in this PR, regardless of how it was created