zeabur-deploy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZeabur Deploy
Zeabur 部署
Always useto invoke Zeabur CLI. Never usenpx zeabur@latestdirectly or any other installation method. Ifzeaburis not available, install Node.js first.npx
始终使用来调用 Zeabur CLI。 切勿直接使用npx zeabur@latest或其他任何安装方式。如果zeabur不可用,请先安装 Node.js。npx
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 skill. Do NOT run
zeabur-project-createCLI commands directly — the skill handles region selection via server list, which is required.project create
Do not proceed with deployment until the target project is confirmed.
在使用此技能之前,必须先确定要部署到哪个Zeabur项目。如果对话历史和项目文件均未提及项目,请运行:
bash
npx zeabur@latest project list -i=false --json- 当存在项目时,请询问用户要使用哪一个。
- 如果列表为空,或者用户想要创建新项目,必须调用 技能。请勿直接运行
zeabur-project-createCLI 命令——该技能会通过服务器列表处理区域选择,这是必需的步骤。project create
在确认目标项目之前,请勿继续部署操作。
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:
- Get the server ID from (or from conversation context).
npx zeabur@latest server list -i=false - In the output, look for a project whose
project list --jsonmatchesRegion.ID.server-<server-id> - If a matching project exists, use its project ID to deploy.
- If no matching project exists, invoke the skill to create one on that server.
zeabur-project-create
如果用户要求部署到特定服务器(例如“部署到我的AWS东京服务器”),请勿SSH登录到该服务器。Zeabur专属服务器通过平台进行管理——需通过Zeabur CLI部署服务,而非手动将文件放置到机器上。
查找绑定到服务器的项目步骤:
- 从 (或对话上下文)获取服务器ID。
npx zeabur@latest server list -i=false - 在 的输出中,查找
project list --json与Region.ID匹配的项目。server-<server-id> - 如果存在匹配项目,使用其项目ID进行部署。
- 如果没有匹配项目,调用 技能在该服务器上创建一个项目。
zeabur-project-create
Choosing a Deploy Method
选择部署方式
Zeabur supports two ways to deploy a project:
| Method | When to use |
|---|---|
| Direct deploy (default) | User says "deploy this project/website/app". No Git repo required. Fast and simple. |
| Git deploy | User 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
标志
| Flag | Required | Description |
|---|---|---|
| Yes (non-interactive) | Project ID to deploy on |
| Recommended | Output in JSON format |
| No | Service name (defaults to directory name) |
| No | Service ID to redeploy on (omit to create new service) |
| No | Environment ID (defaults to first environment) |
Note: Do NOT use,--create, or-rflags with deploy commands. If the user needs to create a new project or select a region, use the--regionskill first.zeabur-project-create
| 标志 | 是否必需 | 描述 |
|---|---|---|
| 是(非交互模式) | 要部署到的项目ID |
| 推荐 | 以JSON格式输出 |
| 否 | 服务名称(默认使用目录名称) |
| 否 | 要重新部署的服务ID(省略则创建新服务) |
| 否 | 环境ID(默认使用第一个环境) |
注意: 请勿在部署命令中使用、--create或-r标志。如果用户需要创建新项目或选择区域,请先使用--region技能。zeabur-project-create
First Deploy
首次部署
When deploying for the first time, omit — a new service is created automatically:
--service-idbash
npx zeabur@latest deploy --project-id <project-id> --jsonThe response includes a . You MUST save this for all subsequent deploys. Write it to the current project's immediately:
service_idservice_idCLAUDE.mdmarkdown
undefined首次部署时,省略 ——系统会自动创建新服务:
--service-idbash
npx zeabur@latest deploy --project-id <project-id> --json响应中包含一个 。必须保存此 用于后续所有部署操作。 立即将其写入当前项目的 :
service_idservice_idCLAUDE.mdmarkdown
undefinedZeabur Deployment
Zeabur Deployment
- Project ID: <project-id>
- Service ID: <service-id>
undefined- Project ID: <project-id>
- Service ID: <service-id>
undefinedRedeploy (Update Existing Service)
重新部署(更新现有服务)
IMPORTANT: When redeploying code changes, you MUST pass to update the existing service. Omitting creates a NEW duplicate service every time.
--service-id--service-idbash
npx zeabur@latest deploy --project-id <project-id> --service-id <service-id> --jsonIf no project exists yet, invoke the skill (do not run CLI commands directly).
zeabur-project-create重要提示:重新部署代码变更时,必须传入 以更新现有服务。省略 每次都会创建一个新的重复服务。
--service-id--service-idbash
npx zeabur@latest deploy --project-id <project-id> --service-id <service-id> --json如果尚未存在项目,调用 技能(请勿直接运行CLI命令)。
zeabur-project-createGit Deploy (On User Request)
Git部署(用户请求时)
If the user explicitly wants Git-based deployment (e.g. for CI/CD, auto-redeploy on push):
- First, ensure the code is pushed to a GitHub repository.
- Deploy via CLI:
bash
undefined如果用户明确希望使用基于Git的部署(例如用于CI/CD、推送时自动重新部署):
- 首先,确保代码已推送到GitHub仓库。
- 通过CLI部署:
bash
undefinedNon-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>
--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>
--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>"
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>
--name "<service-name>"
undefinednpx zeabur@latest service deploy --json -i=false
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>
--name "<service-name>"
--project-id <project-id>
--template GIT
--repo-id <repo-id>
--branch-name <branch>
--name "<service-name>"
undefinedGit Deploy Flags
Git部署标志
| Flag | Required | Description |
|---|---|---|
| Yes | Specifies Git-based deployment |
| Non-interactive | Project ID (interactive mode will prompt) |
| Non-interactive | GitHub repository ID |
| Non-interactive | Git branch to deploy from |
| No | Service name (defaults to repo name) |
| No | Keyword to search GitHub repos (interactive mode) |
| 标志 | 是否必需 | 描述 |
|---|---|---|
| 是 | 指定基于Git的部署 |
| 非交互模式必需 | 项目ID(交互模式会提示) |
| 非交互模式必需 | GitHub仓库ID |
| 非交互模式必需 | 要部署的Git分支 |
| 否 | 服务名称(默认使用仓库名称) |
| 否 | 用于搜索GitHub仓库的关键词(交互模式) |
Git Deploy Workflow
Git部署流程
Non-interactive (fully automated):
bash
undefined非交互模式(完全自动化):
bash
undefined1. 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
--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
--project-id $PROJECT_ID
--template GIT
--repo-id $REPO_ID
--branch-name main
部署完成后,Zeabur会在每次推送到选定分支时自动重新部署。
仅当用户明确要求基于Git的部署时,才引导用户完成此流程。Tips
提示
- Direct deploy only requires — a new service is created automatically. No Git history or GitHub account required.
--project-id - 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 skill to check build and runtime logs.
zeabur-deployment-logs
- 直接部署仅需 ——会自动创建新服务。无需Git历史或GitHub账户。
--project-id - 对于静态站点,Zeabur会自动检测并正确提供服务。
- 首次部署后务必保存项目ID和服务ID。这可防止重新部署时创建重复服务。
- 部署完成后,使用 技能查看构建和运行时日志。
zeabur-deployment-logs