mr token create
Create a new API token for the authenticated account and print the secret once. Store it securely; it cannot be retrieved again. An account may hold at most -max-user-tokens tokens (100 by default; 0 disables the cap), and minting past it fails with HTTP 409, so revoke one first.
Usage
mr token create
Examples
Create a token labelled 'ci'
mr token create --name ci
Create a token that expires in 30 days
mr token create --name temp --expires-in 720h
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--name | string | mr cli | Label for the token |
--expires-in | string | `` | Optional expiry as a Go duration (e.g. 720h); empty = never |
Inherited global flags
| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Output raw JSON |
--no-header | bool | false | Omit table headers |
--page | int | 1 | Page number for list commands (default page size: 50) |
--quiet | bool | false | Only output IDs |
--server | string | http://localhost:8181 | mahresources server URL (env: MAHRESOURCES_URL) |
Output
ID, Name and Token lines; --json emits {token, id, name, prefix}, where id is lower case while the list array uses ID
Exit Codes
0 success; 1 error (not authenticated, network error, or token not found)