Skip to content

theseus token

Create, list and revoke personal tokens for the Theseus API.

Usage: theseus token list [--json]
       theseus token create --name <name> --scope <scope>... [--workspace <slug-or-id>]...
                            [--repository <rep_id>]... [--expires-in-days <days>] [--json]
       theseus token revoke <token-id> [--json]
OptionValueWhen omitted
--jsonSwitchfalse
--namenameNot set
--scope (repeatable)scopeRequired for create
--workspace (repeatable)slug-or-idSelected workspace
--repository (repeatable)rep_idEvery repository in the allowed workspaces
--expires-in-daysdays90 (API default)
ActionArgumentOptions
listNone--json
revoketoken-id--json
createNone--json, --name (required), --scope (required), --workspace, --repository, --expires-in-days

JSON output: Version 1 object: tokens for list; token and secret for create; revoked for revoke. Errors: event="error", code, error.

Exit codes: 0 Success; 1 Failure; 2 Invalid arguments; 130 Interrupted by Ctrl-C.

Full command help and examples
Usage: theseus token list [--json]
       theseus token create --name <name> --scope <scope>... [--workspace <slug-or-id>]...
                            [--repository <rep_id>]... [--expires-in-days <days>] [--json]
       theseus token revoke <token-id> [--json]

Personal tokens let scripts call the Theseus API (/api/v1) as you, limited to their scopes,
workspaces and repositories. cli:download permits only canonical CLI catalogue GETs;
preview downloads require staff eligibility. The saved login manages tokens; a personal token cannot.

create asks for a token, prints a code and a link, and waits while you sign the token in in a
browser. It then prints the token once; Theseus keeps only its hash.
  --name <name>              What the token is for, shown in theseus token list
  --scope <scope>            read, runs:write, webhooks:manage or cli:download; repeat
  --workspace <slug-or-id>   A workspace it may reach; repeat for more. Without one, the
                             workspace this machine selected (theseus workspace)
  --repository <rep_id>      Limit it to this repository; repeat for more. Without one, every
                             repository in its workspaces
  --expires-in-days <days>   1 to 365; 90 when not given

--json prints one JSON line: {"version":1,"tokens":[...]} for list,
{"version":1,"token":{...},"secret":"ths_pat_..."} for create, {"version":1,"revoked":id} for
revoke. Messages for the person, such as create's code and link, go to stderr.
Exits 0 on success, 1 on failure, 2 for usage and 130 when Ctrl-C stops create's wait. With
--json, a failure prints {"event":"error","code":...,"error":...}; codes include not-found,
workspace-not-found, expired, collect-failed, insufficient-scope, invalid-request and
login-required.

Examples:
  theseus token create --name ci --scope read --workspace acme
  theseus token list
  theseus token revoke lgn_...