SKILL.md--- name: modly-cli description: 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. version: 1.2.0 author: Modly license: MIT metadata: hermes: tags: [modly, image-to-3d, cli, automation, agents] related_skills: [] --- # Modly CLI ## Overview Modly exposes a local API at `http://127.0.0.1:8765` while the official desktop app is running. If another program holds that port, the app uses the next free one and writes it to `api-port` in its user data folder (`%APPDATA%/Modly`, `~/Library/Application Support/Modly`, `~/.config/Modly`); the CLI reads it, and `MODLY_API_URL` overrides both. The stdlib-only CLI at `tools/modly-cli/agent.py` is an agent helper over the canonical automation contract: - `health` - `model` - `workflow-run` - `capability` - `process-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: ```bash python tools/modly-cli/agent.py health ``` Use `--compact` when another agent needs single-line JSON: ```bash python tools/modly-cli/agent.py --compact health ``` `GET /health` is checked before business operations. If the app is unavailable, failures are structured: ```json { "ok": false, "code": "API_UNAVAILABLE", "message": "Cannot reach Modly API at ..." } ``` ## Canonical Commands Inspect models through `/model/*`: ```bash 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: ```bash 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: ```bash 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: ```json { "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: ```bash python tools/modly-cli/agent.py export --path Default/model.glb --outp