tilt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tilt

Tilt

First Action: Check for Errors

第一步:检查错误

Before investigating issues or verifying deployments, check resource health:
bash
undefined
在排查问题或验证部署之前,请检查资源健康状况:
bash
undefined

Find errors and pending resources (primary health check)

Find errors and pending resources (primary health check)

tilt get uiresources -o json | jq -r '.items[] | select(.status.runtimeStatus == "error" or .status.updateStatus == "error" or .status.updateStatus == "pending") | "(.metadata.name): runtime=(.status.runtimeStatus) update=(.status.updateStatus)"'
tilt get uiresources -o json | jq -r '.items[] | select(.status.runtimeStatus == "error" or .status.updateStatus == "error" or .status.updateStatus == "pending") | "(.metadata.name): runtime=(.status.runtimeStatus) update=(.status.updateStatus)"'

Quick status overview

Quick status overview

tilt get uiresources -o json | jq '[.items[].status.updateStatus] | group_by(.) | map({status: .[0], count: length})'
undefined
tilt get uiresources -o json | jq '[.items[].status.updateStatus] | group_by(.) | map({status: .[0], count: length})'
undefined

Non-Default Ports

非默认端口

When Tilt runs on a non-default port, add
--port
:
bash
tilt get uiresources --port 37035
tilt logs <resource> --port 37035
当Tilt运行在非默认端口时,添加
--port
参数:
bash
tilt get uiresources --port 37035
tilt logs <resource> --port 37035

Resource Status

资源状态

bash
undefined
bash
undefined

All resources with status

All resources with status

tilt get uiresources -o json | jq '.items[] | {name: .metadata.name, runtime: .status.runtimeStatus, update: .status.updateStatus}'
tilt get uiresources -o json | jq '.items[] | {name: .metadata.name, runtime: .status.runtimeStatus, update: .status.updateStatus}'

Single resource detail

Single resource detail

tilt get uiresource/<name> -o json
tilt get uiresource/<name> -o json

Wait for ready

Wait for ready

tilt wait --for=condition=Ready uiresource/<name> --timeout=120s

**Status values:**
- RuntimeStatus: `ok`, `error`, `pending`, `none`, `not_applicable`
- UpdateStatus: `ok`, `error`, `pending`, `in_progress`, `none`, `not_applicable`
tilt wait --for=condition=Ready uiresource/<name> --timeout=120s

**状态值说明:**
- RuntimeStatus: `ok`, `error`, `pending`, `none`, `not_applicable`
- UpdateStatus: `ok`, `error`, `pending`, `in_progress`, `none`, `not_applicable`

Logs

日志

bash
tilt logs <resource>
tilt logs <resource> --since 5m
tilt logs <resource> --tail 100
tilt logs --json                    # JSON Lines output
bash
tilt logs <resource>
tilt logs <resource> --since 5m
tilt logs <resource> --tail 100
tilt logs --json                    # JSON Lines output

Trigger and Lifecycle

触发与生命周期

bash
tilt trigger <resource>             # Force update
tilt up                             # Start
tilt down                           # Stop and clean up
bash
tilt trigger <resource>             # 强制更新
tilt up                             # 启动
tilt down                           # 停止并清理

Running tilt up

运行tilt up

Run in tmux to survive session reloads:
bash
SESSION=$(basename $(git rev-parse --show-toplevel 2>/dev/null) || basename $PWD)

if ! tmux has-session -t "$SESSION" 2>/dev/null; then
  tmux new-session -d -s "$SESSION" -n tilt
  tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
elif ! tmux list-windows -t "$SESSION" -F '#{window_name}' | grep -q "^tilt$"; then
  tmux new-window -t "$SESSION" -n tilt
  tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
fi
在tmux中运行,以在会话重新加载后继续存活:
bash
SESSION=$(basename $(git rev-parse --show-toplevel 2>/dev/null) || basename $PWD)

if ! tmux has-session -t "$SESSION" 2>/dev/null; then
  tmux new-session -d -s "$SESSION" -n tilt
  tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
elif ! tmux list-windows -t "$SESSION" -F '#{window_name}' | grep -q "^tilt$"; then
  tmux new-window -t "$SESSION" -n tilt
  tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
fi

Critical: Never Restart for Code Changes

重要提示:代码变更时切勿重启

Tilt live-reloads automatically. Never suggest restarting
tilt up
for:
  • Tiltfile edits
  • Source code changes
  • Kubernetes manifest updates
Restart only for: Tilt version upgrades, port/host changes, crashes, cluster context switches.
Tilt会自动热重载。对于以下情况,切勿建议重启
tilt up
  • Tiltfile编辑
  • 源代码变更
  • Kubernetes清单更新
仅在以下情况时重启:Tilt版本升级、端口/主机变更、程序崩溃、集群上下文切换。

References

参考资料

  • TILTFILE_API.md - Tiltfile authoring
  • CLI_REFERENCE.md - Complete CLI with JSON patterns
  • https://docs.tilt.dev/
  • TILTFILE_API.md - Tiltfile编写指南
  • CLI_REFERENCE.md - 包含JSON模式的完整CLI参考
  • https://docs.tilt.dev/