zeabur-template-backup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZeabur Template Backup
Zeabur 模板备份
Always useto invoke Zeabur CLI. Never usenpx zeabur@latestdirectly or any other installation method. Ifzeaburis not available, install Node.js first.npx
Backup an online Zeabur template to the local git repository with standardized naming.
请始终使用调用Zeabur CLI。 切勿直接使用npx zeabur@latest或其他任何安装方式。如果没有zeabur,请先安装Node.js。npx
将在线Zeabur模板备份到本地Git仓库,并采用标准化命名规则。
When to Use
使用场景
- User provides a Zeabur template URL (e.g., )
https://zeabur.com/templates/85IQXQ - User asks to backup/save a Zeabur template
- User wants to create a local copy of an online Zeabur template
- 用户提供Zeabur模板URL(例如:)
https://zeabur.com/templates/85IQXQ - 用户要求备份/保存Zeabur模板
- 用户希望创建在线Zeabur模板的本地副本
Repository Location
仓库位置
The backup repository path depends on your setup. Look for a directory in the user's workspace, or ask the user where to save templates. A common default:
zeabur-template~/Documents/zeabur/zeabur-template/备份仓库的路径取决于你的配置。请在用户工作区中查找目录,或询问用户希望将模板保存到何处。常见默认路径:
zeabur-template~/Documents/zeabur/zeabur-template/Naming Convention
命名规范
{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yamlExamples:
elasticsearch-kibana/zeabur-template-elasticsearch-kibana-85IQXQ.yamldify/zeabur-template-dify-1D4DOW.yamlpostiz/zeabur-template-postiz-v2.12-X2L3BE.yaml
{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml示例:
elasticsearch-kibana/zeabur-template-elasticsearch-kibana-85IQXQ.yamldify/zeabur-template-dify-1D4DOW.yamlpostiz/zeabur-template-postiz-v2.12-X2L3BE.yaml
How to Download Template YAML
如何下载模板YAML
Zeabur templates can be directly downloaded by appending to the template URL:
.yamlhttps://zeabur.com/templates/{TEMPLATE_CODE}.yamlExample:
- Template page:
https://zeabur.com/templates/1D4DOW - YAML download:
https://zeabur.com/templates/1D4DOW.yaml
Use to download:
curlbash
curl -sL https://zeabur.com/templates/{TEMPLATE_CODE}.yaml -o output.yamlZeabur模板可通过在模板URL后追加直接下载:
.yamlhttps://zeabur.com/templates/{TEMPLATE_CODE}.yaml示例:
- 模板页面:
https://zeabur.com/templates/1D4DOW - YAML下载地址:
https://zeabur.com/templates/1D4DOW.yaml
使用命令下载:
curlbash
curl -sL https://zeabur.com/templates/{TEMPLATE_CODE}.yaml -o output.yamlStep-by-Step
步骤指南
For template YAML reference and editing, use the skill.
zeabur-template如需参考或编辑模板YAML,请使用技能。
zeabur-template1. Extract Template Code from URL
1. 从URL中提取模板代码
URL format:
https://zeabur.com/templates/{TEMPLATE_CODE}Example: → Code is
https://zeabur.com/templates/85IQXQ85IQXQURL格式:
https://zeabur.com/templates/{TEMPLATE_CODE}示例: → 代码为
https://zeabur.com/templates/85IQXQ85IQXQ2. Download YAML and Extract Template Name
2. 下载YAML并提取模板名称
bash
undefinedbash
undefinedDownload YAML
下载YAML
curl -sL https://zeabur.com/templates/{TEMPLATE_CODE}.yaml -o /tmp/template.yaml
curl -sL https://zeabur.com/templates/{TEMPLATE_CODE}.yaml -o /tmp/template.yaml
Extract template name from YAML metadata.name field
从YAML的metadata.name字段中提取模板名称
grep -A1 'metadata:' /tmp/template.yaml | grep 'name:' | head -1
undefinedgrep -A1 'metadata:' /tmp/template.yaml | grep 'name:' | head -1
undefined3. Derive Service Name
3. 生成服务名称
- Convert template name to lowercase kebab-case
- Example: "Elasticsearch Single Node with Kibana" →
elasticsearch-kibana - Keep it short and descriptive
- 将模板名称转换为小写短横线分隔格式(kebab-case)
- 示例:"Elasticsearch Single Node with Kibana" →
elasticsearch-kibana - 保持名称简短且具有描述性
4. Create Directory and Save
4. 创建目录并保存文件
bash
REPO=~/Documents/zeabur/zeabur-template # adjust to your actual pathbash
REPO=~/Documents/zeabur/zeabur-template # 根据实际路径调整Create directory
创建目录
mkdir -p $REPO/{service-name}
mkdir -p $REPO/{service-name}
Move YAML with naming pattern
按照命名规则移动YAML文件
mv /tmp/template.yaml $REPO/{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml
undefinedmv /tmp/template.yaml $REPO/{service-name}/zeabur-template-{service-name}-{TEMPLATE_CODE}.yaml
undefined5. Git Commit
5. Git提交
bash
cd $REPO
git add {service-name}/
git commit -m "feat({service-name}): add {Template Name} template"bash
cd $REPO
git add {service-name}/
git commit -m "feat({service-name}): add {Template Name} template"6. Push (if requested)
6. 推送(如果用户要求)
bash
git pushbash
git pushQuick Reference
快速参考
| Step | Action |
|---|---|
| 1 | Extract template code from URL |
| 2 | Download YAML via |
| 3 | Read template name from YAML |
| 4 | Derive kebab-case service name |
| 5 | Save to |
| 6 | Git commit with conventional format |
| 7 | Push if user requests |
| 步骤 | 操作 |
|---|---|
| 1 | 从URL中提取模板代码 |
| 2 | 通过 |
| 3 | 从YAML的 |
| 4 | 生成kebab-case格式的服务名称 |
| 5 | 保存到 |
| 6 | 使用规范格式进行Git提交 |
| 7 | 如果用户要求则推送 |
Common Issues
常见问题
| Issue | Solution |
|---|---|
| curl returns HTML instead of YAML | Verify the template code is correct |
| Template name has special chars | Use simple kebab-case for directory |
| Already exists | Compare with existing file, update if needed |
| 问题 | 解决方案 |
|---|---|
| curl返回HTML而非YAML | 验证模板代码是否正确 |
| 模板名称包含特殊字符 | 为目录使用简单的kebab-case格式 |
| 文件已存在 | 与现有文件对比,如有需要则更新 |