Build agents are machines that run your builds. The teamcity agent command group lets you list and inspect agents, enable or disable them, manage authorization, execute remote commands, open interactive shell sessions, and request reboots.
Listing agents
View all registered build agents:
teamcity agent list
Filtering
# Only connected agents
teamcity agent list --connected
# Only enabled agents
teamcity agent list --enabled
# Only authorized agents
teamcity agent list --authorized
# Agents in a specific pool
teamcity agent list --pool Default
# Combine filters
teamcity agent list --connected --enabled --pool Default
Limit results and output as JSON:
teamcity agent list --limit 20
teamcity agent list --json
teamcity agent list --json=id,name,connected,enabled,pool.name
agent list flags
Flag
Description
--connected
Show only connected agents
--enabled
Show only enabled agents
--authorized
Show only authorized agents
-p, --pool
Filter by agent pool name
-n, --limit
Maximum number of agents to display
--json
Output as JSON. Use --json= to list available fields, --json=f1,f2 for specific fields.
Open an interactive terminal session to a build agent:
teamcity agent term 1
teamcity agent term Agent-Linux-01
This establishes a WebSocket connection to the agent and provides a shell where you can run commands directly on the agent machine. The session ends when you type exit or press Ctrl+D.