Environment and diagnostics

cademi env shows the settings the CLI is using and where each one comes from, and cademi doctor checks the configuration, the network, and the credentials. This page also lists every environment variable the CLI reads.

cademi env

cademi env
cademi env base_url
cademi env --json

cademi env prints one row per setting with its value and its source. With a setting name, it prints only the value, for use in scripts; an unknown name exits with code 2. --json prints an array of objects with name, value, source, and, when the value comes from an environment variable, variable. Secrets are never printed, only whether they are set and where.

For example, with CADEMI_API_KEY set and no saved profile:

NAME            VALUE                                          SOURCE
config_dir      /Users/you/Library/Application Support/cademi  default
profile         -                                              unset
base_url        https://api.cademi.com.br                      default
auth_mode       key (autonomous)                               env (CADEMI_API_KEY)
credential      set                                            env (CADEMI_API_KEY)
lang            en-US                                          env (LANG)
color           auto (on in a terminal)                        default
auto_update     on                                             default
update_channel  stable                                         default
update_url      https://cli.cademi.dev                         default
listen_secret   ephemeral per run                              unset
version         0.1.4                                          build
api_release     3.4.5                                          build
platform        darwin/arm64                                   build
executable      /Users/you/.cademi/bin/cademi                  build
install_method  script                                         build
SettingMeaning
config_dirDirectory of the configuration file and the update state.
profileProfile in use.
base_urlPlatform URL of the requests.
auth_modehuman (OAuth plus credential) or key (credential only).
credentialWhether the credential secret is available, and the credential ID.
environmentproduction or sandbox, as saved in the profile. Shown only for saved profiles, and not when CADEMI_API_KEY is set.
langLanguage requested for API messages.
colorWhether the CLI uses colors.
auto_update, update_channel, update_urlAutomatic updates, their channel, and where releases are downloaded from.
listen_secretWhere the signing secret of cademi listen comes from.
version, api_release, platform, executable, install_methodThe build of the CLI and where it is installed.

The source is one of flag, env (with the variable name), config (the configuration file), profile, keychain, build, default, or unset.

cademi bug reuses these settings: it opens a GitHub issue with them already filled in, without config_dir and executable, so you can report a bug in the CLI without copying them by hand. See Report a problem.

Precedence

When a setting can come from several places, the first one found wins:

  1. A command-line flag, such as --profile or --base-url.
  2. An environment variable, such as CADEMI_PROFILE or CADEMI_BASE_URL.
  3. The configuration file or the active profile.
  4. The built-in default.

CADEMI_API_KEY is the exception: when it is set, it replaces the credentials of every profile (Authentication). The platform URL still follows the order above.

Environment variables

VariableEffect
CADEMI_API_KEYCredential secret for autonomous mode. Takes precedence over every profile, and the keychain is not used.
CADEMI_PROFILEProfile to use when the command has no --profile.
CADEMI_BASE_URLPlatform URL, overriding the profile. --base-url takes precedence.
CADEMI_CONFIG_DIRConfiguration directory. Defaults to cademi inside the system configuration directory: ~/Library/Application Support/cademi on macOS, $XDG_CONFIG_HOME/cademi or ~/.config/cademi on Linux, and %AppData%\cademi on Windows.
CADEMI_LANGLanguage of API messages: pt, en, es, or fr, with or without a region (pt_BR.UTF-8 works). When it is not set, the CLI reads LC_ALL, LC_MESSAGES, and LANG, in that order, and uses the first one that is set. If that value is not one of these languages, the CLI sends no language preference and the API answers in en-US.
CADEMI_LISTEN_SECRETSigning secret of cademi listen --forward-to, instead of the one saved in the profile.
CADEMI_DISABLE_AUTOUPDATEAny value turns off automatic updates.
CIAny value turns off automatic updates.
CADEMI_UPDATE_URLBase URL of a mirror for cademi update and automatic updates. Defaults to https://cli.cademi.dev. Signatures are verified the same way.
NO_COLORAny value turns off colors. TERM=dumb has the same effect.

The install scripts read their own variables, listed in Installation.

cademi doctor

cademi doctor
cademi doctor --json

cademi doctor runs a series of checks and prints one line per check, marked ✓ (ok), ! (warning), or ✗ (failure):

CheckWhat it verifies
configThe configuration file can be read, and how many profiles it has.
profileA profile or CADEMI_API_KEY is available, and the mode in use.
keychainThe profile's secrets can be read from the keychain.
networkThe platform URL is reachable, with the latency and TLS version.
clockThe local clock is within 1 minute of the server's. A larger difference is a warning, because OAuth tokens and signatures may fail.
oauthIn human mode, the authorization server metadata is valid.
credentialThe credential is accepted, with its ID, name, environment, and status.
human modeIn human mode, the administrator behind the calls.
api releaseThe server's API release compared with the release the CLI was built for. A newer server is a warning: update the CLI, and use cademi api for new operations in the meantime. An older server is also a warning, because some commands may not exist on it yet. A different major version is a failure.
deprecationsShown as a warning only when the API announces deprecated operations, with how many there are. See them with cademi capabilities get --jq .deprecations.

A failed check that prevents the next ones, such as a missing profile or an unreachable platform, ends the run. The command exits with code 1 when any check fails. With --json, it prints an array of objects with name, status (ok, warn, or fail), and detail.

On a machine without credentials:

✓ config         /Users/you/Library/Application Support/cademi/config.toml (0 profiles)
✗ profile        no profile configured: run `cademi auth login` or set CADEMI_API_KEY
Error: some checks failed

Debugging requests

--debug logs every HTTP request to standard error: method, URL, status code, duration, and request_id. Credentials and tokens are never logged. Include the request_id when you contact Cademí support about a call.

cademi --debug products list

On this page