Skip to content
ghqc

Environment Variables

This page lists every environment variable that ghqc reads to configure its behavior. Variables are grouped by functional area. Where a variable participates in a resolution chain, the full order is shown.

These variables control where ghqc looks for its configuration directory. They are evaluated in this order — the first one present wins:

  1. --config-dir CLI flag
  2. GHQC_CONFIG_REPO
  3. GHQC_CONFIG_DIR
  4. Default XDG path ($XDG_DATA_HOME/ghqc/config)
VariableTypeDefault
GHQC_CONFIG_REPOGit HTTPS URL
GHQC_CONFIG_DIRFilesystem path
XDG_DATA_HOMEFilesystem path~/.local/share

A Git repository URL for the configuration repo. When set, ghqc derives a local path from the repo name rather than using the URL directly:

$XDG_DATA_HOME/ghqc/<repo-name>

The web UI uses this variable to pre-fill the configuration setup form.

An explicit local directory path to use as the configuration directory. Useful when the configuration lives in a shared location (such as an HPC) or outside the XDG data directory.

GHQC_CONFIG_DIR has lower precedence than GHQC_CONFIG_REPO. If both are set, GHQC_CONFIG_REPO wins.

The base directory used when ghqc builds its default or repo-derived configuration path. If not set, ghqc falls back to the platform default (~/.local/share on Linux and macOS).

VariableTypeDefault
GHQC_CACHE_TIMEOUTPositive integer (seconds)3600
XDG_CACHE_HOMEFilesystem path~/.cache

The time-to-live for entries in ghqc’s persistent disk cache, in seconds. Cached GitHub data older than this threshold is re-fetched on the next access.

Invalid, zero, or negative values fall back to the default of 3600 (1 hour).

The base directory where ghqc stores its on-disk cache. If not set, ghqc falls back to the platform default (~/.cache on Linux and macOS).

VariableTypeDefault
GHQC_UI_REFRESH_RATEPositive integer (seconds)15

How often the web UI refreshes repository state, in seconds.

This variable is the middle step in a three-level resolution chain:

  1. options.yaml ui_repo_refresh_rate_seconds
  2. GHQC_UI_REFRESH_RATE
  3. Built-in default 15

Invalid, zero, and negative values fall back to the next source.

VariableTypeDefault
GHQC_RECORD_DATEDate stringCurrent local date

Overrides the date embedded in generated QC records. When not set, ghqc uses the current local date formatted as Month Day, Year.

Useful for generating backdated records or for reproducible output in scripts and tests.

These variables are part of the credential resolution chain. ghqc evaluates sources in this order, using the first valid token found:

  1. ghqc auth store
  2. GITHUB_TOKEN
  3. Active gh CLI session
  4. GitHub CLI stored credentials ($GH_CONFIG_DIR/hosts.yml)
  5. Git credential helper (git credential fill)
  6. .netrc file
VariableTypeDefault
GITHUB_TOKENGitHub token
GH_CONFIG_DIRFilesystem path~/.config/gh

A GitHub personal access token used for API authentication. ghqc validates that the value is a recognized GitHub token format before accepting it.

The directory where the GitHub CLI stores its configuration, including saved auth tokens. When set, ghqc reads hosts.yml from this directory as a credential source. If not set, ghqc falls back to the default GitHub CLI config location (~/.config/gh on Linux and macOS).

VariableTypeDefault
GHQC_LOG_LEVELLog levelTRACE

Minimum log level for the ghqc R package. Accepted values: TRACE, DEBUG, INFO, WARN, ERROR.