Token
Manage the CLI-token surface (/api/v1/auth/cli-tokens). These are the long-lived bearers crewship login --token consumes and that you create in Settings → CLI tokens in the web UI. Tokens are user-scoped, not workspace-scoped — every subcommand clears WorkspaceID on the client.
Defined in
cmd/crewship/cmd_token.go. All subcommands require an active login.Subcommands
crewship token list
GET /api/v1/auth/cli-tokens. Columns: ID (first 12 chars), NAME, CREATED, LAST USED, STATUS.
crewship token create [name]
POST /api/v1/auth/cli-token. Name defaults to "CLI token". Returns the full bearer once — stored only at creation.
Output (default mode — the token value and its warning go to stderr, the metadata to stdout, so a naive
> file redirect doesn’t silently persist the bearer):
crewship token revoke <token-id>
DELETE /api/v1/auth/cli-tokens/{id}. Prompts for confirmation unless -y.
crewship token rotate <token-id>
Atomic-ish replacement: creates a new token (carrying the old name with a rotation timestamp suffix), prints it, then revokes the old. No dedicated server rotate endpoint exists — this is the same shape the web UI uses.
token <id> is already revoked— pick a different token or justcreatea fresh one.token <id> not found (run 'crewship token list')— typo or the token belongs to another user.revoke old token (new token IS active, re-run 'crewship token revoke <old-id>'): <err>— exactly the case described above; the new token is fine, finish manually.
crewship token validate
GET /api/v1/auth/cli-token/validate. Returns user_id, email, and (when present) expires_at.
401 / 403 map to token is invalid or expired.
See also
crewship login— how a token becomes the active credential.crewship whoami— confirm which token/identity is in use.crewship config— view/edit thetokenkey incli-config.yaml.