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.
Prerequisites
Prerequisites
Before using , 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
orcheckly.config.js
configuration file
Usage
The basic command structure uses subcommands to manage environment variables.Terminal
Subcommands
Subcommand | Description |
---|---|
add | Create and add a new environment variable. |
update | Update an existing environment variable. |
ls | List all global environment variables. |
pull | Export variables to a local file. |
rm | Remove an environment variable. |
checkly env add
Create a new global environment variable.
Usage:
Terminal
Option | Description |
---|---|
--locked, -l | Lock variable. |
--secret, -s | Store as secret. |
Terminal
checkly env update
Update an existing global environment variable.
Usage:
Terminal
Option | Description |
---|---|
--locked, -l | Lock variable. |
--secret, -s | Store as secret. |
Terminal
checkly env ls
List all global environment variables in your account.
Usage:
Terminal
Terminal
checkly env pull
Export global variables from your Checkly account to a local file.
Usage:
Terminal
Option | Description |
---|---|
--force, -f | Overwrite existing file without confirmation |
Terminal
checkly env rm
Remove a global environment variable.
Usage:
Terminal
Option | Description |
---|---|
--force, -f | Skip confirmation dialog |
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 bycheckly env
are global and available to:
- All checks in your account
- All check groups
- All team members (unless locked)
Best Practices
- Use secrets for sensitive data like API keys, passwords, and tokens
- Lock internal variables that shouldn’t be visible to read-only users
- Use descriptive names following standard conventions (UPPER_SNAKE_CASE)
- Document variables and their purposes for team collaboration
- Regular cleanup of unused variables to maintain security
Related Commands
checkly test
- Test your setup before deploymentcheckly deploy
- Deploy your Checkly configuration