hci Environment

The hci command makes use of a number of environment variables and files.

Files

~/.config/hercules-ci/credentials.json

Contains the Hercules CI API token.

It can contain multiple tokens: one per HERCULES_CI_API_BASE_URL.

This file is written by hci login.

It is ignored when HERCULES_CI_API_TOKEN is set.

~/.config/hercules-ci/secrets/<forge>/<owner>/secrets.json

A secrets.json file for use by hci effect run.

<forge> is typically github.

<owner> is the name of your organization as it appears in URLs, or for personal account if you’ve installed Hercules CI on your personal account.

The hci secret init-local command will report the location of the file and does not reset its contents.

An alternate location can be specified with HERCULES_CI_SECRETS_JSON.

Environment variables

HERCULES_CI_API_BASE_URL

The base URL of the Hercules CI API, for Hercules CI Enterprise users. This variable is also available in effects. See apiBaseUrl.

HERCULES_CI_API_TOKEN

An alternative way of passing an API token to the Hercules CI API for authentication.

This overrides the applicable token in ~/.config/hercules-ci/credentials.json if present.

By default, hci will suggest to authenticate with hci login instead, which uses that file.

HERCULES_CI_SECRETS_JSON

The location of a local secrets.json file for use with hci effect run.

When unset, a default value is derived from the working directory repository upstream owner.

XDG_CONFIG_HOME

Default: ~/.config. Affects the location of Files. All documentation will assume the default value.