tripo-cli 0.7.2 → 0.8.0

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +16 -14
  3. package/dist/ai/experts.js +26 -20
  4. package/dist/ai/plan-card.js +73 -34
  5. package/dist/ai/wizard.js +19 -19
  6. package/dist/commands/account.js +2 -6
  7. package/dist/commands/ai.js +18 -16
  8. package/dist/commands/batch.js +58 -18
  9. package/dist/commands/completion.js +1 -1
  10. package/dist/commands/config-cmd.js +1 -1
  11. package/dist/commands/doctor.js +1 -3
  12. package/dist/commands/generate.js +50 -8
  13. package/dist/commands/home.js +12 -13
  14. package/dist/commands/login.js +125 -182
  15. package/dist/commands/make.js +50 -25
  16. package/dist/commands/mcp.js +8 -3
  17. package/dist/commands/process-groups.js +29 -18
  18. package/dist/commands/shared.js +22 -13
  19. package/dist/commands/task.js +12 -11
  20. package/dist/commands/topup.js +6 -10
  21. package/dist/commands/update.js +23 -11
  22. package/dist/commands/view.js +3 -4
  23. package/dist/config/config.js +1 -1
  24. package/dist/core/analytics.js +39 -16
  25. package/dist/core/client.js +53 -21
  26. package/dist/core/device-auth.js +49 -1
  27. package/dist/core/download.js +2 -1
  28. package/dist/core/errors.js +24 -14
  29. package/dist/core/output.js +0 -4
  30. package/dist/core/requests.js +94 -31
  31. package/dist/core/task-service.js +21 -20
  32. package/dist/core/upload.js +23 -5
  33. package/dist/core/watch.js +3 -0
  34. package/dist/knowledge/chains.js +16 -17
  35. package/dist/knowledge/error-catalog.js +39 -37
  36. package/dist/knowledge/models.js +147 -27
  37. package/dist/knowledge/params.js +143 -32
  38. package/dist/knowledge/scenarios.js +32 -55
  39. package/dist/pipeline/make.js +38 -30
  40. package/dist/pipeline/runner.js +27 -8
  41. package/dist/pipeline/stdin.js +40 -3
  42. package/dist/program.js +3 -10
  43. package/dist/util/input-detect.js +10 -1
  44. package/package.json +3 -2
  45. package/skill/SKILL.md +52 -15
  46. package/skill/commands/account.md +8 -3
  47. package/skill/commands/batch.md +13 -3
  48. package/skill/commands/generate.md +57 -23
  49. package/skill/commands/make.md +43 -16
  50. package/skill/commands/process.md +29 -24
  51. package/skill/commands/task.md +4 -4
  52. package/skill/commands/view.md +1 -1
  53. package/skill/common-errors.md +14 -10
  54. package/skill/examples/animation.md +4 -2
  55. package/skill/examples/ar-web.md +6 -4
  56. package/skill/examples/game-asset.md +18 -7
  57. package/skill/examples/pipes.md +2 -2
  58. package/skill/examples/print.md +7 -3
  59. package/dist/i18n.js +0 -19
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## tripo task get <id|@last|@name>
4
4
 
5
- Fetch one task. `--step` adds pipeline step details. `--download` fetches artifacts (output URLs expire in ~5 minutes, so the CLI always re-queries before downloading).
5
+ Fetch one task. `--step` adds pipeline step details. `--download` fetches artifacts (output URLs expire in ~5 minutes, so the CLI always re-queries before downloading). Import tasks, and processing tasks whose model input was a file / URL, also carry `output.normalize_scale` (final size = original size × normalize_scale); `--download` records it in `task.json`.
6
6
 
7
7
  ```bash
8
8
  tripo task get @last --download --json
@@ -10,9 +10,9 @@ tripo task get @last --download --json
10
10
 
11
11
  ## tripo task watch <id>
12
12
 
13
- Block until the task finishes. In `--json` mode, progress streams as NDJSON events on stdout (`{"event":"progress",...}` lines) and the final task detail is the last line. `--download` grabs artifacts on success. `--timeout <seconds>` (default 1800).
13
+ Block until the task finishes. Progress goes to stderr (plain lines in `--json` mode, one per progress change); stdout carries only the final task detail as one JSON line. `--download` grabs artifacts on success. `--timeout <seconds>` (default 1800).
14
14
 
15
- Rules for agents: treat `watch` as synchronous; read lines until process exit; exit code 6 means the task failed (credits refunded) — or, if the error says `timeout`, that it is still running (watch it again; do not resubmit).
15
+ Rules for agents: treat `watch` as synchronous; wait for the process to exit and read its one stdout JSON line; exit code 6 means the task failed (credits refunded) — or, if the error says `timeout`, that it is still running (watch it again; do not resubmit).
16
16
 
17
17
  ## tripo task list [ids...]
18
18
 
@@ -20,7 +20,7 @@ Batch query. With no ids, shows the most recent local history entries (server-re
20
20
 
21
21
  ## tripo files upload <path>
22
22
 
23
- Upload an image (≤20MB, PNG/JPEG/WebP/BMP/TIFF) or model (≤150MB, GLB/FBX/OBJ/STL). Prints `{"file_token":"file_..."}` — pass it anywhere an input is accepted. `.gltf` is not uploadable (it references external files) — export as `.glb` or pass a URL instead.
23
+ Upload an image (≤20MB, PNG/JPEG/WebP/BMP/TIFF) or model (≤150MB, GLB/GLTF/FBX/OBJ/STL). Prints `{"file_token":"file_..."}` — pass it anywhere an input is accepted. Files over 60 MB and every `.gltf` go through a presigned URL. A `.gltf` must be self-contained (buffers/textures as `data:` URIs); one that references external files is rejected — export as `.glb` or pass a URL instead.
24
24
 
25
25
  ## tripo history
26
26
 
@@ -6,7 +6,7 @@ Starts a local model-viewer page and opens the browser (humans). Headless caller
6
6
 
7
7
  ## tripo redo [task|@last] [--seed N]
8
8
 
9
- Re-submits the recorded request with a fresh `model_seed` (identical otherwise). Only works for tasks created by this CLI (history holds the payload). Result is a new task, downloaded like `make`.
9
+ Re-submits the recorded request with a fresh `model_seed` (identical otherwise). Only works for tasks created by this CLI (history holds the payload). Result is a new task, downloaded like `make`. It is a new paid task submitted at once, with no plan card and no confirmation: agents must ask the human before running it.
10
10
 
11
11
  ## tripo ai [request...]
12
12
 
@@ -4,12 +4,13 @@
4
4
  | --- | --- | --- | --- |
5
5
  | 3 | 1002 | authentication failed (invalid/missing API key) | set `TRIPO_API_KEY` or run `tripo login`; check the key wasn't revoked |
6
6
  | 3 | 1005 | forbidden (no permission for this resource) | check account permissions |
7
- | 2 | 1003/1004 | malformed request / invalid parameter | check spelling against `tripo docs --topic commands/<cmd>`; the CLI already strips illegal P1 params. Classic 1004s: `generate_parts=true` with texture/pbr on, `ref_image` on segment v1, `quad=true` on P1, `smart_uv=true` on decimate v1.0/v2.0, non-GLB input to smartsegment `model` / rig-check. `invalid model`: the API only accepts dated wire values (`P2-20260801`, `v3.1-20260211`…) — pass the CLI alias (`--model tripo-p2`) and let the CLI normalize, or the wire value itself; never `tripo-*` straight to the API. Table: `commands/generate` § "Models & Versions" |
8
- | 9 | 1007 | per-API-key rate limit | wait and retry with backoff; honour `Retry-After` / `X-RateLimit-Reset` headers |
9
- | 9 | 2000 | per-account concurrency pool full (see table below) | wait for a task in that category to finish, or lower `--concurrency` in batch; other categories are unaffected |
7
+ | 2 | 1003/1004 | malformed request / invalid parameter | check spelling against `tripo docs --topic commands/<cmd>`; the CLI strips unsupported P-series parameters with warnings (`quad` on P1; `smart_low_poly`, `generate_parts`, or `geometry_quality` on P1/P2). Classic 1004s: `generate_parts=true` with texture/pbr on, `ref_image` on segment v1, `smart_uv=true` on decimate v1.0/v2.0, non-GLB input to smartsegment `model`, `texture_quality=fast` on a texture version other than v3.5. `invalid model`: the API only accepts dated wire values (`P2-20260801`, `v3.1-20260211`…) — pass the CLI alias (`--model tripo-p2`) and let the CLI normalize, or the wire value itself; never `tripo-*` straight to the API. Table: `commands/generate` § "Models & Versions" |
8
+ | 9 | 1007 | per-API-key rate limit | the CLI already waits out `X-RateLimit-Reset` / `Retry-After` (up to 60 s per wait, 3 retries); if it still exits 9, wait longer before re-running |
9
+ | 9 | 2000 | per-account concurrency pool full (see table below) | the CLI waits out `Retry-After` (up to 60 s, 3 retries) first; then wait for a task in that category to finish, or lower `--concurrency` in batch; other categories are unaffected |
10
10
  | 8 | 2001 | task not found | task ids are account-scoped — same key that created it? right region (ov/cn)? |
11
+ | 2 | 2002 | unsupported request parameter | check field names and values against `tripo docs --topic commands/<cmd>` (some values need a newer model version) |
11
12
  | 2 | 2003 | empty input file / unreachable URL | verify the file isn't empty and the URL is publicly accessible |
12
- | 2 | 2004 | unsupported file type | images: PNG/JPEG/WebP/BMP/TIFF ≤20MB; models: GLB/FBX/OBJ/STL ≤150MB (.gltf not uploadable — use .glb or a URL) |
13
+ | 2 | 2004 | unsupported file type | images: PNG/JPEG/WebP/BMP/TIFF ≤20MB; models: GLB/GLTF/FBX/OBJ/STL ≤150MB (a `.gltf` must embed its buffers/textures — otherwise use .glb or a URL) |
13
14
  | 2 | 2005/2006/2007 | upstream task wrong type / not successful | the chain needs a successful task of the right type (the CLI validates locally first) |
14
15
  | 5 | 2008 | content policy violation | change the prompt/image |
15
16
  | 2 | 2009 | prompt contains invalid characters | remove unusual characters from the prompt |
@@ -20,8 +21,10 @@
20
21
  | 8 | 2019 | file not found (token expired?) | re-upload; file tokens are short-lived |
21
22
  | 2 | 2020/2021/2022 | bad image URL / file too large / image too large | fix the URL or shrink the file |
22
23
  | 7 | 1000/1001 | server-side error | queries auto-retry on 1000, task creation does not (the task may already exist and be billed — check `tripo balance` frozen credits before re-running); if persistent, contact support with the `request_id` |
23
- | 6 | — | task failed server-side, or the watch timed out | failed: frozen credits auto-refund; `tripo redo` often succeeds with a new seed. `timeout`: the task is still running and is billed if it succeeds — `tripo task watch <id> --download`, never redo |
24
+ | 6 | — | task failed server-side, or the watch timed out | failed / cancelled: frozen credits auto-refund (the error shows the task's `error_code` / `error_message`); `tripo redo` often succeeds with a new seed, but it is a new paid task with no plan card or confirmation, so ask the human first. `timeout`: the task is still running and is billed if it succeeds — `tripo task watch <id> --download`, never redo |
24
25
  | 7 | — | network/5xx | queries auto-retried 3×, task creation is not (follow the `suggestion`: check `tripo balance` before re-running); check `tripo doctor`; region mismatch (ov/cn) is a common cause |
26
+ | 7 | — | task succeeded but downloading its artifacts failed | the task is finished and billed; the error JSON carries `task_id` — run `tripo task get <task_id> --download`, never re-make (batch marks the job `needs_attention`; `make -n` keeps the candidate with `download_error`) |
27
+ | 2 | — | no task on stdin (headless process command with nothing piped, or an upstream that printed no task) | nothing was submitted; pass the input explicitly (`tripo model texture <task_id>` or `@last`). A failed upstream's error JSON is passed through with its own exit code |
25
28
 
26
29
  ## Concurrency pools (default per account; error 2000 when full)
27
30
 
@@ -31,17 +34,18 @@
31
34
  | 3D generation — P series | text/image/multiview-to-model on `tripo-p1` / P2 | 5 |
32
35
  | image generation | text-to-image, image-to-image, image-to-multiview, edit-multiview | **1** |
33
36
  | animation | rig-check, rig, retarget | 10 |
34
- | model processing | texture, convert, refine | 5 |
37
+ | model processing | texture, convert | 5 |
35
38
  | mesh operations | segment, complete, decimate | 10 |
36
39
 
37
40
  Pools are independent: a full H-series pool does not block P-series or image tasks. Image generation is serial by default — do not fan out text-to-image jobs. Higher limits are granted on request via support.
38
41
 
39
42
  ## Frequent local validations (caught before spending credits)
40
43
 
41
- - `refine` only accepts a successful `text_to_model` task
42
- - `complete` only accepts a `segment` task; `retarget` only accepts a `rig` task
43
- - quad + GLTF export → rejected (quads cannot be stored in glTF); use FBX/OBJ/USDZ
44
- - P1 + face_limit outside 50–20000 → rejected with a suggestion to use v3.1
44
+ - `complete` only accepts a `segment` task; `retarget` only accepts a `rig` task (a file/URL is refused before upload)
45
+ - quad + GLTF export → rejected (quads cannot be stored in glTF; quad forces FBX output); use `--format FBX`
46
+ - `texture_quality=fast` with an explicit texture version other than `v3.5-20260815` → rejected (omit the version and the CLI selects v3.5)
47
+ - P1 + face_limit outside 50–20000 → rejected; use P2 for 48–50000 triangles / 48–25000 quads, or H3.1 beyond P2
48
+ - P2 + face_limit outside 48–50000 triangles (or 48–25000 with `quad=true`) → rejected; use H3.1 for a higher budget
45
49
  - decimate `smart_uv` on an explicit v1.0/v2.0 → rejected (v3.0 only); with no model given the CLI selects v3.0
46
50
  - multiview without a front view → rejected (name a file "front" or pass it first)
47
51
  - `-n` with `--then` needs an interactive terminal (pick the winner first, then chain)
@@ -9,8 +9,10 @@ tripo make "a cartoon fox character, T-pose" --for anim --json --yes
9
9
 
10
10
  ## Step by step with pipes
11
11
 
12
+ `--model tripo-p2` keeps the `anim` preset's model (P2, 100–130 credits per generation); without it, a plain T-pose prompt like this one routes to H3.1 (10–50 credits).
13
+
12
14
  ```bash
13
- tripo make "a robot soldier, T-pose" --json --yes \
15
+ tripo make "a robot soldier, T-pose" --model tripo-p2 --json --yes \
14
16
  | tripo anim check --json \
15
17
  | tripo anim rig --spec mixamo --out-format fbx --json \
16
18
  | tripo anim retarget --animation preset:idle preset:walk preset:run --json
@@ -30,4 +32,4 @@ tripo generate image-to-model @last --json --yes # imag
30
32
  tripo make @last --then rig-check,rig,retarget:preset:run --json --yes
31
33
  ```
32
34
 
33
- Rules: retarget needs a rig task (≤5 animations, billed per animation); the v2.5 rig (CLI default) covers all 7 body types; Unity Humanoid → `--spec mixamo`; in-game locomotion → `--animate-in-place`.
35
+ Rules: retarget needs a rig task (≤5 animations, billed per animation); the v3.0 rig (CLI default) is best for humanoids and covers every body type (avian / others have no preset animations); Mixamo → `--spec mixamo`, Unity Humanoid → `--spec unity`, Unreal → `--spec unreal`; in-game locomotion → `--animate-in-place`.
@@ -4,20 +4,22 @@ iOS QuickLook needs USDZ; the web wants a small GLB. The ar-web scenario deliver
4
4
 
5
5
  ```bash
6
6
  tripo make product.jpg --for ar-web --json --yes
7
- # → v3.1 generate → decimate ≤20k faces (textures baked) → convert USDZ
8
- # GLB comes from the decimate step; USDZ from convert. Both under output_dir.
7
+ # → P2 generate (face_limit 20000) → convert USDZ
8
+ # GLB: source_model_file (in source_output_dir); USDZ: model_file (in output_dir).
9
9
  ```
10
10
 
11
11
  Tighter mobile budget:
12
12
 
13
13
  ```bash
14
- tripo make product.jpg --for ar-web --then decimate:8000,convert:usdz --json --yes
14
+ tripo make product.jpg --for ar-web -p face_limit=8000 --json --yes
15
15
  ```
16
16
 
17
17
  Web-only (skip USDZ):
18
18
 
19
19
  ```bash
20
- tripo make product.jpg --then decimate:10000 --json --yes
20
+ tripo make product.jpg --model tripo-p2 -p face_limit=10000 --json --yes
21
21
  ```
22
22
 
23
+ `--then` replaces the preset's whole chain, so `--for ar-web --then ...` downloads only its final step. The GLB + USDZ dual download applies only to the preset's own chain.
24
+
23
25
  Faithful textures from the photo: image inputs default to `texture_alignment=original_image` server-side; add `-p texture_alignment=geometry` only for stylized re-texturing.
@@ -1,10 +1,10 @@
1
1
  # Recipe: game assets
2
2
 
3
- ## Mobile / low-poly (P1, clean topology, FBX)
3
+ ## Mobile / low-poly (P2, clean topology, FBX)
4
4
 
5
5
  ```bash
6
6
  tripo make "a stylized barbarian axe" --for game-mobile --json --yes
7
- # → P1, face_limit 15000, 2K textures, convert to FBX
7
+ # → P2, face_limit 15000, 2K textures, convert to FBX
8
8
  ```
9
9
 
10
10
  Tighter budget and Unity delivery:
@@ -14,22 +14,33 @@ tripo make "a health potion bottle" --for game-mobile \
14
14
  -p face_limit=3000 --then convert:format=FBX,texture_size=1024 --json --yes
15
15
  ```
16
16
 
17
- ## PC / console (v3.1, detailed PBR)
17
+ ## PC / console (P2, detailed PBR)
18
18
 
19
19
  ```bash
20
20
  tripo make "an ornate treasure chest, fantasy style" --for game-pc --json --yes
21
21
  ```
22
22
 
23
- ## LODs from one high-poly
23
+ P2 gives editable topology; with detailed textures the generation step costs 120 credits. For a hero asset where geometric fidelity matters more, add `--model tripo-v3.1` (detailed textures: 30 credits from text, 40 from an image).
24
+
25
+ ## LODs baked from one dense source (explicit H3.1)
26
+
27
+ ```bash
28
+ tripo make "a dense high-poly stone golem source mesh" --model tripo-v3.1 --name dense-golem --json --yes
29
+ tripo make @dense-golem --then decimate:5000,convert:fbx --json --yes # bakes normals by default
30
+ tripo make @dense-golem --then decimate:1500,convert:fbx --json --yes # another LOD from the same source
31
+ ```
32
+
33
+ ## Separate editable parts (explicit H3.1)
24
34
 
25
35
  ```bash
26
- tripo make "a stone golem" --for game-pc --then decimate:5000 --json --yes # bakes normals by default
27
- tripo make @last --then decimate:1500,convert:fbx --json --yes # next LOD from the same source
36
+ tripo make "a modular sci-fi crate with a separate lid and handles" \
37
+ --model tripo-v3.1 -p generate_parts=true --json --yes
38
+ # → H3.1; parts disable texture/pbr, so re-texture later with `tripo model texture`
28
39
  ```
29
40
 
30
41
  ## Character with animations (see also examples/animation.md)
31
42
 
32
43
  ```bash
33
44
  tripo make "a knight in full armor, T-pose, standing straight" --for anim --json --yes
34
- # chain: rig-check → rig(v2.5 rig) → retarget(idle+walk)
45
+ # chain: rig-check → rig(v3.0 rig) → retarget(idle+walk)
35
46
  ```
@@ -1,8 +1,8 @@
1
1
  # Recipe: shell pipelines & batch
2
2
 
3
- ## NDJSON pipes
3
+ ## JSON pipes
4
4
 
5
- stdout of every task command is a single JSON line when piped; downstream commands read it from stdin:
5
+ stdout of every task command is a single JSON line when piped; downstream commands read it from stdin. If an upstream command fails or prints no task, the downstream submits nothing and exits with the upstream's exit code (or 2):
6
6
 
7
7
  ```bash
8
8
  tripo make cat.png --json | tripo model texture --texture-quality detailed --json | tripo model convert --format FBX --json
@@ -17,13 +17,17 @@ tripo make "a phone stand" --for print \
17
17
  # or -p auto_size=true at generation for real-world meters
18
18
  ```
19
19
 
20
- ## Color print (3MF with vertex colors)
20
+ ## Color print (OBJ with vertex colors)
21
21
 
22
22
  ```bash
23
- tripo make figurine.png --for print \
24
- --then "convert:format=3MF,export_vertex_colors=true" --json --yes
23
+ tripo make figurine.png --for print -p texture=true \
24
+ --then "convert:format=OBJ,export_vertex_colors=true" --json --yes
25
25
  ```
26
26
 
27
+ - The print preset skips textures (`texture=false`); a color print needs them back with `-p texture=true` (texture credits apply).
28
+ - The API's 3MF output is single color, and vertex colors are only exported to OBJ/GLTF.
29
+ - Build the multi-color 3MF in your slicer from the OBJ.
30
+
27
31
  ## Fix holes / make watertight first
28
32
 
29
33
  ```bash
package/dist/i18n.js DELETED
@@ -1,19 +0,0 @@
1
- /** Minimal bilingual UX strings. Locale: config override > env (LANG/LC_ALL). */
2
- let currentLocale;
3
- export function setLocale(locale) {
4
- currentLocale = locale;
5
- }
6
- export function getLocale() {
7
- if (currentLocale)
8
- return currentLocale;
9
- const env = process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || '';
10
- return /^zh/i.test(env) ? 'zh' : 'en';
11
- }
12
- /** Pick the localized variant of a bilingual pair. */
13
- export function t(pair) {
14
- return getLocale() === 'zh' ? pair.zh : pair.en;
15
- }
16
- /** Pick the localized variant of a bilingual string list. */
17
- export function tList(pair) {
18
- return getLocale() === 'zh' ? pair.zh : pair.en;
19
- }