Huly CLI
使用 npx -y @starhui/huly-cli@latest 通过 @firfi/huly-mcp 操作 Huly。
在此仓库中进行本地开发时,执行 pnpm build && pnpm link --global 后,也可直接使用 huly 命令。
快速检查
- 确认 CLI 可用:
npx -y @starhui/huly-cli@latest --version - 首先从已有环境变量中检查脱敏配置:
npx -y @starhui/huly-cli@latest context - 如果缺少必要配置,询问用户是否要通过
--config <path>参数传入显式的 dotenv 文件。 - 如果在问题命令中省略了项目参数,请设置
HULY_DEFAULT_PROJECT或传递--project参数。
绝不要打印真实的令牌、密码或完整的 .env 内容。npx -y @starhui/huly-cli@latest context 是安全的,因为它返回脱敏后的配置。
常用命令
列出项目:
npx -y @starhui/huly-cli@latest project list --json
在创建或更新问题前,先发现状态:
npx -y @starhui/huly-cli@latest project statuses HULY --json
列出问题:
npx -y @starhui/huly-cli@latest issue list --project HULY --status-category active --limit 20 --json
获取某个问题:
npx -y @starhui/huly-cli@latest issue get HULY-123 --project HULY --json
创建问题:
npx -y @starhui/huly-cli@latest issue create --project HULY --title "简短祈使句标题" --description "Markdown 正文"
更新问题:
npx -y @starhui/huly-cli@latest issue update HULY-123 --project HULY --status Done
搜索:
npx -y @starhui/huly-cli@latest search "查询文本" --limit 10 --json
原始工具访问
当一级 CLI 未暴露上游 MCP 工具时,使用原始调用:
npx -y @starhui/huly-cli@latest tools --filter document
npx -y @starhui/huly-cli@latest call get_issue --field project=HULY --field identifier=HULY-123 --json
npx -y @starhui/huly-cli@latest call list_projects --data '{"limit":10}' --json
--field key=value 会强制转换 true、false、null 和数字。对于嵌套 JSON,请使用 --data 或 --file。
安全
- 使用
--json以便代理解析。 - 先读后写:在修改项目/状态/问题之前,先检查其内容,除非用户提供了确切的值。
- 破坏性命令需要确认;只有在用户明确要求删除时才传递
--yes。 - 优先使用
project statuses输出的状态名称;不要自行发明工作流状态。 - 如果命令因认证/配置失败,请报告来自
npx -y @starhui/huly-cli@latest context的缺失脱敏字段;不要暴露密钥。仅在用户确认要使用哪个 dotenv 文件后,再使用--config <path>重试。
实用映射
- 项目:
project list、project get、project statuses、project create、project update、project delete。 - 问题:
issue list、issue get、issue create、issue update、issue delete、issue label、issue unlabel、issue move。 - 全局搜索:
search。 - 所有上游 MCP 工具:
tools和call。