@assethub/cli 0.1.25 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: assethub
3
+ description: |
4
+ Use the AssetHub CLI (`assethub`) and hosted MCP to generate and process 3D assets: images, meshes, parts, rigs, animations, textures, and full production runs. AssetHub handles the AI providers, credits, and job tracking.
5
+
6
+ TRIGGER when:
7
+ - Generating or editing an image, concept, or reference for a 3D asset
8
+ - Turning an image or prompt into a 3D mesh, splitting it into parts, or composing parts
9
+ - Rigging, animating, retopologizing, texturing, or converting a mesh
10
+ - Running a 3D production pipeline, checking a job, or recovering a run
11
+ - Asking what models or operations are available, or what something will cost
12
+ - Recording whether a generated asset is acceptable
13
+
14
+ DO NOT TRIGGER for:
15
+ - Installing or configuring the CLI (use `assethub init`, `assethub auth login`)
16
+ - Managing workspace members (use `assethub workspace ...`)
17
+ ---
18
+
19
+ # AssetHub CLI
20
+
21
+ `assethub` is a client, not an agent. It calls the AssetHub API, prints one JSON object to stdout, and puts progress on stderr. You decide what to do; it does it and tells you what happened.
22
+
23
+ ## Output contract
24
+
25
+ - stdout is exactly one JSON object. Parse it. Never scrape stderr.
26
+ - Exit codes: `0` accepted or completed · `1` terminal failure · `2` input, auth, capability, or budget error · `3` timeout, history pending, or needs review · `130` interrupted.
27
+ - **Exit 3 is not a failure.** The server-side job keeps running. The JSON still carries `runId` and `operationId`; use them to resume or watch instead of starting again.
28
+ - Errors arrive as `{"error": {"code", "message"}}` plus any known `runId` / `operationId`.
29
+
30
+ ## The ritual
31
+
32
+ Always in this order. Skipping a step is how credits get wasted.
33
+
34
+ ### 1. Check what this key can do
35
+
36
+ ```bash
37
+ assethub capabilities
38
+ ```
39
+
40
+ Tells you which operations, models, and history features this workspace key allows. If it fails with a missing-key error, the user needs `assethub auth login --api-key-stdin` (never pass a key as an argument) or `ASSETHUB_API_KEY` in the environment. A personal key also needs `assethub workspace use <workspace-id>`.
41
+
42
+ ### 2. Find the operation
43
+
44
+ Prefer the dedicated commands (`image generate`, `mesh generate`, `parts split`, `rig create`, `animate retarget`, `production analyze` …). For anything else, search the live catalog:
45
+
46
+ ```bash
47
+ assethub api search "compose parts"
48
+ assethub api describe "POST /mesh/compose"
49
+ ```
50
+
51
+ `describe` returns the exact input schema and required fields. **Read it before you call.** Do not guess parameter names.
52
+
53
+ ### 3. Pick the model deliberately
54
+
55
+ ```bash
56
+ assethub models list --domain mesh
57
+ assethub models get <model-id>
58
+ ```
59
+
60
+ The default model is not always the right one. A model's catalog entry carries its credit plan. If the user has already tried a model and it failed, choose a different one rather than retrying the same thing.
61
+
62
+ ### 4. Run, with an operation ID for anything paid
63
+
64
+ ```bash
65
+ assethub image generate --prompt "stylized wooden crate" --wait --download --out-dir ./out/crate
66
+ assethub mesh generate --source-id <image-asset-id> --canvas <canvas-id> --wait
67
+ assethub api call "POST /mesh/compose" --input-json @request.json --operation-id $(uuidgen)
68
+ ```
69
+
70
+ - `--wait` blocks until the job finishes and returns the final result. Without it you get a job or run ID to watch.
71
+ - `--download --out-dir <dir>` fetches every output artifact and writes a `manifest.json`.
72
+ - `--operation-id <uuid>` makes a paid request idempotent. Reuse the **same** ID with the **same** input to retry; a new candidate needs a new ID.
73
+ - Generation returns `execution` with the canvas URL, run and job IDs, and the output asset IDs. Chain those IDs into the next step with `--source-id`.
74
+
75
+ ### Fast path: image to a finished, composed asset
76
+
77
+ Turning one image into a finished 3D asset does **not** need manual `parts split`
78
+ → `mesh generate` (once per part) → `composer run`. Use the one-shot command instead:
79
+
80
+ ```bash
81
+ assethub production run --image ./character.png --estimate
82
+ assethub production run --image ./character.png --wait --download --out-dir ./out/asset
83
+ ```
84
+
85
+ `--image` accepts a local file path or an existing asset id — it auto-detects
86
+ which. This wraps `production automation` (split, mesh generation per part, and
87
+ compose all happen server-side) plus waiting and downloads; it never leaves you
88
+ to pair mesh outputs with their source part images by hand. `--compose v6`
89
+ requests a Composer V6 pass explicitly (still pairs parts and images
90
+ automatically); `--compose none` stops after mesh generation. `--max-cost
91
+ <credits>` refuses to run at all once the estimate exceeds it. `runs get <run-id>
92
+ --summary` is the readable alternative to the full JSON dump for checking on a
93
+ long run.
94
+
95
+ ### 5. Wait or recover — never resubmit blindly
96
+
97
+ ```bash
98
+ assethub jobs watch <job-id> --download --out-dir ./out
99
+ assethub runs watch <run-id>
100
+ assethub runs resume <operation-id> --wait
101
+ ```
102
+
103
+ After a timeout, an interrupted command, or any uncertain response, `runs resume <operation-id>` replays the identical request and returns the existing result. It never charges twice. Starting a fresh command does.
104
+
105
+ ### 6. Record the verdict
106
+
107
+ ```bash
108
+ assethub evaluations submit --canvas <canvas-id> --artifact <asset-id> \
109
+ --report ./review.json --agent <your-name> --require-pass
110
+ ```
111
+
112
+ `review.json` must have `schemaVersion: "assethub.evaluation-submission.v1"`, a `rubric`, a `verdict` of `pass` | `fail` | `needs_review`, `criteria`, `referenceAssetIds`, and `evidenceAssetIds`. Inspect the downloaded artifact before you write the verdict; a verdict you did not check is worse than none. `--require-pass` exits 1 on fail and 3 on needs_review, so a pipeline can stop on a bad result. An agent verdict is never creator approval.
113
+
114
+ ## Cost safety
115
+
116
+ - `production run` defaults to `full_auto`, which never pauses for a human. **Always pass `--max-cost-credits <n>`.** The server caps `--max-iterations` at 5.
117
+ - Over MCP the same rule applies: always set `maxCostCredits` on `production_run`.
118
+ - `assethub account get` shows the balance. Check it before a batch.
119
+ - Prefer a dedicated, scoped API key for agent work rather than a full-access one.
120
+
121
+ ## Rules learned the hard way
122
+
123
+ - Never put an API key in a command argument or a config file. Use `--api-key-stdin` or the environment.
124
+ - Part extractor names are the public product names: `V1.5`, `V2.0 alpha`, `V2.1 alpha`. Internal IDs are not accepted.
125
+ - `parts split` and `parts compare` with `--preprocess-prompt` create a second production order; use `--all-ready`, not `--task-id`.
126
+ - Every generation should land on a canvas. Pass `--canvas <id>` to keep a job's steps together; without it the CLI makes one canvas per working directory. `assethub canvas open <id>` shows the user what happened.
127
+ - A complaint like "the mesh has extra limbs" is usually an input problem: stray lines, shadows, or inconsistent views. Clean the image (`image edit`) before switching models.
128
+ - Input can come from a file, a URL, stdin bytes, base64, a data URI, an OpenAI- or Anthropic-style JSON attachment (`--stdin-json`), or the clipboard. You never need to write a temporary file first.
129
+ - Large or complex requests: `--input-json @request.json` with the schema from `api describe`.
130
+
131
+ ## Reusable methods (workspace skills)
132
+
133
+ ```bash
134
+ assethub skills list
135
+ assethub skills get <skill-id>
136
+ ```
137
+
138
+ A workspace skill is a saved method that already worked in this workspace. Read them before inventing a new approach to a problem the team has solved. Skills set to `automatic` apply on matching runs without asking.
139
+
140
+ ## MCP equivalents
141
+
142
+ The hosted MCP (`https://app.assethub.io/api/mcp`) exposes the same API. `capabilities_get` ↔ `capabilities`; `operation_search` / `operation_describe` / `operation_call` ↔ `api search` / `describe` / `call`; `job_poll` ↔ `jobs watch`; `evaluation_submit` ↔ `evaluations submit`. Whichever surface you use, follow the same ritual.
143
+
144
+ ## Diagnose
145
+
146
+ ```bash
147
+ assethub doctor --mcp
148
+ assethub --version
149
+ ```
150
+
151
+ `doctor` checks the key, the workspace, and MCP tool discovery without spending credits. Exit 2 means a check failed and the JSON says which and what to do.