teamcity-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TeamCity CLI (
tc
)

TeamCity CLI(
tc

Interact with TeamCity CI/CD servers using the
tc
command-line tool.
使用
tc
命令行工具与TeamCity CI/CD服务器进行交互。

Quick Start

快速开始

bash
tc auth status                    # Check authentication
tc run list --status failure      # Find failed builds
tc run log <id> --failed          # View failed build log
bash
tc auth status                    # 检查认证状态
tc run list --status failure      # 查找失败的构建
tc run log <id> --failed          # 查看失败构建的日志

Before Running Commands

运行命令前注意事项

Do not guess flags or syntax. Only use flags in the Command Reference. If unsure, run
tc <command> --help
first. If a command doesn't support what you need, fall back to
tc api /app/rest/...
.
请勿猜测参数或语法。 仅使用命令参考中列出的参数。如有疑问,请先运行
tc <command> --help
。如果某个命令无法满足你的需求,请使用
tc api /app/rest/...
作为替代方案。

Core Commands

核心命令

AreaCommands
Builds
run list
,
view
,
start
,
watch
,
log
,
cancel
,
restart
,
tests
,
changes
Artifacts
run artifacts
,
run download
Metadata
run pin/unpin
,
run tag/untag
,
run comment
Jobs
job list
,
view
,
pause/resume
,
param list/get/set/delete
Projects
project list
,
view
,
param
,
token put/get
,
settings export/status/validate
Queue
queue list
,
approve
,
remove
,
top
Agents
agent list
,
view
,
enable/disable
,
authorize
,
exec
,
term
,
reboot
,
move
Pools
pool list
,
view
,
link/unlink
API
tc api <endpoint>
— raw REST API access
领域命令
构建
run list
,
view
,
start
,
watch
,
log
,
cancel
,
restart
,
tests
,
changes
制品
run artifacts
,
run download
元数据
run pin/unpin
,
run tag/untag
,
run comment
任务
job list
,
view
,
pause/resume
,
param list/get/set/delete
项目
project list
,
view
,
param
,
token put/get
,
settings export/status/validate
队列
queue list
,
approve
,
remove
,
top
代理
agent list
,
view
,
enable/disable
,
authorize
,
exec
,
term
,
reboot
,
move
代理池
pool list
,
view
,
link/unlink
API
tc api <endpoint>
— 原生REST API访问

Quick Workflows

快速工作流

Investigate failure:
tc run list --status failure
tc run log <id> --failed
tc run tests <id> --failed
From a URL: Extract build ID from
https://host/buildConfiguration/ConfigId/12345
tc run view 12345
Start build:
tc run start <job-id> --branch <branch> --watch
Find jobs:
tc project list
tc job list --project <id>
排查失败问题:
tc run list --status failure
tc run log <id> --failed
tc run tests <id> --failed
从URL获取信息:
https://host/buildConfiguration/ConfigId/12345
中提取构建ID →
tc run view 12345
启动构建:
tc run start <job-id> --branch <branch> --watch
查找任务:
tc project list
tc job list --project <id>

References

参考资料

  • Command Reference - All commands and flags
  • Workflows - URL handling, failure investigation, artifacts, agents, and more
  • Output Formats - JSON, plain text, scripting
  • 命令参考 - 所有命令及参数
  • 工作流 - URL处理、失败排查、制品、代理等更多内容
  • 输出格式 - JSON、纯文本、脚本相关