feat(packages): add packages command group with list
Description
Adds a new glab packages command group for the project package registry,
addressing the request to upload/download generic packages without hand-rolling
curl and a manually looked-up token.
This first MR adds the parent command (modeled on glab securefile) and the
list subcommand, which lists a project's packages as JSON with --name
filtering and --jq support.
The command is intentionally flat (glab packages <verb>). Only generic
packages are supported for now; a --package-format flag can be added later
without restructuring.
Note
The decision to stick to only JSON was intentional. This keeps the changes small in scope.
Related Issues
Resolves #7421 (closed)
How has this been tested?
Automated:
go test ./internal/commands/packages/... ./internal/commands/golangci-lint run ./internal/commands/packages/...— 0 issues
Manual (against a project you can read, e.g. -R group/project):
- Build the branch:
make build ./bin/glab packages list -R group/project— prints the project's packages as JSON../bin/glab packages ls -R group/project— thelsalias produces the same output../bin/glab packages list -R group/project --name some-package— only packages matching that name are returned../bin/glab packages list -R group/project --jq '.[].name'—--jqfilters the JSON to just the names../bin/glab packages list -R group/project --per-page 5 --page 2— paginates the result.- Run inside a repo clone with no
-Rand confirm it targets the current project.
Stacked MRs (review/merge bottom-up):
- !3393 (merged) — Add packages command group with list
- !3394 (merged) — Add packages upload command (depends on !3393 (merged))
- !3395 (merged) — Add packages download command (depends on !3394 (merged))
- !3396 (merged) — Add packages delete command (depends on !3395 (merged))