Install
openclaw skills install @graysilver/modelcli使用本地 ModelCLI 完成目标检测、OCR、语音识别、语音合成、模型管理与运行诊断。 Use when the user asks to detect objects in an image, extract Chinese or English text from an image, transcribe WAV/FLAC/MP3 audio, synthesize or clone speech, inspect local model capabilities, or manage ModelCLI models.
openclaw skills install @graysilver/modelcli通过本 skill 的包装器调用本地 ModelCLI。不要解析人类模式的富文本输出,也不要绕过包装器自行拼接 Agent 协议。
根据请求选择能力:
detect。ocr。asr。tts。capabilities、doctor 或 models。推理前检查输入文件存在且可读。所有路径都转换为绝对路径。
使用 {baseDir}/scripts/invoke.py 执行。包装器会确保 CLI 可用,并加入全局 --json --allow-download:
python3 {baseDir}/scripts/invoke.py -- detect /absolute/path/photo.jpg
python3 {baseDir}/scripts/invoke.py -- ocr /absolute/path/screenshot.png
python3 {baseDir}/scripts/invoke.py -- asr /absolute/path/audio.wav --lang auto
python3 {baseDir}/scripts/invoke.py -- tts "要合成的文本" --out /absolute/path/speech.wav
解析 stdout 中唯一的 JSON 信封:
ok: true:使用 result 回答,并指出生成文件的绝对路径。ok: false:使用 error.code、message 和 retryable 处理失败;stderr 仅作诊断。retryable: true 或 MODEL_BUSY 最多重试一次。不要重试输入错误、输出冲突或不可重试错误。
向用户简洁报告结果。除非用户要求,不要倾倒完整 JSON 或依赖日志。
包装器会自动安装缺失的 ModelCLI,也允许推理时下载缺失模型。以下操作必须先获得用户明确确认,然后才加入 --approve-sensitive:
--force 覆盖已有输出。models install ... --refresh。models remove ... 或 models clean。doctor --deep。确认后这样执行:
python3 {baseDir}/scripts/invoke.py --approve-sensitive -- tts "新内容" --out /absolute/path/existing.wav --force
不要主动刷新模型、删除缓存或覆盖文件。普通推理、models install、models verify、models list、capabilities 和静态 doctor 不需要额外确认。
detect 只识别 COCO 80 类,类别名使用英文,例如 person、car;它不是开放词汇或 UI 元素检测模型。--draw-boxes。auto|zh|en|yue|ja|ko;长音频默认启用 VAD。--out;需要克隆声音时用可读音频传 --prompt-audio。--timeout 调整。需要具体参数或返回字段时读取 references/commands.md。需要错误码、信封或重试细节时读取 references/protocol.md。