live-dev-config
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselive-dev-config
live-dev-config
This skill handles code repository linking, cloud hosting setup, and secure credential collection.
bashresources/*.js该Skill负责代码仓库关联、云托管设置以及安全凭据收集。
bashresources/*.js1. Provisioning & Project Linking
1. 资源配置与项目关联
Configure or verify repository and hosting resources in this order:
| Resource | Skip if | Constraints |
|---|---|---|
| GitHub repo | a remote exists | |
| Vercel project | | |
按以下顺序配置或验证仓库和托管资源:
| 资源 | 可跳过条件 | 约束 |
|---|---|---|
| GitHub repo | 已存在远程仓库 | 使用 |
| Vercel project | 存在 | 使用 |
2. Secure Credential Collection
2. 安全凭据收集
Ensure that credentials never leak into git history, command-line logs, or shell execution paths.
确保凭据不会泄露到Git历史、命令行日志或Shell执行路径中。
2.1 Credential collection
2.1 凭据收集
Emit holding only what this step needs (e.g. service account JSON or specific API keys):
.credential-fields.jsonjson
[{ "name": "FIREBASE_SERVICE_ACCOUNT", "label": "Firebase 服務帳戶金鑰",
"help": "Project settings → Service accounts → Generate new private key",
"link": "https://console.firebase.google.com/project/<id>/settings/serviceaccounts/adminsdk" }]bash
node resources/credential-form.js .credential-fields.json # launch via the TOOL's background mode, NOT a shell `&`- Credential Form: Starts a 127.0.0.1-only form, opens the browser, writes to the gitignored file, and exits. Relay the URL to the user if the browser does not open automatically.
.env.local - Manual template fallback: If no browser can open, write as
.env.local.templatefor the user to fill and save toKEY_NAME= # description & link..env.local - Command CLI Logins: For CLI logins (,
gh auth login,vercel login), use each tool's standard device flow.firebase login
生成 文件,仅包含此步骤所需的内容(例如服务账户JSON或特定API密钥):
.credential-fields.jsonjson
[{ "name": "FIREBASE_SERVICE_ACCOUNT", "label": "Firebase 服務帳戶金鑰",
"help": "Project settings → Service accounts → Generate new private key",
"link": "https://console.firebase.google.com/project/<id>/settings/serviceaccounts/adminsdk" }]bash
node resources/credential-form.js .credential-fields.json # 通过工具的后台模式启动,不要使用Shell的 `&`- 凭据表单: 启动仅绑定127.0.0.1的表单,打开浏览器,将内容写入已被Git忽略的 文件后退出。如果浏览器未自动打开,请将URL告知用户。
.env.local - 手动模板回退: 若无法打开浏览器,生成 文件,格式为
.env.local.template,供用户填写后保存为KEY_NAME= # 描述 & 链接。.env.local - 命令行登录: 对于CLI登录(、
gh auth login、vercel login),使用各工具的标准设备流程。firebase login
2.2 Security Guidelines
2.2 安全指南
Never / , never interpolate credentials into double quotes or (shell expansions could execute code). Extract using and pipe to stdin:
sourceeval.env.local<<<read-env-value.jsbash
node resources/read-env-value.js .env.local FIREBASE_SERVICE_ACCOUNT | vercel env add FIREBASE_SERVICE_ACCOUNT production绝不要使用 / 加载 ,绝不要将凭据插入双引号或 (Shell展开可能执行代码)。使用 提取并通过管道传递到标准输入:
sourceeval.env.local<<<read-env-value.jsbash
node resources/read-env-value.js .env.local FIREBASE_SERVICE_ACCOUNT | vercel env add FIREBASE_SERVICE_ACCOUNT productionor GitHub secrets:
或设置GitHub密钥:
node resources/read-env-value.js .env.local FIREBASE_SERVICE_ACCOUNT | gh secret set FIREBASE_SERVICE_ACCOUNT
Report by key name only: `✅ <KEY> set in Vercel/production` / `✅ <KEY> set in GitHub Secrets`.node resources/read-env-value.js .env.local FIREBASE_SERVICE_ACCOUNT | gh secret set FIREBASE_SERVICE_ACCOUNT
仅按密钥名称报告:`✅ <KEY> 已在Vercel/production中设置` / `✅ <KEY> 已在GitHub Secrets中设置`。