TeamCity CLI (teamcity)
Quick Start
Do not guess flags or syntax. Use the command reference [blocked] or teamcity <command> --help. Builds are runs (teamcity run); build configurations are jobs (teamcity job). Never use --count — use --limit (or -n).
Gotchas
- Composite builds have empty logs — drill into child builds for the actual failure.
- Build chains fail bottom-up — deepest failed dependency is the root cause. Use
teamcity run tree <id>. --local-changesexcludes Kotlin DSL — push.teamcity/changes before running.TEAMCITY_URLalone bypasses stored auth — set bothTEAMCITY_URLandTEAMCITY_TOKEN, or leave unset.- Logs: use
--rawand dump to a temp file. Builds: use--watchwhen starting them. - VCS triggers aren't always wired up — after pushing a fix you may need to start builds manually.
pipeline pushdoes not validate — alwaysteamcity pipeline validatefirst.- GitHub VCS roots: use a GitHub App connection. Never paste a PAT via
--auth password. See workflows [blocked].
Core Commands
Quick Workflows
See Workflows [blocked] for full details on each.
- Investigate failure:
run list --status failure→run log <id> --failed --raw→run tests <id> --failed - Debug build chain:
run tree <id>→ drill to deepest failed child - Fix and verify: edit → push →
run start --watch(use--local-changesfor personal builds) - Pipeline lifecycle:
pipeline pull <id>→ edit →pipeline validate→pipeline push <id>,pipeline schemato get the actual schema from the server - GitHub VCS:
connection create github-app→connection authorize→ install App on repo →vcs create --auth token --connection-id <id> - Docker registry:
echo $TOKEN | connection create docker -p <id> --name X --url https://ghcr.io --username U --stdin
References
- Command reference [blocked] — all commands and flags
- Workflows [blocked] — failure investigation, build chains, connections, pipelines
- Output formats [blocked] — JSON, plain text, scripting


