AgentSkillsCN

zeabur-deployment-logs

当查看服务日志时,若因提示需提供 env-id 而导致失败,可选用此功能。同样适用于检查运行时日志或构建日志时的情况。

SKILL.md
--- frontmatter
name: zeabur-deployment-logs
description: Use when viewing service logs fails with env-id required error. Use when checking runtime or build logs.

Zeabur Deployment Logs

Important: Always Use --env-id

deployment log often requires --env-id even for single-environment projects (unlike variable list which auto-selects). Always get the env-id first and pass it explicitly.

Symptom

code
ERROR: when deployment-id is not specified, env-id is required
ERROR: environment is required

Workflow

bash
# 1. Set project context
npx zeabur@latest context set project --id <project-id> -i=false -y

# 2. Get service ID
npx zeabur@latest service list -i=false

# 3. Get env-id (see methods below)

# 4. View logs with env-id
npx zeabur@latest deployment log --service-id <service-id> --env-id <env-id> -t runtime -i=false 2>&1 | tail -50

Get env-id

bash
# Method 1: From variable list output
npx zeabur@latest variable list --id <service-id> -i=false
# Shows: "Only one environment... select <production> automatically"

# Method 2: Extract from error message
ENV_ID=$(npx zeabur@latest deployment log --service-id <service-id> 2>&1 | grep -o "environment-[a-f0-9]*" | head -1 | cut -d'-' -f2)

View logs with env-id

bash
# Runtime logs
npx zeabur@latest deployment log \
  --service-id <id> \
  --env-id <env-id> \
  -t runtime \
  -i=false

# Build logs
npx zeabur@latest deployment log \
  --service-id <id> \
  --env-id <env-id> \
  -t build \
  -i=false

# Watch logs (live tail)
npx zeabur@latest deployment log \
  --service-id <id> \
  --env-id <env-id> \
  -w \
  -i=false

Tips

TipDetails
Use tail -50Logs can be verbose, pipe to tail for recent entries
Use grep to filter... 2>&1 | grep -i "error|started|ready"
Note singulardeployment log not deployment logs
Check service statusLook for SERVER STARTED, Ready, listening