qianwenai-deploy

>-

qianwen-ai/qianwenai-deploy1.1k installsApache-2.0Synced Sep 1

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: qianwenai-deploy
description: >-
license: Apache-2.0
---

# 千问 AI 云部署

## 快速路径

1. **路由任务** — 匹配到 3 种模式之一:全栈部署 · 热更新 · 删除/清理。
2. **部署(默认)** — 按步骤 1→13 执行,每步有对应 reference 文档。
3. **创建资源前确认费用** — 人民币(¥)展示小时单价,取得用户确认。
4. **记录状态** — 成功后写入 `.qianwenai-deploy`。

## 范围

| 范围内 | 范围外 |
|--------|--------|
| 本地项目/Git → 阿里云国内站 | 国际站 → 用 `qwencloud-deploy` |
| 全栈 ROS 编排、热更新、清理 | AWS/GCP/Azure/其他云 |
| ECS + 可选 RDS + OSS + 公网 IP | K8s/Serverless/容器编排 |
| OAuth/AK 认证(不收集凭证) | 域名/HTTPS(不涉及) |

## 假设

- `aliyun` CLI 3.x 已安装;无有效凭证时按 `reference/deploy/01_env_check.md` 引导认证。
- 默认地域 `cn-hangzhou`。

---

## 入口路由

| 信号 | 模式 |
|------|------|
| 存在 `.qianwenai-deploy` + 用户说「更新」 | **热更新** |
| 存在 `.qianwenai-deploy` + 「删除/清理/释放」 | **删除** |
| Git URL 或本地项目(无已有部署) | **全栈部署** |

触发时先展示欢迎话术(见 `reference/rules/rule_interaction.md`)。

---

## 全栈部署(步骤 1–13)

### 阶段 1 · 准备

| 步骤 | 动作 | 参考文档 |
|------|------|----------|
| 1 | 环境检查 | `reference/deploy/01_env_check.md` |
| 2 | Git clone(Git URL 时) | `reference/deploy/02_git_clone.md` |
| 3 | 项目分析 | `reference/deploy/03_analyze_project.md` |

### 阶段 2 · 资源规划

| 步骤 | 动作 | 参考文档 |
|------|------|----------|
| 4 | 存量部署扫描 | `reference/deploy/04_check_existing.md` |
| 5 | 数据库识别 | `reference/deploy/05_database.md` |
| 6 | ECS 规格选择 | `reference/deploy/06_instance_type.md` |
| 7 | 生成 ROS 模板 | `reference/deploy/07_generate_template.md` |
| 8 | 库存检查 | `reference/deploy/08_check_stock.md` |
| 9 | 模板验证 + 询价确认 | `reference/deploy/09_estimate_cost.md` |

### 阶段 3 · 执行

| 步骤 | 动作 | 参考文档 |
|------|------|----------|
| 10 | 上传产物 + 重新生成模板 | `reference/deploy/10_upload_artifacts.md` |
| 11 | 创建栈 | `reference/deploy/11_create_stack.md` |
| 12 | 等待终态 + 探活 | `reference/deploy/12_wait_stack.md` |
| 13 | 记录状态 | `reference/deploy/13_record_state.md` |

---

## 热更新

**触发**:存在 `.qianwenai-deploy` + 用户想更新代码。IP 不变。

| 步骤 | 动作 | 参考文档 |
|------|------|----------|
| U1 | 构建 + 上传新产物 | `reference/deploy/10_upload_artifacts.md` |
| U2 | 下发更新(Cloud Assistant) | `reference/hotfix/update_app.md` |
| U3 | 探活 + 更新状态 | `reference/hotfix/update_app.md` |

更新脚本模板见 `reference/hotfix/update_recipe.md`。

---

## 删除 / 清理

**触发**:用户说「删除」「清理」「释放资源」。

> ⚠️ 不可逆 — 二次确认。含 RDS 时警告数据丢失。

> 🚫 严禁手动逐个删资源,只用 `delete_stack.sh`。

详见 `reference/cleanup/delete_stack.md`。

---

## 关键约束

| 约束 | 规则 |
|------|------|
| 币种 | 人民币(¥) |
| 认证 | OAuth(推荐)或 AK/SK,不通过聊天收集凭证 |
| 模板上传 | 必须 `--TemplateURL`(WAF 拦截 TemplateBody) |
| 栈名重试 | 复用,绝不重新生成 |
| 资源删除 | 始终通过 `delete_stack.sh` |
| 敏感信息 | 分析后检查硬编码密钥并警告 |
| 命令展示 | 不向用户展示底层命令 |

---

## 文件布局

```
scripts/
  generate_template.py  upload_artifacts.py
  create_stack.sh       record_state.py
  delete_stack.sh       update_app.sh
  wait_and_probe.py
reference/
  deploy/
    01_env_check.md ~ 13_record_state.md
  hotfix/
    update_app.md       update_recipe.md
  cleanup/
    delete_stack.md
  rules/
    rule_interaction.md  rule_error_handling.md
templates/
  ros_single[_rds].yaml
  userdata/{systemd,docker,nginx_proxy,nginx_static,nginx_static_proxy}.sh
```

More General & Other skills

← All General & Other skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY