@huyuan-ai/cli 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -6
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huyuan-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "",
|
|
7
|
+
"description": "企业场景下的 AI 助手与技能管理命令行工具(@huyuan-ai/cli,命令 huyuan-ai-cli)。集成 OpenCLI 与私有技能安装。",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"bin": {
|
|
@@ -14,10 +14,16 @@
|
|
|
14
14
|
"build": "node scripts/write-opencli-npmignore.mjs && npm install --prefix vendor/opencli && npm run build --prefix vendor/opencli && tsc",
|
|
15
15
|
"build:tsc": "tsc",
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
17
|
-
"prepublishOnly": "npm run build",
|
|
17
|
+
"prepublishOnly": "node scripts/publish-prepare-readme.mjs && npm run build",
|
|
18
|
+
"postpublish": "node scripts/publish-restore-package-json.mjs",
|
|
18
19
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
20
|
},
|
|
20
|
-
"keywords": [
|
|
21
|
+
"keywords": [
|
|
22
|
+
"cli",
|
|
23
|
+
"ai",
|
|
24
|
+
"huyuan",
|
|
25
|
+
"skills"
|
|
26
|
+
],
|
|
21
27
|
"author": "",
|
|
22
28
|
"license": "ISC",
|
|
23
29
|
"files": [
|
|
@@ -37,5 +43,6 @@
|
|
|
37
43
|
"commander": "^14.0.3",
|
|
38
44
|
"conf": "^15.1.0",
|
|
39
45
|
"execa": "^9.6.1"
|
|
40
|
-
}
|
|
41
|
-
|
|
46
|
+
},
|
|
47
|
+
"readme": "# `@huyuan-ai/cli`\n\n企业场景下的 AI 助手与技能管理命令行工具。**npm 包名**为 **`@huyuan-ai/cli`**,安装后**命令行入口**为 **`huyuan-ai-cli`**(见 `package.json` 的 `bin`)。集成 [OpenCLI](https://github.com/jackwener/opencli)(Git Submodule)用于浏览器侧能力(如豆包对话),并通过自研 **Token Gateway** 与 **`npx skills`** 安装私有技能。\n\n## 从 npm 全局安装\n\n```bash\nnpm install -g @huyuan-ai/cli\nhuyuan-ai-cli --help\n```\n\n## 功能概览\n\n- **登录**:将企业授权 Key 写入 `~/.huyuan-ai/config.json`\n- **安装技能**:用 Key 向网关换取短期令牌后,执行 `npx skills add` 拉取私有仓库技能\n- **豆包对话**:`doubao ask` 在 OpenCLI 已加载的 registry 上执行 `doubao/ask`(需已登录,且依赖 OpenCLI 浏览器/Bridge 环境)\n\n更细的架构、目录约定与开发约束见 **[AGENTS.md](./AGENTS.md)**。\n\n## 环境要求\n\n- **Node.js**:建议 ≥ 20(与 OpenCLI 子模块一致)\n- **包管理**:推荐 **pnpm**(仓库已声明 `packageManager`)\n\n## 从源码构建与运行\n\n1. 克隆并初始化子模块:\n\n ```bash\n git clone --recurse-submodules <repo-url>\n cd huyuan-ai-cli\n ```\n\n 若已克隆未带子模块:`git submodule update --init --recursive`\n\n2. 安装主项目依赖:\n\n ```bash\n pnpm install\n ```\n\n3. **一键构建**(先安装并构建 `vendor/opencli`,再 `tsc` 编译本仓库;发布前也请执行此步):\n\n ```bash\n pnpm run build\n ```\n\n 若仅改本仓库 `src/`、且子模块 `dist/` 已是最新,可改用 `pnpm run build:tsc` 只跑 TypeScript,加快迭代。\n\n4. 运行 CLI:\n\n ```bash\n node dist/index.js --help\n ```\n\n 全局链接(可选):`pnpm link --global`,之后可直接使用 `huyuan-ai-cli`。\n\n## 常用命令\n\n| 命令 | 说明 |\n|------|------|\n| `huyuan-ai-cli login <key>` | 保存企业授权 Key |\n| `huyuan-ai-cli install <skill>` | 从私有技能库安装(需配置网关环境变量) |\n| `huyuan-ai-cli doubao ask <prompt>` | 豆包对话(需已 `login`) |\n\n查看子命令帮助:`huyuan-ai-cli doubao ask --help`\n\n## 环境变量(安装技能)\n\n| 变量 | 说明 |\n|------|------|\n| `HUYUAN_TOKEN_GATEWAY_URL` | Token Gateway 根地址(如 `https://your-app.vercel.app`),详见 [src/constants.ts](src/constants.ts) |\n| `HUYUAN_SKILL_GITHUB_ORG` | 可选,默认 `WeDAOLabs` |\n\n## 脚本\n\n| 脚本 | 说明 |\n|------|------|\n| `pnpm run build` | 构建 `vendor/opencli`(`npm install` + `npm run build`)后 `tsc` 编译到 `dist/` |\n| `pnpm run build:tsc` | 仅 `tsc`(子模块已有 `dist/` 时用) |\n| `pnpm run typecheck` | `tsc --noEmit` |\n\n## 仓库结构(摘要)\n\n```\nsrc/\n index.ts # 入口\n cli/program.ts # Commander 装配\n core/ # 登录、安装等平台能力\n sites/doubao/ # 豆包子命令(可扩展其他 sites)\n integrations/opencli/ # OpenCLI bootstrap 与 registry 执行封装\n utils/config.ts # 本地配置\n constants.ts # 网关等常量与环境变量\nvendor/opencli/ # OpenCLI 子模块(需单独 build)\n```\n\n## 许可证\n\nISC(见 [package.json](package.json))。\n"
|
|
48
|
+
}
|