modly-cli
它能做什么
这项技能让 AI 智能体使用 Modly 桌面应用,把图片转换为 3D 模型。适合已经安装并运行 Modly 的设计师或游戏制作者。
适用场景
- ✓当你想使用 Modly 把产品照片转换为 3D 模型的时候。
- ✓当你需要在开始任务前检查 Modly 是否正在运行并已准备就绪时。
- ✓当你想把 Modly 中完成的 3D 资源导出为文件时。
技能链接
https://github.com/lightningpixel/modly/blob/main/tools/modly-cli/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请用 Modly 把这张产品照片做成 3D 模型,并为我导出完成的文件。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体向你电脑上的 Modly 应用发送命令。它会检查应用是否已打开,启动任务,等待结果,并在完成后导出输出。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Modly CLI
Overview
Modly exposes a local API at http://127.0.0.1:8765 while the official desktop app is running. The stdlib-only CLI at tools/modly-cli/agent.py is an agent helper over the canonical automation contract:
healthmodelworkflow-runcapabilityprocess-run
Final machine-readable JSON is printed to stdout. Progress JSON lines, when requested, are printed to stderr.
Prerequisites
Launch the official Modly desktop app first, then check readiness:
python tools/modly-cli/agent.py health
Use --compact when another agent needs single-line JSON:
python tools/modly-cli/agent.py --compact health
GET /health is checked before business operations. If the app is unavailable, failures are structured:
{
"ok": false,
"code": "API_UNAVAILABLE",
"message": "Cannot reach Modly API at ..."
}
Canonical Commands
Inspect models through /model/*:
python tools/modly-cli/agent.py model list
python tools/modly-cli/agent.py model status
python tools/modly-cli/agent.py model params --model active
Start or resume workflow runs:
python tools/modly-cli/agent.py workflow-run start --image ./input.png --wait
python tools/modly-cli/agent.py workflow-run status <run_id>
python tools/modly-cli/agent.py workflow-run cancel <run_id>
Generate from an image and export the finished mesh:
python tools/modly-cli/agent.py generate \
--image ./input.png \
--output ./export.glb \
--progress
generate is a friendly wrapper around POST /workflow-runs/from-image and GET /workflow-runs/{run_id}. It does not silently fall back to /generate/*. The JSON includes recovery metadata:
{
"ok": true,
"run": {"kind": "workflowRun", "id": "..."},
"workspace_path": "Default/model.glb",
"export_path": "/absolute/path/to/export.glb",
"meta": {
"status_command": "python tools/modly-cli/agent.py workflow-run status ...",
"cancel_command": "python tools/modly-cli/agent.py workflow-run cancel ...",
"legacy": false
}
}
Use --no-export when the caller only needs the workspace path. The hidden export helper remains available to download an existing workspace mesh, but it is not part of the canonical root command set:
python tools/modly-cli/agent.py export --path Default/model.glb --output ./model.glb
Discover capabilities or process runs only when the running server exposes the canonical contract:
python tools/modly-cli/agent.py capability list
python tools/modly-cli/agent.py process-run status <run_id>
If the contract is absent, the CLI fails closed:
{
"ok": false,
"code": "UNSUPPORTED_PROCESS",
"message": "This process is not available through the canonical process-run contract."
}
Model Selection
--model auto uses the active model reported by /model/status, then validates that id against /model/all. Explicit --model values are also validated against /model/all. The CLI does not infer hidden capabilities from model names, labels, or string fragments.
Legacy Compatibility
The old /generate/* endpoints are explicit compatibility commands:
python tools/modly-cli/agent.py legacy job <job_id>
python tools/modly-cli/agent.py legacy cancel <job_id>
python tools/modly-cli/agent.py legacy generate --image ./input.png --output ./legacy.glb
Legacy responses include meta.legacy: true. Top-level job, cancel, models, and params aliases may still parse for older scripts, but they are not the documented canonical surface.
Developer-Only API Helpers
Headless startup helpers live under dev:
python tools/modly-cli/agent.py dev serve-api --print-command
python tools/modly-cli/agent.py dev ensure-server
python tools/modly-cli/agent.py dev ensure-server --start --detach
These commands start or inspect only the FastAPI backend. They do not imply Electron/Desktop bridge readiness, scene operation readiness, extension process execution readiness, or full workflow support. Prefer launching the official desktop app for real agent workflows.
Experimental ComfyUI Helpers
ComfyUI orchestration is outside the canonical Modly contract and lives under experimental:
python tools/modly-cli/agent.py experimental comfy-image \
--workflow Trellis2Workflow \
--prompt "clean object render, isolated on white" \
--comfy-output ./source.png
python tools/modly-cli/agent.py experimental generat
常见问题
我需要打开 Modly 吗?
需要。Modly 桌面应用必须处于运行状态,因为智能体需要与它的本地接口通信。
我需要给智能体提供什么?
开始生成任务时,主要需要一张输入图片。
如果 Modly 没有运行会怎样?
智能体会报告一个明确的错误,说明无法连接到应用,而不会去猜测。
详情
作者的原始描述
Use when an agent needs to call a running Modly desktop instance from the terminal to generate/export image-to-3D assets through canonical JSON-first automation commands.
repo: lightningpixel/modly
热度
- GitHub 星标
- 8.5k
- 排名
- #12425
- 许可证
- —
- 更新时间
- 2026/11/1
评论
- …