Skip to main content

CLI tool for manage CircleCI contexts and environment vars

Project description

circleci-env-cli

CLI tool for manage CircleCI contexts and environment vars

Installation

Install locally

pip install -r requirements.txt
./circleci_env_cli.py [OPTIONS]

Install via Pip

pip install circleci-env-cli

Install via Docker

docker run --rm phsmith/circleci-env-cli:latest [OPTIONS]

Usage

A CircleCI personal API token must be create before use 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:
  -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>
  -d, --delete                    Context only, will delete the context
                                  Context + vars, will delete the context vars
                                  Vars only, will delete the environment vars
  -ot, --owner-type <owner_type>  [default: organization]
  --debug
  --help                          Show this message and exit.

Examples

Add project environment variables

$ circleci-env-cli -p github/myorg/myproject -e KEY1=VAL1 -e KEY2=VAL2 -ef project.envs.txt
> Successfully add/update variable: KEY1
> Successfully add/update variable: KEY2
> Successfully add/update variable: KEY3
> Successfully add/update variable: KEY4

Delete project environment variables

$ circleci-env-cli -p github/myorg/myproject -e KEY1 -e KEY2 -d
> Successfully delete variable: KEY1
> Successfully delete variable: KEY2

Create/update a 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 create context: mycontext
> Successfully add/update context variable: KEY1
> Successfully add/update context variable: KEY2

Delete context variables

$ circleci-env-cli -p github/myorg/myproject -c mycontext -e KEY1 -e KEY2 -d
> Successfully delete context variable: KEY1
> Successfully delete 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 delete context

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circleci-env-cli-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circleci_env_cli-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file circleci-env-cli-0.1.0.tar.gz.

File metadata

  • Download URL: circleci-env-cli-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for circleci-env-cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b6355f11e758034093784fee03e99b161b8efb234e23de09e16c5cb668a0df2
MD5 5c1c210aaac8649cefb56922ba0944c5
BLAKE2b-256 8064c7c5bf0c3d8d48a9f0a020789a7ff7d74c9db6929f50e0e03e04aa45ace3

See more details on using hashes here.

File details

Details for the file circleci_env_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for circleci_env_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82356f087e94e5b4f689c1d8f5b57f19ddf25ed48b65be1f580dee50e4d60b30
MD5 ccd847dee7bdba4233ca8a8229b0fdc2
BLAKE2b-256 46c551f71530e587e4e788e0569a4d654fbfa71c74894ca383a981da26458d41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page