Skip to content

Environment variables

The leaf CLI respects the following environment variables for configuration, authentication, and execution control.

Provides a personal access token or scoped API key for authentication.

  • Usage: Continuous integration (CI/CD) pipelines, scripts, and automated agents.
  • Precedence: When LEAF_TOKEN is set, leaf uses it directly and skips reading credentials from ~/.config/leaf/credentials.json.
  • Example:
    Terminal window
    export LEAF_TOKEN="leaf_pat_your_api_key_here"
    leaf deploy --yes

Overrides the default API endpoint URL.

  • Default: https://api.leafcloud.in
  • CLI Flag: --api <URL>
  • Example:
    Terminal window
    export LEAF_API="https://api.leafcloud.in"

Disables the LeafCloud ASCII banner when set to 1.

  • Default: Unset (banner displayed on interactive version checks and first run).
  • Example:
    Terminal window
    export LEAF_NO_BANNER=1

Automatically recognized by leaf. When set in continuous integration platforms (such as GitHub Actions, GitLab CI, or CircleCI), the CLI automatically suppresses the decorative terminal banner.

  • XDG_CONFIG_HOME: Overrides the base configuration directory (defaults to ~/.config). Credentials are stored in $XDG_CONFIG_HOME/leaf/credentials.json.
  • HOSTNAME: Used during leaf login to name the device session (e.g., leaf on workstation). Defaults to computer if unset.