如何全面掌握第十六章CLI命令行工具的使用技巧?
摘要:layout: default title: "第十六章:CLI 命令行工具完全指南" 第十六章:CLI 命令行工具完全指南 geopipe-agent 是 GeoPipeAgent 的命
第十六章:CLI 命令行工具完全指南
geopipe-agent 是 GeoPipeAgent 的命令行接口,基于 Click 框架构建,提供 9 个子命令,覆盖流水线运行、验证、步骤查询和 Skill 生成等功能。
16.1 命令总览
geopipe-agent --help
Usage: geopipe-agent [OPTIONS] COMMAND [ARGS]...
GeoPipeAgent — AI-Native GIS Analysis Pipeline Framework.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
backends List available GIS backends and their status.
describe Show detailed information about a specific step.
generate-skill Generate complete Skill file set for AI.
generate-skill-doc Generate steps reference Markdown for AI consumption.
info Show summary information about a GIS data file.
list-steps List all available pipeline steps.
run Run a YAML pipeline file.
validate Validate a YAML pipeline file without executing it.
16.2 run:执行流水线
最核心的命令,执行 YAML 流水线文件并输出 JSON 报告。
命令格式
geopipe-agent run [OPTIONS] FILE
选项
选项
默认值
说明
--log-level
INFO
日志级别:DEBUG/INFO/WARNING/ERROR
--json-log
关闭
使用 JSON 格式日志(便于机器解析)
--var key=value
—
覆盖流水线变量(可多次使用)
示例
# 基础执行
geopipe-agent run pipeline.yaml
# 覆盖变量
geopipe-agent run pipeline.yaml --var input_path=data/roads.shp --var buffer_dist=500
# 调试模式
geopipe-agent run pipeline.yaml --log-level DEBUG
# JSON 格式日志(适合日志系统集成)
geopipe-agent run pipeline.yaml --json-log
# 将报告保存到文件
geopipe-agent run pipeline.yaml > report.json
退出码
退出码
含义
0
成功
1
失败(YAML 解析错误、校验错误、步骤执行错误等)
--var 参数格式规范
# 正确
--var key=value
--var buffer_dist=500
--var input_path=data/roads.shp
--var output_format=GeoJSON
# 错误(缺少 = 号)
--var key value # ❌
16.3 validate:校验流水线
仅校验 YAML 格式和语义,不执行步骤,用于快速检查流水线是否合法。
