CLI
Manage API keys for project authentication.
Related docs: Authentication & Authorization, API Key Rotation, Security, CLI Overview.
api-keys create
Create a new API key.
| Flag | Type | Default | Description |
|---|---|---|---|
| --project | string | Project ID | |
| --name | string | Name for the API key | |
| --scopes | string | Comma-separated list of scopes |
The raw API key is returned only once upon creation. Ensure you store it safely.
strait api-keys create --project my-project --name "CI/CD Key" --scopes "jobs:read,jobs:write"api-keys list
List API keys for a project.
| Flag | Type | Default | Description |
|---|---|---|---|
| --project | string | Project ID |
strait api-keys list --project my-projectapi-keys revoke
Revoke an API key by its ID.
strait api-keys revoke <key-id>api-keys rotate
Rotate an API key using the API rotation endpoint with a configurable grace window.
| Flag | Type | Default | Description |
|---|---|---|---|
| --grace-period-minutes | int | 60 | How long the old key remains valid |
strait api-keys rotate <key-id> --grace-period-minutes 120Always store your API keys in a secure location, such as a password manager or a secure vault. Never commit them to version control.
Was this page helpful?