circleci-env-cli
CLI tool for managing CircleCI contexts and environment variables.
Installation
Install via UV (recommended)
uv tool install circleci-env-cli
Install via Pip
pip install circleci-env-cli
Run without installing
uvx circleci-env-cli [OPTIONS]
Install via Docker
docker pull phsmith/circleci-env-cli:[VERSION]
# Run example
docker run --rm -it \
-v $HOME/project/.env:/env \
-e CIRCLE_TOKEN=${CIRCLE_TOKEN} \
phsmith/circleci-env-cli:latest [OPTIONS]
Usage
A CircleCI personal API token must be created before using this tool.
All options can be specified as environment variables in the format:
CIRCLE_<OPTION>.Example:
CIRCLE_TOKEN=********
Usage: circleci-env-cli [OPTIONS]
CLI tool for manage CircleCI contexts and environment vars
Options:
--version Show the version and exit.
-u, --api-url <circleci_api_url>
[default: https://circleci.com/api]
-t, --token <circleci_token> [default: (CIRCLE_TOKEN)]
-c, --context <context_name> It will ask for create if does not exists
-p, --project <project_slug> Example: github/org-name/project-name
[required]
-e, --env <environment_var>
-ef, --env-file <environment_vars_file>
-l, --list-envs
-d, --delete Delete mode. Behavior depends on other
options:
-c only: delete the entire context
-c + -e/-ef: delete specific context vars
-e/-ef only: delete specific project vars
-ot, --owner-type <owner_type> [default: organization]
--debug
--help Show this message and exit.
Examples
List project environment variables
$ circleci-env-cli -p github/myorg/myproject -l
> Project variables (2):
KEY1
KEY2
Add project environment variables
$ circleci-env-cli -p github/myorg/myproject -e KEY1=VAL1 -e KEY2=VAL2 -ef project.envs.txt
> Successfully added/updated variable: KEY1
> Successfully added/updated variable: KEY2
> Successfully added/updated variable: KEY3
> Successfully added/updated variable: KEY4
The env file (-ef) must contain one KEY=VALUE pair per line:
KEY3=VAL3
KEY4=VAL4
Delete project environment variables
$ circleci-env-cli -p github/myorg/myproject -e KEY1 -e KEY2 -d
> Successfully deleted variable: KEY1
> Successfully deleted variable: KEY2
List context variables
$ circleci-env-cli -p github/myorg/myproject -c mycontext -l
> Context variables (2):
KEY1
KEY2
Create/update context and add variables
$ circleci-env-cli -p github/myorg/myproject -c mycontext -e KEY1=VAL1 -e KEY2=VAL2
The context named "mycontext" was not found. Do you want to create it? [y/n]: y
> Successfully created context: mycontext
> Successfully added/updated context variable: KEY1
> Successfully added/updated context variable: KEY2
Delete context variables
$ circleci-env-cli -p github/myorg/myproject -c mycontext -e KEY1 -e KEY2 -d
> Successfully deleted context variable: KEY1
> Successfully deleted context variable: KEY2
Delete context
$ circleci-env-cli -p github/myorg/myproject -c mycontext -d
Are you sure want to delete the context "mycontext"? [y/n]: y
> Successfully deleted context: mycontext
Release files for circleci-env-cli 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| circleci_env_cli-0.3.1.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| circleci_env_cli-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / circleci_env_cli-0.3.1.tar.gz
| Download URL | circleci_env_cli-0.3.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d6e8dcac7f5fc4a23f071e22918178f3f2a24bf0c1adb00ab32e93b6ed88c9f
|
|
BLAKE2b-256 checksum How to use checksums |
2fcf5a8f83fa24caaadd37ee7321895e8de25474f41865ebdd90ff97e87a0bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / circleci_env_cli-0.3.1-py3-none-any.whl
| Download URL | circleci_env_cli-0.3.1-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47fe3aa685533db91a48336329de1d5373fa00fae332e0e9563be811f6b91481
|
|
BLAKE2b-256 checksum How to use checksums |
fdfeca660d015b08d591425e73a9c55739bae2ed5500a8a5bfce1436c8b4aa71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|