Authentication
The Status200 CLI supports multiple ways to authenticate with your Status200 instance. You can use named contexts, environment variables, or pass credentials directly as flags.
Login
Authenticate with your Status200 instance using an API key:
status200 login <api-key> <instance-url>Arguments:
| Argument | Description |
|---|---|
<api-key> | Your Status200 API key (e.g., sk-your-api-key) |
<instance-url> | Your Status200 instance URL (e.g., https://status200.ru) |
Options:
| Option | Description |
|---|---|
--context-name <name> | Name for this context (default: "default") |
Examples:
# Login with default context
status200 login sk-abc123 https://status200.ru
# Login with a named context
status200 login sk-abc123 https://status200.ru --context-name production
# Set up multiple environments
status200 login sk-prod-key https://status200.ru --context-name production
status200 login sk-staging-key https://staging.status200.ru --context-name stagingContexts
Contexts allow you to save and switch between multiple Status200 environments (e.g., production, staging, development).
List Contexts
status200 context listDisplays all configured contexts. The current context is marked with *.
Switch Context
status200 context use <name>Switch to a different named context for all subsequent commands.
# Switch to staging
status200 context use staging
# Switch to production
status200 context use productionView Current Context
status200 context currentDisplays the currently active context, including the instance URL and a masked API key.
Delete a Context
status200 context delete <name>Remove a named context. If the deleted context is the current one, the CLI automatically switches to the first remaining context.
Credential Resolution
Credentials are resolved in the following priority order:
- CLI flags (
--api-keyand--url) - Environment variables (
S200_API_KEYandS200_URL) - Named context (via
--contextflag) - Current context (from saved configuration)
You can mix sources -- for example, use an environment variable for the API key and a saved context for the URL.
Using CLI Flags
status200 --api-key sk-abc123 --url https://status200.ru incident listUsing Environment Variables
export S200_API_KEY=sk-abc123
export S200_URL=https://status200.ru
status200 incident listUsing a Specific Context
status200 --context production incident listVerify Authentication
Check your current authentication status:
status200 whoamiThis displays:
- Instance URL
- Masked API key
- Current context name (only shown if a saved context is active)
If not authenticated, the command shows a helpful message suggesting you run status200 login.
Configuration File
Credentials are stored in ~/.status200/config.json with restricted permissions (0600).
{
"currentContext": "production",
"contexts": {
"production": {
"name": "production",
"apiUrl": "https://status200.ru",
"apiKey": "sk-..."
},
"staging": {
"name": "staging",
"apiUrl": "https://staging.status200.ru",
"apiKey": "sk-..."
}
},
"defaults": {
"output": "table",
"limit": 10
}
}