docs: rewrite CLI reference to match v3.0.2 (#8)

This commit is contained in:
2026-07-13 09:25:54 +00:00
parent 0872750c64
commit ac50f54556
+27 -13
View File
@@ -11,29 +11,43 @@ sudo dpkg -i gis-actions_3.0.2_all.deb
安装后直接使用 `agc` 命令。 安装后直接使用 `agc` 命令。
## 配置
```bash
agc config set api-key mk_xxxxxxxxxxxxx
```
## 命令 ## 命令
### 查询套件 ### agc run
执行套件。
```bash ```bash
agc suites list agc run <work_dir> --suite-id <suite-id> --input <key=value> [--input <key=value> ...]
agc run <work_dir> --package-url <url> --input <key=value>
``` ```
### 执行套件 | 参数 | 说明 |
|------|------|
| `work_dir` | 工作目录路径(输出写入此目录) |
| `--suite-id` | 套件 ID(从市场 API 查询) |
| `--package-url` | 直接指定脚本包下载地址(替代 --suite-id |
| `--input` / `-i` | 输入参数,格式 `key=value`,可多次指定 |
| `--api-key` | API Key(查市场时使用,也可设环境变量 `AGENTGIS_API_KEY` |
### 示例
```bash ```bash
agc run /tmp/output --suite-id <suite-id> --input key=val # 通过套件 ID 执行
agc run /tmp/output --suite-id 2c99a1cb-84a5-42dd-9147-1c8e8f7f2941 --input buffer_distance=0.5
# 直接指定包地址
agc run /tmp/output --package-url https://git.mercator.cn/.../suite.tgz --input input_path=/data/my.shp
``` ```
### 发布套件 ## 查询市场
`agc` 暂未内置市场查询命令,使用 curl:
```bash ```bash
tar czf suite.tgz --exclude='.git' --exclude='__pycache__' my-suite/ # 列出所有套件
agc publish upload suite.tgz curl -s https://suites.mercator.cn/api/v1/suites | python3 -m json.tool
# 搜索套件
curl -s "https://suites.mercator.cn/api/v1/suites/search?q=缓冲区"
``` ```