Skip to content

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

FlagDescriptionRequiredDefault
-k, --key <apiKey>Your Contox API keyYes--
--url <apiUrl>API base URLNohttps://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_KEY environment variable, which takes precedence over the config file.
  • To get an API key, go to Dashboard > Settings > API Keys on the Contox platform.