Create a personal access token, or a deploy token with –repo
Create a token and show its secret once.
Without –repo this creates a PERSONAL ACCESS TOKEN, bound to your user, with the scopes of –scope (repo:read, repo:write, repo:manage; repeat the flag or separate with commas; default repo:read). repo:read also reads scan results. It lives 365 days unless –expires-in is shorter. Its name must differ, ignoring case, from your other tokens that are not revoked and have not expired; a taken name is refused (409 accessTokenNameInUse, RPS-2655).
With –repo <name> this creates a DEPLOY TOKEN, bound to that repository only, for package clients. –username sets the username of the pair (the server generates one when it is empty), –read-only limits it to pulls. –scope does not apply to a deploy token. rp prints the id of the new token and puts it in the structured output as “id” (revoke it with rp token revoke <id> –repo <name>); it is empty if the server does not tell it.
The secret is shown once and cannot be read again. rp prints it on stdout only when you pass –show-secret (the bare token, one line) or a structured output (–output json|yaml, or –jq). Without one of them rp refuses before it creates anything, so a token is never created and lost. Everything else rp prints goes to stderr. The secret is never taken from a flag.
TOKEN=$(rp token create --name ci --scope repo:write --show-secret)
rp token create --name ci --repo libs --read-only --output json --jq .token
rp token create [flags]
Options
--expires-in string Lifetime, for example 30d or 720h (at most 365d; default: the server's, 365 days)
--name string Name of the token (required, at most 80 characters)
--read-only Make a deploy token read-only
--repo string Create a deploy token for this repository (without it: a personal access token)
--scope strings Scopes of a personal access token: repo:read, repo:write, repo:manage (default repo:read)
--show-secret Print the secret on stdout (once); implied by a structured --output
--username string Username of a deploy token (default: generated by the server)
Options inherited from parent commands
--api-url string Panel API URL of the profile, overrides the stored value
--ca-file string PEM file with extra trusted CA certificates
--debug Print debug output with secrets redacted
--hostname string Repsy host to use instead of the current profile
--insecure Do not verify TLS certificates (unsafe; plain http is chosen with the URL, not with this flag)
--insecure-storage Keep credentials in a plain 0600 file instead of the OS keyring (unsafe; a warning is printed once per command)
--jq string Filter JSON output with a jq expression (implies --output json)
--no-color Disable colored output
--no-input Never prompt; fail when input is needed
--output table|json|yaml Output format: table, json or yaml (default table; json when --jq is given)
--owner string Owner segment of Cloud protocol URLs; --owner= means none
--registry-url string Protocol host URL of the profile, overrides the stored value
--type os|cloud Product of the host, overrides detection
--web-url string Panel UI URL of the profile (where /cli/auth lives), overrides the stored value
--yes Answer yes to confirmation prompts
See also
- rp token - Manage personal access tokens and deploy tokens