Configuration

Environment variables, global flags, and the files the CLI keeps on your machine.

5 sections3 min read

There is no config file to write. The CLI is configured with flags and environment variables, and keeps a small amount of state in your home directory.

Environment variables

VariableDefaultEffect
CEFENSE_API_URLhttps://cefense.comThe Cefense instance to talk to.
CEFENSE_REPOunsetThe repository to act on, the same as --repo.
CEFENSE_ORGunsetThe organization to act on, the same as --org. Overrides what cf org use stored.
CEFENSE_TOKENunsetAn access token to use instead of the keychain. Never written to disk.
CEFENSE_AGENTunsetTurn agent mode on for every command without passing --agent. Any value turns it on except 0, false, no, and off.
CEFENSE_PAGERunsetWhich pager a long view opens in. Checked before PAGER.
PAGERunsetThe fallback pager. Set either to cat to turn paging off everywhere.
NO_COLORunsetDisable colour.
FORCE_COLORunsetKeep colour when piping.

Global flags

Available on every command, and taking precedence over the environment.

FlagEffect
--api-url <url>Override the instance for one invocation.
--repo <owner/name>Override the repository for one invocation.
--org <slug>Override the organization for one invocation.
--jsonEmit the raw API response as pretty JSON.
--agentMachine mode. See Agent mode.
--columns <list>Choose the table's columns, and their order. See Reading the output.
--fields <list>In agent mode, trim every list in the envelope to these keys. id is always kept.
--webOpen the result's page in a browser instead of printing it.
--no-pagerPrint a long view straight through instead of paging it.
--no-colorDisable colour.
--verbosePrint a stack trace on failure.
-y, --yesAnswer every confirmation in advance.
--no-linkResolve the repository without remembering it for this directory.
-v, --versionPrint the version.
-h, --helpPrint help for any command.

Precedence

  1. A flag on the command.
  2. The environment variable.
  3. The stored preference or directory link.
  4. The built-in default.

What the CLI keeps on your machine

~/.cefense-cli/directory
Created with owner-only permissions the first time it is needed.
config.jsonfile
Your instance preference.
defaults.jsonfile
Which repository each directory is linked to.
organizations.jsonfile
The organization chosen with cf org use, per instance. Global rather than per directory.
discovery.jsonfile
A short-lived cache of each instance's configuration.
credentials.jsonfile
Only written when no system keyring is available, with owner-only permissions.

Removing all of it

Sign out and clear local statebash
cf auth logout --all
rm -rf ~/.cefense-cli

Have a correction or need help?

Email the docs team