Skip to main content
The checkly env command manages global environment variables in your Checkly account. Create, update, list, export, and remove variables that are available across all checks in your account.
Before using checkly env, ensure you have:
  • An initialized Checkly CLI project
  • At least one check or resource defined in your project
  • Valid Checkly account authentication (run npx checkly login if needed)
  • A checkly.config.ts or checkly.config.js configuration file
For additional setup information, see CLI overview.

Usage

The basic command structure uses subcommands to manage environment variables.
Terminal

Subcommands

checkly env add

Create a new global environment variable. Usage:
Terminal
If you leave out the value, the CLI asks for it with a hidden input, which keeps it out of your shell history.
checkly env add fails if a variable with the same key already exists. Use checkly env update to change its value, or pass --secret to env update to turn a plain variable into a secret.
Options: Examples:
Terminal

checkly env update

Update an existing global environment variable. Usage:
Terminal
If you leave out the value, the CLI asks for it with a hidden input, which keeps it out of your shell history.
env update always saves the variable with the --locked and --secret flags you pass. Pass --locked again when you update a locked variable, or it is saved unlocked. Pass --secret again when you update a secret, or the update fails.
Options: Examples:
Terminal

checkly env ls

List all global environment variables in your account. Usage:
Terminal
Examples:
Terminal
Shows variable keys and their values. Secret values are hidden for security.

checkly env pull

Export global variables from your Checkly account to a local file. Usage:
Terminal
Options: Examples:
Terminal

checkly env rm

Remove a global environment variable. Usage:
Terminal
Options: Examples:
Terminal

Variable Types

Regular Variables

Standard key-value pairs visible to all team members:
Terminal

Locked Variables

Locked environment variables can only be accessed by team members with “Read & Write” access or above.
Terminal

Secrets

Once saved, secrets are never shown in the UI or in logs. The secret value cannot be accessed via the CLI or API.
Terminal

Variable Scope

Environment variables managed by checkly env are global and available to:
  • All checks in your account
  • All check groups
  • All team members (unless locked)
For check-specific or group-specific variables, use the web UI or configure them directly in your monitoring-as-code setup.

Best Practices

  1. Use secrets for sensitive data like API keys, passwords, and tokens
  2. Lock internal variables that shouldn’t be visible to read-only users
  3. Use descriptive names following standard conventions (UPPER_SNAKE_CASE)
  4. Document variables and their purposes for team collaboration
  5. Regular cleanup of unused variables to maintain security