jenkins-cli

⚙️ Configuration

Multi-server profiles, the config file, precedence rules, and the full environment variable reference.

🗂️ Config File & Multi-Server

Location: ~/.config/jenkins-cli/config.json (respects $XDG_CONFIG_HOME).

# Primary server
jenkins config set --url https://ci.example.com --user alice --token $TOKEN

# Multiple servers
jenkins config add-server prod    --url https://ci.example.com        --user alice --token $TOKEN_PROD
jenkins config add-server staging --url https://ci.staging.example.com --user alice --token $TOKEN_STG
jenkins config use staging
jenkins config list-servers

🪜 Precedence

Highest → lowest: CLI flags > Environment variables > Config file.

🛟 Salvage Logic

The config loader automatically:

  • Truncates trailing garbage past the final } if the file is partially corrupted.
  • Normalises markdown links [text](https://github.com/kud/jenkins-cli/blob/HEAD/docs/url)url.

🌱 Environment Variables

VariablePurposeNotes
JENKINS_URLBase URL overrideSame as --url
JENKINS_USERUsername override
JENKINS_TOKENToken override
JENKINS_SERVERServer aliasChosen from config file
JENKINS_TIMEOUTRequest timeout (ms)Default 15000
JENKINS_RETRIESRetry attempts (0–9)Default 0
JENKINS_CLI_NO_ICONSDisable Unicode/emojiPlain text tokens
JENKINS_CLI_PLAINSame as above
JENKINS_CLI_ASCII_SCROLLBARForce ASCII scrollbarUsually auto-chosen

On this page