This file provides guidance to coding agents (e.g. Claude Code, claude.ai/code) when working with code in this repository.
Go module kmodules.xyz/image-packer — a CLI of OCI image tools used by AppsCode catalog and release tooling. Notable subcommands:
parse— parse an image reference into registry/repo/tag/digest components.list— list all images referenced by a Helm chart.list-editor-charts— list editor charts (catalog mode).list-feature-charts— list feature-set charts.ace-up— upload the ACE catalog images to a target registry.generate-scripts— generatecopy-images.sh/export-images.sh/import-images.sh/import-into-k3s.shfor an image catalog.generate-gcp-script— GCP-flavored mirror script.generate-cve-report— run trivy across an image catalog and emit a markdown CVE table (this is what generates thecatalog/README.mdfiles in the installer repos).replace-image-digest— patch an image reference to a pinned digest.
Plus version and completion. The produced binary is image-packer.
The local filesystem path is kubeops.dev/img-tools and the GitHub repo is kubeops/img-tools (which redirects to kubeops/image-packer). The Go module is kmodules.xyz/image-packer — use that in imports. Other AppsCode installer repos import this module and shell out to image-packer via hack/scripts/update-catalog.sh.
main.go— entry point at the module root.pkg/cmds/— one file per top-level subcommand.root.goregisters them;completion.gois shared.pkg/lib/:image.go— image-reference parsing/manipulation.shell.go— script generation helpers (copy-images.sh, etc.).trivy.go— wraps the trivy CLI for CVE reports.tests.go— test helpers.
testdata/— fixtures (chart bundles, image lists).hack/,Makefile— AppsCode build harness. Binary builds for 5 platforms (linux amd64/arm/arm64 + windows/amd64 + darwin/amd64 + darwin/arm64) — used from operator workstations and CI.vendor/— checked-in deps.
There is no Docker image — this is a host CLI.
All Make targets run inside ghcr.io/appscode/golang-dev — Docker must be running.
make ci— CI pipeline.make build— build for the host OS/ARCH.make all-build— build for everyBIN_PLATFORMS(linux/arm/arm64 + windows + darwin amd64/arm64).make fmt,make lint,make unit-tests/make test— standard.make verify—verify-gen verify-modules;go mod tidy && go mod vendormust leave the tree clean.make add-license/make check-license— manage license headers.
Run a single Go test (requires a local Go toolchain):
go test ./pkg/lib/... -run TestName -v
- Module path is
kmodules.xyz/image-packer(vanity URL). Note: the GitHub repo name (kubeops/img-tools) and Go module name (kmodules.xyz/image-packer) are different — use the module path in imports. - License: Apache-2.0 (
LICENSE); new files need the standard "Copyright AppsCode Inc. and Contributors" header (make add-license). - Sign off commits (
git commit -s); contributions follow the DCO (DCO,CONTRIBUTING.md). - Vendor directory is checked in —
go mod tidy && go mod vendormust leave the tree clean (enforced byverify-modules). - New subcommand: drop a
pkg/cmds/<name>.goand register it inroot.go. Image-reference parsing and shell-script generation logic belong inpkg/lib/; don't growpkg/cmds/*.gofiles into utility libraries. - The
generate-cve-reportflow shells out to trivy; users must have it installed (the README/script docs the version constraints — keep them in sync when bumping). - Builds linux/windows/darwin host binaries; do not pull in linux-only or cgo deps.
- Downstream installer repos consume this binary via
hack/scripts/update-catalog.sh— keepgenerate-scriptsoutput stable, since those scripts are committed to dozens of repos.