Files
agent-profiles/suites-help/SDK参考/CLI-参考.md
T

54 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CLI 参考
## 安装
`agc` 命令随 gis-actions 包一起安装:
```bash
curl -sLO https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/3.0.2/gis-actions_3.0.2_all.deb
sudo dpkg -i gis-actions_3.0.2_all.deb
```
安装后直接使用 `agc` 命令。
## 命令
### agc run
执行套件。
```bash
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
# 通过套件 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
# 列出所有套件
curl -s https://suites.mercator.cn/api/v1/suites | python3 -m json.tool
# 搜索套件
curl -s "https://suites.mercator.cn/api/v1/suites/search?q=缓冲区"
```