Docs
CLICI/CD

Secrets and variables

List, create, update and delete CI secrets and variables; secret values are never shown (co secret, co variable)

co secret and co variable list, create and delete the secrets and variables your pipelines use. Secret values are never printed. Variables show their values in the list.

The scope is the workspace by default, a repository with --repo, and one environment of that repository with --repo and --env together. Both commands take the same options.

List

co secret list                              # workspace scope
co secret list --repo collabops-cli         # a repository
co secret list --repo collabops-cli --env prod   # one environment of a repository
co secret list -q DEPLOY                    # find by name
co variable list --repo collabops-cli -q URL

Create and update

printf %s "$TOKEN" | co secret set DEPLOY_TOKEN --repo collabops-cli   # value from stdin
co secret set DEPLOY_TOKEN --repo collabops-cli --env prod            # asks for the value
co variable set REGION -b ap-northeast-2

If the name doesn't exist in the scope it is created; if it does, its value is replaced. Names are upper-cased before sending and may contain only capital letters, digits and underscores (not starting with a digit). The value comes from -b, else from piped stdin, else from a prompt. One trailing newline from stdin is dropped. -d sets a description; leave it out to keep the current one.

A value passed with -b stays in your shell history. Put secrets in through stdin or the prompt.

Delete

co secret delete DEPLOY_TOKEN --repo collabops-cli
co secret delete DEPLOY_TOKEN --repo collabops-cli --env prod -y

Deletes only from the scope given. Without -y co asks first, and it refuses without a terminal. Workflows that still use the name fail at their next run.

Table of Contents

AI tools

Was this helpful?