Configuration
This page describes the config command, configuration file format, environment variables, and shell completion setup for TeamCity CLI.
Managing configuration with teamcity config
The config command lets you view and modify CLI settings without editing the YAML file directly.
List all settings
Get a setting
Set a setting
Available keys
Key | Scope | Description |
|---|---|---|
| Global | The default TeamCity server URL. |
| Per-server | Enable guest authentication (no token needed). Use |
| Per-server | Enable read-only mode (blocks all write operations). Use |
| Per-server | Token expiry timestamp (RFC 3339). Normally set by |
| Global | Enable or disable anonymous usage statistics. Default: |
Authentication fields (token, user) are managed by teamcity auth login/teamcity auth logout and cannot be set via config set.
Configuration file
TeamCity CLI stores its configuration in a YAML file at ~/.config/tc/config.yml. This file is created automatically when you run teamcity auth login.
A typical configuration file looks like this:
Configuration fields
Field | Description |
|---|---|
| The server URL used when no |
| A map of server URLs to their settings. Each entry stores the |
| A map of alias names to their expansions. See Aliases for details. |
Environment variables
Environment variables override configuration file settings and are the recommended way to configure the CLI in CI/CD pipelines.
Variable | Description |
|---|---|
| TeamCity server URL. Takes precedence over |
| Access token for authentication. Takes precedence over the keyring and config file token. |
| Set to |
| Set to |
| Path to the Kotlin DSL directory. Overrides automatic detection of |
| Disable colored output. Follows the NO_COLOR standard. |
| App-specific alternative to |
| Set to |
| Add an HTTP header to every outgoing request. The suffix becomes the header name with underscores converted to hyphens, canonical-cased: |
| Set to |
| Set to |
Examples:
PowerShell:
CMD:
Setting TERM=dumb also disables colored output. Color is automatically disabled when output is not a terminal (for example, when piping to another command).
Extra HTTP headers (corporate proxies)
If your TeamCity server sits behind an authenticating proxy such as Cloudflare Access or Google IAP, the proxy needs its own credentials on every request. TEAMCITY_HEADER_* lets you supply them via env vars without editing the config file. The CLI applies them to every API call, the auth login probe, the PKCE exchange, and the agent terminal WebSocket — anywhere a request might pass through the proxy.
Header names follow these rules:
Suffix is uppercased after the prefix; underscores become hyphens; the result is canonical-cased.
TEAMCITY_HEADER_CF_ACCESS_CLIENT_ID=value→Cf-Access-Client-Id: value.Empty values are skipped. Values containing CR/LF/NUL are dropped.
Values are redacted in
--verboseoutput, regardless of header name.
Cloudflare Access service token
Google IAP
IAP requires a fresh ID token signed by your service account. A small wrapper keeps the token current:
For repository-scoped configuration, set these in direnv .envrc so they're only present when you cd into the project directory.
Global flags
These flags are available on every command:
Flag | Description |
|---|---|
| Show help for the command. |
| Show the CLI version. |
| Disable colored output. |
| Suppress non-essential output. Mutually exclusive with |
| Show detailed output, including debug information. Mutually exclusive with |
| Disable interactive prompts. The CLI uses sensible defaults when a prompt would otherwise appear. |
Shell completion
TeamCity CLI supports tab completion for Bash, Zsh, Fish, and PowerShell. Completion covers commands, subcommands, flags, and in some cases values such as project and job IDs.
If you do not have write access to /etc/bash_completion.d/, write to a user-level location and source it from your .bashrc:
Ensure your ~/.zshrc includes compinit:
To load completion automatically, add the output to your PowerShell profile.