# CLI 参考 ## 安装 `agc` 命令随 gis-actions 包一起安装: ```bash curl -sLO https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/3.0.5/gis-actions_3.0.5_all.deb sudo dpkg -i gis-actions_3.0.5_all.deb ``` 安装后直接使用 `agc` 命令。 ## 命令 ### agc run 执行套件。 ```bash agc run --suite-id --input [--input ...] agc run --package-url --input ``` | 参数 | 说明 | |------|------| | `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=缓冲区" ```