- Build:
go build ./... - Run:
go run ./cmd/main.go <command> - Test:
go test ./...
cmd/main.go— entry pointinternal/cmd/<command>/— each CLI command in its own packageinternal/cmdutil/— shared command utilities (Factory, auth checks, spinner config)pkg/api/— GraphQL API clientpkg/model/— data models (GraphQL struct tags)internal/cmd/root/root.go— root command, registers all subcommands
When adding or modifying CLI commands, flags, or subcommands, the output of zeabur help --all automatically reflects changes (it walks the Cobra command tree at runtime). No manual update is needed for the help output itself.
However, when adding a new subcommand, you must:
- Create the command package under
internal/cmd/<parent>/<new>/ - Register it in the parent command file (e.g.,
internal/cmd/template/template.go)
- Fully automated: push a
v*tag → GitHub Actions runs GoReleaser → publishes GitHub Release + npm package - npm publish is handled in the same workflow (
.github/workflows/release.yml), no manual steps needed npm/prepare.shsupportsVERSIONenv var (set by CI) or falls back togh apifor local use
- Each subcommand lives in its own package:
internal/cmd/<parent>/<sub>/<sub>.go - Commands support both interactive and non-interactive modes; if a flag is provided, skip the interactive prompt
- Use
cmdutil.SpinnerCharSet,cmdutil.SpinnerInterval,cmdutil.SpinnerColorfor spinners - Models in
pkg/model/usegraphql:"fieldName"struct tags — only add fields that exist in the backend GraphQL schema - Backend GraphQL schema lives in
../backend/internal/gateway/graphql/