Add personal access token commands#157
Conversation
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="e2e/cli_tests/token_test.go">
<violation number="1" location="e2e/cli_tests/token_test.go:19">
P2: Register cleanup before assertions that can `t.Fatal` after resource creation, otherwise a failing token-value check can skip deletion of the created token.</violation>
</file>
<file name="internal/commands/token.go">
<violation number="1" location="internal/commands/token.go:21">
P2: `token` subcommands incorrectly require an account for root-client access token APIs; this can fail for valid authenticated users without a configured profile/account.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Pull request overview
Adds CLI support for managing personal access tokens (fizzy token list|create|delete) backed by the root SDK client’s AccessTokensService, plus an e2e CRUD test and regenerated command surface docs.
Changes:
- Introduces
tokenroot command withlist,create, anddeletesubcommands. - Adds token table column definitions for human-readable list output.
- Adds an e2e CRUD test for tokens and updates
SURFACE.txtaccordingly.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/commands/token.go | Adds fizzy token command implementation (list/create/delete) using the SDK AccessTokens service. |
| internal/commands/columns.go | Adds tokenColumns for rendering token lists in styled/markdown outputs. |
| e2e/cli_tests/token_test.go | Adds end-to-end CRUD coverage for token commands. |
| SURFACE.txt | Regenerates command/flag surface to include the new token commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds `fizzy token list|create|delete` backed by AccessTokensService on the root SDK client. Covers the three SDK methods that previously had no CLI surface (CreateAccessToken, ListAccessTokens, DeleteAccessToken). Includes an e2e CRUD test mirroring the webhook pattern, and the regenerated SURFACE.txt snapshot.
- Use requireAuth + requireSDK instead of requireAuthAndAccount: the /my/access_tokens endpoint is on the root SDK client (not account-scoped), so requiring an account blocks valid users who haven't selected one (matches the pattern used by `identity show`). - Gate the "delete" breadcrumb on a non-empty id so we don't render `fizzy token delete ` when the API response has no id. - E2e: register the cleanup hook before the second t.Fatal check so a missing-token-value failure can't strand the created token.
2c5d971 to
9b86152
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
fizzy token list|create|deletebacked byAccessTokensServiceon the root SDK client.CreateAccessToken,ListAccessTokens, andDeleteAccessTokenpreviously had no command surface.SURFACE.txt.Notes
Createreturns the raw token value once; the command surfaces a notice that it won't be shown again.permissionis passed through as a free string (the spec doesn't constrain it to an enum).Summary by cubic
Adds
fizzy tokenlist|create|delete to manage personal access tokens from the CLI using the rootAccessTokensService(no account needed). Improves command discoverability and help, and adds e2e CRUD coverage.New Features
tokenappears in the command catalog and root help;ls/rmaliases supported.Bug Fixes
requireAuth+requireSDKto match the root/my/access_tokensendpoint (no account required).Written for commit f73886c. Summary will update on new commits. Review in cubic