gaoding-cli 1.0.0-alpha.5
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/CHANGELOG.md +88 -0
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/SECURITY.md +34 -0
- package/dist/bin/gd-cli.d.ts +2 -0
- package/dist/bin/gd-cli.js +10 -0
- package/dist/src/api/app-runner.d.ts +33 -0
- package/dist/src/api/app-runner.js +1177 -0
- package/dist/src/api/dam-client.d.ts +111 -0
- package/dist/src/api/dam-client.js +897 -0
- package/dist/src/api/direct-auth.d.ts +3 -0
- package/dist/src/api/direct-auth.js +11 -0
- package/dist/src/api/direct-client.d.ts +27 -0
- package/dist/src/api/direct-client.js +151 -0
- package/dist/src/api/direct-tools.d.ts +43 -0
- package/dist/src/api/direct-tools.js +1155 -0
- package/dist/src/api/hub-client.d.ts +20 -0
- package/dist/src/api/hub-client.js +99 -0
- package/dist/src/api/sso-client.d.ts +60 -0
- package/dist/src/api/sso-client.js +140 -0
- package/dist/src/api/task-poller.d.ts +38 -0
- package/dist/src/api/task-poller.js +72 -0
- package/dist/src/api/tool-invoker.d.ts +12 -0
- package/dist/src/api/tool-invoker.js +11 -0
- package/dist/src/api/usage-client.d.ts +39 -0
- package/dist/src/api/usage-client.js +179 -0
- package/dist/src/auth/credential-store-v2.d.ts +12 -0
- package/dist/src/auth/credential-store-v2.js +59 -0
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/auth.js +191 -0
- package/dist/src/commands/dam.d.ts +2 -0
- package/dist/src/commands/dam.js +293 -0
- package/dist/src/commands/models.d.ts +2 -0
- package/dist/src/commands/models.js +78 -0
- package/dist/src/commands/org.d.ts +2 -0
- package/dist/src/commands/org.js +137 -0
- package/dist/src/commands/skills.d.ts +2 -0
- package/dist/src/commands/skills.js +213 -0
- package/dist/src/commands/tools.d.ts +4 -0
- package/dist/src/commands/tools.js +383 -0
- package/dist/src/commands/update.d.ts +2 -0
- package/dist/src/commands/update.js +167 -0
- package/dist/src/commands/usage.d.ts +7 -0
- package/dist/src/commands/usage.js +43 -0
- package/dist/src/commands/workflows.d.ts +3 -0
- package/dist/src/commands/workflows.js +398 -0
- package/dist/src/core/auth/auth-provider.d.ts +8 -0
- package/dist/src/core/auth/auth-provider.js +12 -0
- package/dist/src/core/auth/device-oauth-provider.d.ts +12 -0
- package/dist/src/core/auth/device-oauth-provider.js +124 -0
- package/dist/src/core/auth/org-manager.d.ts +26 -0
- package/dist/src/core/auth/org-manager.js +224 -0
- package/dist/src/core/auth/signature.d.ts +19 -0
- package/dist/src/core/auth/signature.js +33 -0
- package/dist/src/core/auth/types.d.ts +52 -0
- package/dist/src/core/auth/types.js +3 -0
- package/dist/src/core/output/cli-error.d.ts +5 -0
- package/dist/src/core/output/cli-error.js +8 -0
- package/dist/src/core/output/detector.d.ts +5 -0
- package/dist/src/core/output/detector.js +14 -0
- package/dist/src/core/output/engine.d.ts +32 -0
- package/dist/src/core/output/engine.js +77 -0
- package/dist/src/core/output/envelope.d.ts +40 -0
- package/dist/src/core/output/envelope.js +119 -0
- package/dist/src/core/output/index.d.ts +4 -0
- package/dist/src/core/output/index.js +4 -0
- package/dist/src/core/output/live-display.d.ts +15 -0
- package/dist/src/core/output/live-display.js +111 -0
- package/dist/src/core/output/result-card.d.ts +18 -0
- package/dist/src/core/output/result-card.js +39 -0
- package/dist/src/core/prompt/index.d.ts +31 -0
- package/dist/src/core/prompt/index.js +36 -0
- package/dist/src/io.d.ts +14 -0
- package/dist/src/io.js +31 -0
- package/dist/src/middleware/auth.d.ts +3 -0
- package/dist/src/middleware/auth.js +74 -0
- package/dist/src/middleware/error-handler.d.ts +3 -0
- package/dist/src/middleware/error-handler.js +431 -0
- package/dist/src/middleware/interactive-params.d.ts +14 -0
- package/dist/src/middleware/interactive-params.js +53 -0
- package/dist/src/middleware/output.d.ts +14 -0
- package/dist/src/middleware/output.js +546 -0
- package/dist/src/models/model-catalog.d.ts +26 -0
- package/dist/src/models/model-catalog.js +216 -0
- package/dist/src/program.d.ts +2 -0
- package/dist/src/program.js +152 -0
- package/dist/src/registry/agent-contracts.d.ts +43 -0
- package/dist/src/registry/agent-contracts.js +483 -0
- package/dist/src/registry/app-loader.d.ts +2 -0
- package/dist/src/registry/app-loader.js +70 -0
- package/dist/src/registry/direct-registry.d.ts +11 -0
- package/dist/src/registry/direct-registry.js +234 -0
- package/dist/src/registry/registry-cache.d.ts +10 -0
- package/dist/src/registry/registry-cache.js +52 -0
- package/dist/src/registry/registry-client.d.ts +28 -0
- package/dist/src/registry/registry-client.js +50 -0
- package/dist/src/registry/types.d.ts +69 -0
- package/dist/src/registry/types.js +1 -0
- package/dist/src/tty/auth-presenter.d.ts +3 -0
- package/dist/src/tty/auth-presenter.js +21 -0
- package/dist/src/update/install-source.d.ts +19 -0
- package/dist/src/update/install-source.js +139 -0
- package/dist/src/update/notifier.d.ts +2 -0
- package/dist/src/update/notifier.js +59 -0
- package/dist/src/update/update-checker.d.ts +22 -0
- package/dist/src/update/update-checker.js +110 -0
- package/dist/src/update/version.d.ts +9 -0
- package/dist/src/update/version.js +52 -0
- package/dist/src/utils/agent-skill-installer.d.ts +57 -0
- package/dist/src/utils/agent-skill-installer.js +389 -0
- package/dist/src/utils/capability-metadata.d.ts +18 -0
- package/dist/src/utils/capability-metadata.js +88 -0
- package/dist/src/utils/capability-presenter.d.ts +4 -0
- package/dist/src/utils/capability-presenter.js +190 -0
- package/dist/src/utils/config.d.ts +16 -0
- package/dist/src/utils/config.js +54 -0
- package/dist/src/utils/credential-permissions.d.ts +2 -0
- package/dist/src/utils/credential-permissions.js +22 -0
- package/dist/src/utils/ecommerce-input-guidance.d.ts +15 -0
- package/dist/src/utils/ecommerce-input-guidance.js +85 -0
- package/dist/src/utils/endpoints.d.ts +52 -0
- package/dist/src/utils/endpoints.js +258 -0
- package/dist/src/utils/enrich-upload-params.d.ts +6 -0
- package/dist/src/utils/enrich-upload-params.js +11 -0
- package/dist/src/utils/entitlement.d.ts +17 -0
- package/dist/src/utils/entitlement.js +146 -0
- package/dist/src/utils/gd-home.d.ts +7 -0
- package/dist/src/utils/gd-home.js +26 -0
- package/dist/src/utils/help-verify.d.ts +9 -0
- package/dist/src/utils/help-verify.js +41 -0
- package/dist/src/utils/input-json.d.ts +3 -0
- package/dist/src/utils/input-json.js +61 -0
- package/dist/src/utils/list-output-format.d.ts +10 -0
- package/dist/src/utils/list-output-format.js +34 -0
- package/dist/src/utils/logger.d.ts +6 -0
- package/dist/src/utils/logger.js +19 -0
- package/dist/src/utils/matting-compose.d.ts +10 -0
- package/dist/src/utils/matting-compose.js +45 -0
- package/dist/src/utils/open-browser.d.ts +1 -0
- package/dist/src/utils/open-browser.js +4 -0
- package/dist/src/utils/output-path.d.ts +5 -0
- package/dist/src/utils/output-path.js +70 -0
- package/dist/src/utils/redact.d.ts +3 -0
- package/dist/src/utils/redact.js +96 -0
- package/dist/src/utils/reference-image.d.ts +8 -0
- package/dist/src/utils/reference-image.js +43 -0
- package/dist/src/utils/resolve-app-local-images.d.ts +8 -0
- package/dist/src/utils/resolve-app-local-images.js +84 -0
- package/dist/src/utils/sensitive-path.d.ts +6 -0
- package/dist/src/utils/sensitive-path.js +69 -0
- package/dist/src/utils/settings-store.d.ts +42 -0
- package/dist/src/utils/settings-store.js +50 -0
- package/dist/src/utils/sleep.d.ts +1 -0
- package/dist/src/utils/sleep.js +3 -0
- package/dist/src/utils/spinner.d.ts +2 -0
- package/dist/src/utils/spinner.js +4 -0
- package/dist/src/utils/static-help.d.ts +2 -0
- package/dist/src/utils/static-help.js +3 -0
- package/dist/src/utils/tool-display.d.ts +10 -0
- package/dist/src/utils/tool-display.js +55 -0
- package/dist/src/utils/transient-network-error.d.ts +4 -0
- package/dist/src/utils/transient-network-error.js +40 -0
- package/dist/src/utils/url-safety.d.ts +6 -0
- package/dist/src/utils/url-safety.js +67 -0
- package/dist/src/utils/write-app-deliverables.d.ts +18 -0
- package/dist/src/utils/write-app-deliverables.js +386 -0
- package/package.json +91 -0
- package/skills/gd-cli/SKILL.md +57 -0
- package/skills/gd-cli/references/auth.md +31 -0
- package/skills/gd-cli/references/deliverables.md +22 -0
- package/skills/gd-cli/references/entitlement.md +21 -0
- package/skills/gd-cli/references/errors.md +19 -0
- package/skills/gd-cli/references/org.md +18 -0
- package/skills/gd-cli/references/sop.md +25 -0
- package/skills/gd-cli/references/tools.md +29 -0
- package/skills/gd-cli/references/update.md +16 -0
- package/skills/gd-cli/references/workflows.md +22 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [1.0.0-alpha.5] - 2026-07-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- 新增单一静态 `gd-cli` Agent Skill package,canonical 安装位置为 `~/.agents/skills/gd-cli`。
|
|
13
|
+
- 新增显式的 `skills install/status/update/uninstall` lifecycle,并为 Agent target 创建 symlink/junction。
|
|
14
|
+
- 新增隔离 npm artifact 集成测试,覆盖零安装副作用和完整 Skill lifecycle。
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- 公开创意流程从 `apps call` 调整为 `workflows run`,不保留 compatibility alias。
|
|
19
|
+
- 全局 CLI 更新会拒绝 linked、project-local 和 `npx` 运行,仅刷新已经安装的 canonical Skill。
|
|
20
|
+
- npm artifact 只内置 production endpoint,并使用包含 integrity metadata 的官方 registry lockfile。
|
|
21
|
+
- 官方安装方式调整为 `npm install -g gaoding-cli`,Agent Skill 由用户显式安装。
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
|
|
25
|
+
- 删除 domain Skill discovery/call 命令、重复的 `connect` lifecycle 和旧 multi-Skill packages。
|
|
26
|
+
- 删除 npm `postinstall` 的 Agent 目录写入和动态 EJS Skill generator。
|
|
27
|
+
|
|
28
|
+
## [1.0.0-alpha.4] - 2026-06-15
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Hidden `usage` command for Agent-side稿豆 balance checks.
|
|
33
|
+
- Agent Skill guidance for answering entitlement and remaining-usage questions from structured JSON.
|
|
34
|
+
- Research notes from the Amazon multi-category seller follow-up interview.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Image and video generation now use platform-returned model order for auto fallback selection.
|
|
39
|
+
- Model-selection copy now describes Web/platform ordering instead of package-local defaults.
|
|
40
|
+
|
|
41
|
+
## [1.0.0-alpha.3] - 2026-06-09
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- OpenClaw / Slock natural-language Agent test guide.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Refined Agent Skill guidance for entitlement failures and user-facing error replies.
|
|
50
|
+
- Entitlement pricing URLs now follow the active environment, with override support.
|
|
51
|
+
- Diagnostic entitlement context is hidden unless verbose or debug output is enabled.
|
|
52
|
+
|
|
53
|
+
## [1.0.0-alpha.2] - 2026-06-09
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- `skills` command exposed in the published npm package.
|
|
58
|
+
- Expanded agent skill installer, connect flow, and postinstall setup guidance.
|
|
59
|
+
- Dev home workflow and install script improvements from `5ec08f6`.
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- Agent contracts, entitlement checks, and JSON envelope handling updated for skill setup flows.
|
|
64
|
+
- Install scripts under `docs/install/` aligned with `gaoding-cli` package naming.
|
|
65
|
+
|
|
66
|
+
## [1.0.0-alpha.1] - 2026-06-02
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- `gd-cli` command with `auth`, `org`, `tools`, `apps`, `dam`, `manifest`, `examples`, and `update`.
|
|
71
|
+
- JSON-friendly output via `-f json` for script, CI, and Agent usage.
|
|
72
|
+
- Direct Tools registry for asset upload, text, image, video, and DAM-oriented workflows.
|
|
73
|
+
- App workflows for ecommerce hero images, listing packs, home launch material, product video, and ecommerce batch dry-run.
|
|
74
|
+
- Agent-readable manifests and schemas for exposing GD CLI tools and apps through shell execution.
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
|
|
78
|
+
- npm package name is `gaoding-cli`; install with `npm install -g gaoding-cli`.
|
|
79
|
+
- README now documents the standard CLI workflow instead of environment setup notes.
|
|
80
|
+
- Environment configuration remains behind an opt-in development command.
|
|
81
|
+
- Builds only include the production endpoint preset; non-production endpoints must be configured explicitly.
|
|
82
|
+
- Research archives and generated outputs are treated as working material, not release content.
|
|
83
|
+
|
|
84
|
+
## [0.1.0] - 2025-04-07
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- Early prototype of registry-driven command execution, skill packaging, and browser authorization.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present GDHub Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# gaoding-cli
|
|
2
|
+
|
|
3
|
+
GD CLI 是稿定设计能力的命令行入口,为用户、脚本、CI 和 Agent 提供登录、组织切换、单项 AI Tool、多步骤 Workflow 和 DAM 素材管理能力。
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js `>=20`
|
|
8
|
+
- 有效的稿定账号与可用组织权限
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
默认使用全局安装:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g gaoding-cli
|
|
16
|
+
gd-cli skills install
|
|
17
|
+
gd-cli auth login
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Agent 的安装与接入规则以[官方 Agent 安装文档](https://www.gaoding.com/cli/install.md)为准。
|
|
21
|
+
|
|
22
|
+
非交互 Agent 或 CI 需要显式指定目标并完成确认:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
gd-cli skills install --agent codex --yes --format json
|
|
26
|
+
gd-cli auth login --no-browser --format json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`npm install -g gaoding-cli` 只安装 CLI,不会修改任何 Agent 目录。只有显式执行 `gd-cli skills install` 才会安装 Agent Skill。
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gd-cli auth status
|
|
35
|
+
|
|
36
|
+
gd-cli org list
|
|
37
|
+
gd-cli org switch --org <org-id>
|
|
38
|
+
|
|
39
|
+
gd-cli tools ls
|
|
40
|
+
gd-cli tools call image.cutout --image ./product.jpg --mode product
|
|
41
|
+
gd-cli tools call text.title --brief "夏季运动鞋,轻量缓震,适合通勤"
|
|
42
|
+
|
|
43
|
+
gd-cli workflows ls
|
|
44
|
+
gd-cli workflows run listing-gallery \
|
|
45
|
+
--image ./product.jpg \
|
|
46
|
+
--brief "夏季运动鞋,轻量缓震,适合通勤"
|
|
47
|
+
|
|
48
|
+
gd-cli dam upload ./product.jpg
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
| Command | Purpose |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `auth` | 登录、退出和查看本地认证状态 |
|
|
56
|
+
| `org` | 查看和切换当前组织 |
|
|
57
|
+
| `tools` | 调用单项 AI 创意能力 |
|
|
58
|
+
| `workflows` | 运行多步骤创意生产流程 |
|
|
59
|
+
| `skills` | 安装和管理 `gd-cli` Agent Skill |
|
|
60
|
+
| `dam` | 上传、查询和删除 DAM 素材 |
|
|
61
|
+
| `update` | 检查和升级全局 CLI |
|
|
62
|
+
| `manifest` | 输出 Agent 可解析的能力清单 |
|
|
63
|
+
| `examples` | 查看常用命令示例 |
|
|
64
|
+
|
|
65
|
+
## Agent And Script Usage
|
|
66
|
+
|
|
67
|
+
核心命令支持 `--format json`,便于脚本和 Agent 解析。Agent 自身有语言模型时,标题、正文、标签和 prompt 草稿可优先由 Agent 生成;`gd-cli` 负责上传、抠图、生图、生视频、高清化和完整 Workflow 交付。
|
|
68
|
+
|
|
69
|
+
单项能力使用 `tools call`:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
gd-cli tools call image.generate \
|
|
73
|
+
--prompt "电商主图,白底,突出轻量缓震" \
|
|
74
|
+
--image ./product.jpg \
|
|
75
|
+
--ratio 1:1 \
|
|
76
|
+
--format json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
多步骤交付使用 `workflows run`:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
gd-cli workflows run listing-gallery \
|
|
83
|
+
--image ./product.jpg \
|
|
84
|
+
--brief "运动鞋上架素材包" \
|
|
85
|
+
--output-dir ./output \
|
|
86
|
+
--format json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Agent Skill
|
|
90
|
+
|
|
91
|
+
`gd-cli skills install` 将静态 Skill 安装到 `~/.agents/skills/gd-cli`,再为选中的 Agent 创建 link。常用维护命令:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
gd-cli skills status --format json
|
|
95
|
+
gd-cli skills update
|
|
96
|
+
gd-cli skills uninstall --all --yes
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
CLI 全局升级后,只在 canonical Skill 已安装时自动刷新它;本地项目安装、`npm link` 和 `npx` 运行不会修改全局 CLI。
|
|
100
|
+
|
|
101
|
+
## Development
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install
|
|
105
|
+
npm run build
|
|
106
|
+
npm test
|
|
107
|
+
npm run start -- --help
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
本地开发使用独立的 `gd-cli-dev`:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm run dev:setup
|
|
114
|
+
npm run dev
|
|
115
|
+
gd-cli-dev --help
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
默认 smoke test 不登录、不调用付费生成能力:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm run smoke:cli
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
真实接口测试会使用本机登录凭证,并可能消耗额度:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
gd-cli auth login
|
|
128
|
+
npm run smoke:cli:live
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Documentation
|
|
132
|
+
|
|
133
|
+
- [官方 Agent 安装文档](https://www.gaoding.com/cli/install.md)
|
|
134
|
+
- [安全说明](SECURITY.md)
|
|
135
|
+
- [首版发版检查](docs/gd-cli-v1-release-checklist.md)
|
|
136
|
+
- [电商 Workflow 实现与验收](docs/ecommerce-workflows.md)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Security fixes are maintained for the latest published `gaoding-cli` version. Older versions should be upgraded before reporting issues unless the maintainer asks for a targeted reproduction.
|
|
6
|
+
|
|
7
|
+
## Credential Storage
|
|
8
|
+
|
|
9
|
+
`gd-cli auth login` stores local credentials under `~/.gd`. The CLI creates `~/.gd` with `0700` permissions and stores credential-like files with `0600` permissions on POSIX systems. Do not commit or share files from this directory.
|
|
10
|
+
|
|
11
|
+
The CLI does not require users to paste raw Token, Cookie, AK/SK, upload tokens, or signed authorization URLs into project files. Logs and error output are redacted by default, but users should still avoid sharing verbose logs without review.
|
|
12
|
+
|
|
13
|
+
## Local File And URL Boundaries
|
|
14
|
+
|
|
15
|
+
By default, uploads reject hidden files and sensitive paths such as `.ssh`, `.env`, `.git`, `.gd`, `.kube`, `.docker`, `.aws`, and `credentials.json`. Passing `--allow-sensitive-path` is treated as explicit user confirmation.
|
|
16
|
+
|
|
17
|
+
User-supplied media and deliverable download URLs must use `http` or `https`. Localhost, private networks, link-local addresses, metadata services, embedded credentials, and `file://` URLs are rejected by default.
|
|
18
|
+
|
|
19
|
+
The CLI is not a server-side permission boundary. The service must independently validate organization membership, quota, tool availability, model access, asset ownership, DAM repository/folder permissions, and URL safety.
|
|
20
|
+
|
|
21
|
+
## Reporting Vulnerabilities
|
|
22
|
+
|
|
23
|
+
Report suspected vulnerabilities to `security@gaoding.com` with:
|
|
24
|
+
|
|
25
|
+
- affected `gaoding-cli` version and Node.js version
|
|
26
|
+
- command and arguments needed to reproduce
|
|
27
|
+
- expected and actual behavior
|
|
28
|
+
- redacted logs or screenshots
|
|
29
|
+
|
|
30
|
+
Do not include real AK/SK, Cookie, Bearer token, `auth_key`, upload token, authorization code, or signed URL values in reports.
|
|
31
|
+
|
|
32
|
+
## Release Safety
|
|
33
|
+
|
|
34
|
+
Before publishing, maintainers should run the repository checks, inspect `npm pack --dry-run --json`, and verify the package contains no generated outputs or non-production endpoint material. Add provenance only after npm trusted publishing or another OIDC flow has been configured and verified.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createProgram } from "../src/program.js";
|
|
3
|
+
async function main() {
|
|
4
|
+
const program = await createProgram();
|
|
5
|
+
await program.parseAsync(process.argv);
|
|
6
|
+
}
|
|
7
|
+
main().catch((err) => {
|
|
8
|
+
console.error(err.message);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HubClient } from "./hub-client.js";
|
|
2
|
+
import type { TaskResult } from "./task-poller.js";
|
|
3
|
+
interface RunOptions {
|
|
4
|
+
async?: boolean;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
outputDir?: string;
|
|
7
|
+
concurrency?: number;
|
|
8
|
+
onStepStart?: (step: AppStepPublicRecord) => void;
|
|
9
|
+
onStepComplete?: (step: AppStepPublicRecord, result?: TaskResult) => void;
|
|
10
|
+
}
|
|
11
|
+
interface AppStepPublicRecord {
|
|
12
|
+
step_order: number;
|
|
13
|
+
step_id: string;
|
|
14
|
+
step_name: string;
|
|
15
|
+
tool: string;
|
|
16
|
+
status: "running" | "completed" | "failed";
|
|
17
|
+
}
|
|
18
|
+
export declare class AppRunner {
|
|
19
|
+
private invoker;
|
|
20
|
+
constructor(client?: HubClient);
|
|
21
|
+
run(appId: string, params: Record<string, unknown>, options?: RunOptions): Promise<TaskResult>;
|
|
22
|
+
private runListingGallery;
|
|
23
|
+
private runPdpAPlus;
|
|
24
|
+
private runSocialSeedingPack;
|
|
25
|
+
private runCampaignKvPack;
|
|
26
|
+
private generateImageJobs;
|
|
27
|
+
private prepareProduct;
|
|
28
|
+
private optimizePrompt;
|
|
29
|
+
private generateImage;
|
|
30
|
+
private invokeGenerateImage;
|
|
31
|
+
private generateTitle;
|
|
32
|
+
}
|
|
33
|
+
export {};
|