Skip to content

Add service-token duplicate command - #1525

Merged
nickvanw merged 1 commit into
mainfrom
cursor/service-token-duplicate-bb03
Nov 14, 2026
Merged

nickvanw merged 1 commit into
mainfrom
cursor/service-token-duplicate-bb03

Conversation

@mscoutermarsh

Copy link
Copy Markdown
Member

Add pscale service-token duplicate <id> --name <name>, which copies a service token and prints the new id and secret the same way service-token create does.

Decisions, testing, and risks
  • POST /v1/organizations/:organization/service-tokens/:id/duplicate with body {"name":"<name>"}. The response is printed with the same secret formatter as service-token create.
  • --name is required. --org stays the existing required persistent flag on service-token. No other flags.
  • Auth and not-found handling match the other service-token commands. Service-token authentication is still rejected by the parent command.
  • Test: TestServiceToken_DuplicateCmd in internal/cmd/token/create_test.go runs service-token duplicate, checks the duplicate request (method, path, bearer auth, name body), and checks the printed id and secret.
  • Skipped a separate client unit test, a human-format test, and an AGENTS.md section. The command test hits the real client, create already covers the shared printer, and AGENTS.md does not document the service-token commands.
  • Risk: the command writes the one-time secret to stdout, same as create.
Open in Web Open in Cursor 

@mscoutermarsh
mscoutermarsh requested a review from a team as a code owner November 14, 2026 16:08

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Approved. Cursor Bugbot completed with no findings that need human review; Cursor Security Agent was not running on this PR. The change is a bounded CLI wrapper around the existing service-token duplicate API, with a command test covering the request and secret output.

Open in Web View Automation 

Sent by Cursor Approval Agent: cli-reviewer

@nickvanw
nickvanw merged commit 47df166 into main Nov 14, 2026
6 checks passed
@nickvanw
nickvanw deleted the cursor/service-token-duplicate-bb03 branch November 14, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants