AgentSkillsCN

zeabur-template-deploy

当您通过 CLI 部署 Zeabur 模板时,可选用此功能。当您在非交互模式下自动执行模板部署时,亦可选用此功能。

SKILL.md
--- frontmatter
name: zeabur-template-deploy
description: Use when deploying Zeabur templates via CLI. Use when automating template deployments in non-interactive mode.

Zeabur Template Deploy

Deploy Zeabur templates via CLI. Always use non-interactive mode (-i=false) in CLI automation.

Basic Usage

bash
# Non-interactive mode (required for CLI automation)
npx zeabur@latest template deploy -i=false \
  -f template.yaml \
  --project-id <project-id> \
  --var KEY1=value1 \
  --var KEY2=value2

Flags

FlagDescription
-f, --fileTemplate file (local path or URL)
--project-idProject ID to deploy on
--varTemplate variables (repeatable, e.g. --var KEY=value)
--skip-validationSkip template validation
-i=falseNon-interactive mode (always use this)

Non-Interactive Mode

When using -i=false, all required template variables must be provided via --var flags.

If variables are missing, CLI shows helpful error:

code
Error: missing required variables in non-interactive mode:
  --var PUBLIC_DOMAIN=<value>  (Enter your domain prefix)
  --var DB_NAME=<value>  (Database name)

Examples

Deploy with Variables

bash
npx zeabur@latest template deploy -i=false \
  -f https://example.com/template.yaml \
  --project-id abc123 \
  --var PUBLIC_DOMAIN=myapp \
  --var ADMIN_EMAIL=admin@example.com

Deploy Local File

bash
npx zeabur@latest template deploy -i=false \
  -f zeabur-template-myapp.yaml \
  --project-id abc123 \
  --var PUBLIC_DOMAIN=myapp

Finding Required Variables

Template variables are defined in spec.variables section of the YAML:

yaml
spec:
  variables:
    - key: PUBLIC_DOMAIN
      type: DOMAIN
      name: Domain
      description: Enter your domain prefix
    - key: DB_NAME
      type: STRING
      name: Database Name
      description: Database name

Common Issues

IssueSolution
Interactive prompt hangsAlways use -i=false with --project-id and --var flags
Missing variables errorAdd all required --var flags
Variable with ${REF}Use literal value or set in Dashboard after deploy
DOMAIN type validationDomain availability checked automatically