feat: anvil registry token — manage container-registry credentials #40
feat/31-registry-token-cli
into main
Why
Registry tokens (docker-login credentials) could only be created in the web UI. Add a CLI, consuming the new registry-token API (fangorn/anvil #347), so automation can provision them — concretely, the fangorn/fleet tofu deploy needs a read-only pull:fangorn/* token for the droplet.
What
anvil registry token create --name <n> [--read] [--write] [--repo org/repo | --org org] [--scope ...]
anvil registry token list
anvil registry token delete <id>
--read/--write+--repo/--orgexpand to<action>:<org>/<repo|*>scopes;--writeimplies pull+push; explicit--scopeoverrides.createprints the plaintextanvreg_...once;listnever shows it;deleteis id-scoped.
Example for the fleet token: anvil registry token create --name fleet-deploy --read --org fangorn → pull:fangorn/*.
Tests / checks
6 unit tests on the pure build_scopes logic (read/org, write/repo, explicit override, missing target, missing access, repo+org conflict). cargo fmt/clippy clean; full test suite green.
Depends on anvil #347 (the API) being deployed. Closes #31
🤖 Generated with Claude Code