zeabur-deploy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zeabur Deploy

Zeabur 部署

Always use
npx zeabur@latest
to invoke Zeabur CLI.
Never use
zeabur
directly or any other installation method. If
npx
is not available, install Node.js first.
始终使用
npx zeabur@latest
来调用 Zeabur CLI。
切勿直接使用
zeabur
或其他任何安装方式。如果
npx
不可用,请先安装 Node.js。

Prerequisites — Identify the Target Project

前提条件 — 确定目标项目

Before using this skill, you must first determine which Zeabur project to deploy to. If neither the conversation history nor project files mention a project, run:
bash
npx zeabur@latest project list -i=false --json
  • When projects exist, ask the user which one to use.
  • If the list is empty, or the user wants to create a new project, you MUST invoke the
    zeabur-project-create
    skill
    . Do NOT run
    project create
    CLI commands directly — the skill handles region selection via server list, which is required.
Do not proceed with deployment until the target project is confirmed.
在使用此技能之前,必须先确定要部署到哪个Zeabur项目。如果对话历史和项目文件均未提及项目,请运行:
bash
npx zeabur@latest project list -i=false --json
  • 当存在项目时,请询问用户要使用哪一个。
  • 如果列表为空,或者用户想要创建新项目,必须调用
    zeabur-project-create
    技能
    。请勿直接运行
    project create
    CLI 命令——该技能会通过服务器列表处理区域选择,这是必需的步骤。
在确认目标项目之前,请勿继续部署操作。

Deploying to a Specific Dedicated Server

部署到特定专属服务器

If the user asks to deploy to a specific server (e.g. "deploy to my AWS Tokyo server"), do NOT SSH into the server. Zeabur dedicated servers are managed via the platform — you deploy services through the Zeabur CLI, not by manually placing files on the machine.
To find the project bound to a server:
  1. Get the server ID from
    npx zeabur@latest server list -i=false
    (or from conversation context).
  2. In the
    project list --json
    output, look for a project whose
    Region.ID
    matches
    server-<server-id>
    .
  3. If a matching project exists, use its project ID to deploy.
  4. If no matching project exists, invoke the
    zeabur-project-create
    skill
    to create one on that server.
如果用户要求部署到特定服务器(例如“部署到我的AWS东京服务器”),请勿SSH登录到该服务器。Zeabur专属服务器通过平台进行管理——需通过Zeabur CLI部署服务,而非手动将文件放置到机器上。
查找绑定到服务器的项目步骤:
  1. npx zeabur@latest server list -i=false
    (或对话上下文)获取服务器ID。
  2. project list --json
    的输出中,查找
    Region.ID
    server-<server-id>
    匹配的项目。
  3. 如果存在匹配项目,使用其项目ID进行部署。
  4. 如果没有匹配项目,调用
    zeabur-project-create
    技能
    在该服务器上创建一个项目。

Choosing a Deploy Method

选择部署方式

Zeabur supports two ways to deploy a project:
MethodWhen to use
Direct deploy (default)User says "deploy this project/website/app". No Git repo required. Fast and simple.
Git deployUser explicitly asks to deploy via Git/GitHub, or wants CI/CD with automatic redeploy on push.
Default to direct deploy unless the user specifically requests Git-based deployment.
Zeabur支持两种项目部署方式:
方式使用场景
直接部署(默认)用户说“部署这个项目/网站/应用”。无需Git仓库。快捷简单。
Git部署用户明确要求通过Git/GitHub部署,或需要CI/CD以实现推送时自动重新部署。
默认采用直接部署,除非用户特别要求基于Git的部署。

Direct Deploy (Default)

直接部署(默认)

Deploy the current local directory to Zeabur with one command.
使用一条命令将当前本地目录部署到Zeabur。

Flags

标志

FlagRequiredDescription
--project-id
Yes (non-interactive)Project ID to deploy on
--json
RecommendedOutput in JSON format
--name
NoService name (defaults to directory name)
--service-id
NoService ID to redeploy on (omit to create new service)
--environment-id
NoEnvironment ID (defaults to first environment)
Note: Do NOT use
--create
,
-r
, or
--region
flags with deploy commands. If the user needs to create a new project or select a region, use the
zeabur-project-create
skill first.
标志是否必需描述
--project-id
是(非交互模式)要部署到的项目ID
--json
推荐以JSON格式输出
--name
服务名称(默认使用目录名称)
--service-id
要重新部署的服务ID(省略则创建新服务)
--environment-id
环境ID(默认使用第一个环境)
注意: 请勿在部署命令中使用
--create
-r
--region
标志。如果用户需要创建新项目或选择区域,请先使用
zeabur-project-create
技能。

First Deploy

首次部署

When deploying for the first time, omit
--service-id
— a new service is created automatically:
bash
npx zeabur@latest deploy --project-id <project-id> --json
The response includes a
service_id
. You MUST save this
service_id
for all subsequent deploys.
Write it to the current project's
CLAUDE.md
immediately:
markdown
undefined
首次部署时,省略
--service-id
——系统会自动创建新服务:
bash
npx zeabur@latest deploy --project-id <project-id> --json
响应中包含一个
service_id
必须保存此
service_id
用于后续所有部署操作。
立即将其写入当前项目的
CLAUDE.md
markdown
undefined

Zeabur Deployment

Zeabur Deployment

  • Project ID: <project-id>
  • Service ID: <service-id>
undefined
  • Project ID: <project-id>
  • Service ID: <service-id>
undefined

Redeploy (Update Existing Service)

重新部署(更新现有服务)

IMPORTANT: When redeploying code changes, you MUST pass
--service-id
to update the existing service. Omitting
--service-id
creates a NEW duplicate service every time.
bash
npx zeabur@latest deploy --project-id <project-id> --service-id <service-id> --json
If no project exists yet, invoke the
zeabur-project-create
skill
(do not run CLI commands directly).
重要提示:重新部署代码变更时,必须传入
--service-id
以更新现有服务。省略
--service-id
每次都会创建一个新的重复服务。
bash
npx zeabur@latest deploy --project-id <project-id> --service-id <service-id> --json
如果尚未存在项目,调用
zeabur-project-create
技能
(请勿直接运行CLI命令)。

Git Deploy (On User Request)

Git部署(用户请求时)

If the user explicitly wants Git-based deployment (e.g. for CI/CD, auto-redeploy on push):
  1. First, ensure the code is pushed to a GitHub repository.
  2. Deploy via CLI:
bash
undefined
如果用户明确希望使用基于Git的部署(例如用于CI/CD、推送时自动重新部署):
  1. 首先,确保代码已推送到GitHub仓库。
  2. 通过CLI部署:
bash
undefined

Non-interactive mode — required parameters only

非交互模式 — 仅需必填参数

npx zeabur@latest service deploy --json -i=false
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>
npx zeabur@latest service deploy --json -i=false
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>

With optional service name

带可选服务名称

npx zeabur@latest service deploy --json -i=false
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>
--name "<service-name>"
undefined
npx zeabur@latest service deploy --json -i=false
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>
--name "<service-name>"
undefined

Git Deploy Flags

Git部署标志

FlagRequiredDescription
--template GIT
YesSpecifies Git-based deployment
--project-id
Non-interactiveProject ID (interactive mode will prompt)
--repo-id
Non-interactiveGitHub repository ID
--branch-name
Non-interactiveGit branch to deploy from
--name
NoService name (defaults to repo name)
--keyword
NoKeyword to search GitHub repos (interactive mode)
标志是否必需描述
--template GIT
指定基于Git的部署
--project-id
非交互模式必需项目ID(交互模式会提示)
--repo-id
非交互模式必需GitHub仓库ID
--branch-name
非交互模式必需要部署的Git分支
--name
服务名称(默认使用仓库名称)
--keyword
用于搜索GitHub仓库的关键词(交互模式)

Git Deploy Workflow

Git部署流程

Non-interactive (fully automated):
bash
undefined
非交互模式(完全自动化):
bash
undefined

1. Push code to GitHub

1. 将代码推送到GitHub

git init && git add . && git commit -m "Initial commit" gh repo create my-app --public --source=. --push
git init && git add . && git commit -m "Initial commit" gh repo create my-app --public --source=. --push

2. Get GitHub repo ID (Zeabur uses GitHub's numeric repo ID)

2. 获取GitHub仓库ID(Zeabur使用GitHub的数字仓库ID)

REPO_ID=$(gh api repos/OWNER/my-app --jq .id)
REPO_ID=$(gh api repos/OWNER/my-app --jq .id)

3. Deploy from GitHub (PROJECT_ID must be known beforehand — see Prerequisites)

3. 从GitHub部署(PROJECT_ID必须预先知晓 — 请参见前提条件)

npx zeabur@latest service deploy --json -i=false
--project-id $PROJECT_ID
--template GIT
--repo-id $REPO_ID
--branch-name main

After deployment, Zeabur will auto-redeploy on every push to the selected branch.

Only guide the user through this flow when they specifically ask for Git-based deployment.
npx zeabur@latest service deploy --json -i=false
--project-id $PROJECT_ID
--template GIT
--repo-id $REPO_ID
--branch-name main

部署完成后,Zeabur会在每次推送到选定分支时自动重新部署。

仅当用户明确要求基于Git的部署时,才引导用户完成此流程。

Tips

提示

  • Direct deploy only requires
    --project-id
    — a new service is created automatically. No Git history or GitHub account required.
  • For static sites, Zeabur auto-detects and serves them correctly.
  • Always save both Project ID and Service ID after first deploy. This prevents duplicate services on redeploy.
  • After deployment, use the
    zeabur-deployment-logs
    skill to check build and runtime logs.
  • 直接部署仅需
    --project-id
    ——会自动创建新服务。无需Git历史或GitHub账户。
  • 对于静态站点,Zeabur会自动检测并正确提供服务。
  • 首次部署后务必保存项目ID和服务ID。这可防止重新部署时创建重复服务。
  • 部署完成后,使用
    zeabur-deployment-logs
    技能查看构建和运行时日志。