contox login
Store your API key in the global configuration file (~/.contoxrc). This is the first command you run after installing the CLI.
Usage
bash
contox login -k <apiKey> [--url <apiUrl>]
Options
| Flag | Description | Required | Default |
|---|---|---|---|
-k, --key <apiKey> | Your Contox API key | Yes | -- |
--url <apiUrl> | API base URL | No | https://contox.dev |
Examples
Log in with your API key:
bash
contox login -k ctx_abc123def456
Log in with a custom API URL (self-hosted):
bash
contox login -k ctx_abc123def456 --url https://contox.mycompany.com
Verify the login was successful:
bash
contox whoami
What it does
The login command writes your API key and API URL to ~/.contoxrc in your home directory. This file is used by all other CLI commands to authenticate with the Contox platform.
Notes
- Your API key is stored in plain text in
~/.contoxrc. Ensure appropriate file permissions on shared machines. - You can also set the API key via the
CONTOX_API_KEYenvironment variable, which takes precedence over the config file. - To get an API key, go to Dashboard > Settings > API Keys on the Contox platform.