エイリアス
エイリアスを使用すると、頻繁に使用する teamcity コマンドのカスタムショートカットを作成できます。 エイリアスは 設定ファイルに保存され、実行時に自動的に展開されます。
エイリアスの作成
teamcity alias set でエイリアスを作成します:
teamcity alias set rl 'run list'
これで、 teamcity rl は teamcity run list に拡張されます。

位置引数
位置引数には $1、 $2 などを使用します。
teamcity alias set rw 'run view $1 --web'
これで、 teamcity rw 12345 は teamcity run view 12345 --web に拡張されます。
プレースホルダーと一致しない追加の引数は、展開されたコマンドの末尾に追加されます。
シェルエイリアス
パイプ、リダイレクト、その他のシェル機能を必要とするエイリアスの場合は、拡張の前に ! を付ける、または --shell フラグを使用します。
teamcity alias set watchnotify '!teamcity run watch $1 && notify-send "Build $1 done"'
teamcity alias set faillog '!teamcity run list --status=failure --json | jq ".[].id"'
シェルエイリアスは直接展開されるのではなく、 sh を通じて評価されます。
エイリアスの一覧表示
設定されているすべてのエイリアスを表示します。
teamcity alias list
teamcity alias list --json
エイリアスの削除
エイリアスを削除します:
teamcity alias delete rl
便利なエイリアスの例
よく使われるエイリアスのコレクションを以下に示します。
クイックショートカット
teamcity alias set rl 'run list'
teamcity alias set rv 'run view $1'
teamcity alias set rw 'run view $1 --web'
teamcity alias set jl 'job list'
teamcity alias set ql 'queue list'
フィルターされた表示
teamcity alias set mine 'run list --user=@me'
teamcity alias set fails 'run list --status=failure --since=24h'
teamcity alias set running 'run list --status=running'
teamcity alias set morning 'run list --status=failure --since=12h'
ビルドワークフロー
teamcity alias set go 'run start $1 --watch'
teamcity alias set try 'run start $1 --local-changes --watch'
teamcity alias set hotfix 'run start $1 --top --clean --watch'
teamcity alias set retry 'run restart $1 --watch'
キュー管理
teamcity alias set rush 'queue top $1'
teamcity alias set ok 'queue approve $1'
エージェント操作
teamcity alias set maint 'agent disable $1'
teamcity alias set unmaint 'agent enable $1'
API ショートカット
teamcity alias set whoami "api '/app/rest/users/current'"
外部ツールを使用したシェルエイリアス
teamcity alias set watchnotify '!teamcity run watch $1 && notify-send "Build $1 done"'
teamcity alias set faillog '!teamcity run list --status=failure --json | jq ".[].id"'
ストレージ
エイリアスは ~/.config/tc/config.yml の aliases セクションに保存されます。
aliases:
rl: 'run list'
rw: 'run view $1 --web'
mine: 'run list --user=@me'
fails: 'run list --status=failure --since=24h'
このファイルを直接編集することもできます。
2026 年 9 月 11 日