tripo-cli 0.1.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 (123) hide show
  1. package/README.md +105 -0
  2. package/dist/ai/experts.js +115 -0
  3. package/dist/ai/llm.js +88 -0
  4. package/dist/ai/plan-card.js +79 -0
  5. package/dist/ai/wizard.js +105 -0
  6. package/dist/cli.js +7 -0
  7. package/dist/commands/account.js +27 -0
  8. package/dist/commands/ai.js +114 -0
  9. package/dist/commands/batch.js +148 -0
  10. package/dist/commands/completion.js +84 -0
  11. package/dist/commands/config-cmd.js +84 -0
  12. package/dist/commands/docs.js +30 -0
  13. package/dist/commands/doctor.js +102 -0
  14. package/dist/commands/generate.js +81 -0
  15. package/dist/commands/home.js +68 -0
  16. package/dist/commands/login.js +309 -0
  17. package/dist/commands/make.js +142 -0
  18. package/dist/commands/mcp.js +194 -0
  19. package/dist/commands/process-groups.js +166 -0
  20. package/dist/commands/shared.js +75 -0
  21. package/dist/commands/task.js +128 -0
  22. package/dist/commands/topup.js +61 -0
  23. package/dist/commands/view.js +97 -0
  24. package/dist/config/config.js +99 -0
  25. package/dist/config/context.js +44 -0
  26. package/dist/config/history.js +104 -0
  27. package/dist/core/client.js +129 -0
  28. package/dist/core/device-auth.js +141 -0
  29. package/dist/core/download.js +107 -0
  30. package/dist/core/errors.js +64 -0
  31. package/dist/core/output.js +72 -0
  32. package/dist/core/region.js +45 -0
  33. package/dist/core/requests.js +197 -0
  34. package/dist/core/task-service.js +167 -0
  35. package/dist/core/upload.js +42 -0
  36. package/dist/core/viewer-assets.js +24 -0
  37. package/dist/core/viewer.js +59 -0
  38. package/dist/core/watch.js +42 -0
  39. package/dist/i18n.js +19 -0
  40. package/dist/knowledge/chains.js +157 -0
  41. package/dist/knowledge/error-catalog.js +91 -0
  42. package/dist/knowledge/models.js +158 -0
  43. package/dist/knowledge/params.js +203 -0
  44. package/dist/knowledge/scenarios.js +112 -0
  45. package/dist/pipeline/make.js +233 -0
  46. package/dist/pipeline/runner.js +73 -0
  47. package/dist/pipeline/stdin.js +40 -0
  48. package/dist/program.js +147 -0
  49. package/dist/src/ai/experts.js +115 -0
  50. package/dist/src/ai/llm.js +88 -0
  51. package/dist/src/ai/plan-card.js +79 -0
  52. package/dist/src/ai/wizard.js +104 -0
  53. package/dist/src/cli.js +7 -0
  54. package/dist/src/commands/account.js +27 -0
  55. package/dist/src/commands/ai.js +113 -0
  56. package/dist/src/commands/batch.js +148 -0
  57. package/dist/src/commands/completion.js +84 -0
  58. package/dist/src/commands/config-cmd.js +84 -0
  59. package/dist/src/commands/docs.js +30 -0
  60. package/dist/src/commands/doctor.js +94 -0
  61. package/dist/src/commands/generate.js +81 -0
  62. package/dist/src/commands/home.js +68 -0
  63. package/dist/src/commands/login.js +225 -0
  64. package/dist/src/commands/make.js +142 -0
  65. package/dist/src/commands/mcp.js +194 -0
  66. package/dist/src/commands/process-groups.js +164 -0
  67. package/dist/src/commands/shared.js +75 -0
  68. package/dist/src/commands/task.js +127 -0
  69. package/dist/src/commands/topup.js +61 -0
  70. package/dist/src/commands/view.js +97 -0
  71. package/dist/src/config/config.js +79 -0
  72. package/dist/src/config/context.js +44 -0
  73. package/dist/src/config/history.js +104 -0
  74. package/dist/src/core/client.js +120 -0
  75. package/dist/src/core/download.js +107 -0
  76. package/dist/src/core/errors.js +64 -0
  77. package/dist/src/core/output.js +72 -0
  78. package/dist/src/core/requests.js +169 -0
  79. package/dist/src/core/task-service.js +161 -0
  80. package/dist/src/core/upload.js +36 -0
  81. package/dist/src/core/viewer-assets.js +24 -0
  82. package/dist/src/core/viewer.js +59 -0
  83. package/dist/src/core/watch.js +41 -0
  84. package/dist/src/i18n.js +19 -0
  85. package/dist/src/knowledge/chains.js +152 -0
  86. package/dist/src/knowledge/error-catalog.js +91 -0
  87. package/dist/src/knowledge/models.js +110 -0
  88. package/dist/src/knowledge/params.js +174 -0
  89. package/dist/src/knowledge/scenarios.js +112 -0
  90. package/dist/src/pipeline/make.js +233 -0
  91. package/dist/src/pipeline/runner.js +73 -0
  92. package/dist/src/pipeline/stdin.js +40 -0
  93. package/dist/src/program.js +147 -0
  94. package/dist/src/types.js +2 -0
  95. package/dist/src/util/input-detect.js +92 -0
  96. package/dist/src/util/notify.js +17 -0
  97. package/dist/src/util/open.js +18 -0
  98. package/dist/src/util/spinner.js +62 -0
  99. package/dist/src/util/term-image.js +28 -0
  100. package/dist/src/version.js +10 -0
  101. package/dist/types.js +2 -0
  102. package/dist/util/input-detect.js +93 -0
  103. package/dist/util/notify.js +17 -0
  104. package/dist/util/open.js +18 -0
  105. package/dist/util/spinner.js +62 -0
  106. package/dist/util/term-image.js +28 -0
  107. package/dist/version.js +10 -0
  108. package/package.json +63 -0
  109. package/skill/SKILL.md +70 -0
  110. package/skill/commands/account.md +41 -0
  111. package/skill/commands/batch.md +33 -0
  112. package/skill/commands/generate.md +34 -0
  113. package/skill/commands/make.md +47 -0
  114. package/skill/commands/process.md +50 -0
  115. package/skill/commands/task.md +27 -0
  116. package/skill/commands/view.md +25 -0
  117. package/skill/common-errors.md +38 -0
  118. package/skill/examples/animation.md +33 -0
  119. package/skill/examples/ar-web.md +23 -0
  120. package/skill/examples/film.md +22 -0
  121. package/skill/examples/game-asset.md +35 -0
  122. package/skill/examples/pipes.md +39 -0
  123. package/skill/examples/print.md +31 -0
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Minimal stderr spinner. Interactive TTY gets an animated line; headless
3
+ * environments get sparse plain-text progress lines (never control codes).
4
+ */
5
+ import pc from 'picocolors';
6
+ const FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
7
+ export function createSpinner(initialText, quiet = false) {
8
+ const isTTY = Boolean(process.stderr.isTTY);
9
+ let text = initialText;
10
+ let frame = 0;
11
+ let timer;
12
+ let lastPlainLog = 0;
13
+ const render = () => {
14
+ process.stderr.write(`\r\x1b[2K${pc.cyan(FRAMES[frame % FRAMES.length])} ${text}`);
15
+ frame++;
16
+ };
17
+ const clearLine = () => {
18
+ if (isTTY)
19
+ process.stderr.write('\r\x1b[2K');
20
+ };
21
+ if (!quiet && isTTY) {
22
+ render();
23
+ timer = setInterval(render, 100);
24
+ timer.unref?.();
25
+ }
26
+ else if (!quiet) {
27
+ process.stderr.write(`${initialText}\n`);
28
+ lastPlainLog = Date.now();
29
+ }
30
+ return {
31
+ update(next) {
32
+ text = next;
33
+ if (quiet)
34
+ return;
35
+ if (!isTTY) {
36
+ // Throttle non-TTY progress to one line per 5s to keep logs readable.
37
+ if (Date.now() - lastPlainLog > 5000) {
38
+ process.stderr.write(`${next}\n`);
39
+ lastPlainLog = Date.now();
40
+ }
41
+ }
42
+ },
43
+ succeed(finalText) {
44
+ if (timer)
45
+ clearInterval(timer);
46
+ clearLine();
47
+ if (!quiet)
48
+ process.stderr.write(`${pc.green('✓')} ${finalText}\n`);
49
+ },
50
+ fail(finalText) {
51
+ if (timer)
52
+ clearInterval(timer);
53
+ clearLine();
54
+ process.stderr.write(`${pc.red('✗')} ${finalText}\n`);
55
+ },
56
+ stop() {
57
+ if (timer)
58
+ clearInterval(timer);
59
+ clearLine();
60
+ },
61
+ };
62
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Inline image display for capable terminals (iTerm2 OSC 1337; Kitty graphics
3
+ * protocol consumers also honor the iTerm sequence via icat shims). Falls back
4
+ * to returning false so callers can open the system viewer instead.
5
+ */
6
+ import { readFileSync } from 'node:fs';
7
+ import { basename } from 'node:path';
8
+ export function terminalSupportsInlineImages() {
9
+ if (!process.stdout.isTTY)
10
+ return false;
11
+ const program = process.env.TERM_PROGRAM ?? '';
12
+ const term = process.env.TERM ?? '';
13
+ return program === 'iTerm.app' || program === 'WezTerm' || term.includes('kitty');
14
+ }
15
+ export function printInlineImage(filePath, stream = process.stderr) {
16
+ if (!terminalSupportsInlineImages())
17
+ return false;
18
+ try {
19
+ const data = readFileSync(filePath);
20
+ const b64 = data.toString('base64');
21
+ const name = Buffer.from(basename(filePath)).toString('base64');
22
+ stream.write(`\x1b]1337;File=name=${name};size=${data.length};inline=1;width=40%:${b64}\x07\n`);
23
+ return true;
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ }
@@ -0,0 +1,10 @@
1
+ import { readFileSync } from 'node:fs';
2
+ export function cliVersion() {
3
+ try {
4
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
5
+ return pkg.version ?? '0.0.0';
6
+ }
7
+ catch {
8
+ return '0.0.0';
9
+ }
10
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "tripo-cli",
3
+ "version": "0.1.0",
4
+ "description": "Tripo 3D intelligent CLI — turn a prompt or an image into engine-ready 3D assets from your terminal (Tripo V3 API)",
5
+ "keywords": [
6
+ "tripo",
7
+ "3d",
8
+ "text-to-3d",
9
+ "image-to-3d",
10
+ "cli",
11
+ "ai",
12
+ "glb",
13
+ "fbx"
14
+ ],
15
+ "license": "MIT",
16
+ "type": "module",
17
+ "bin": {
18
+ "tripo": "dist/cli.js"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "skill",
23
+ "README.md"
24
+ ],
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/vast-enterprise/Tripo-API-CLI.git"
31
+ },
32
+ "homepage": "https://github.com/vast-enterprise/Tripo-API-CLI#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/vast-enterprise/Tripo-API-CLI/issues"
35
+ },
36
+ "scripts": {
37
+ "build": "tsc -p tsconfig.build.json && node scripts/postbuild.mjs",
38
+ "dev": "tsx src/cli.ts",
39
+ "typecheck": "tsc --noEmit",
40
+ "lint": "eslint src tests",
41
+ "test": "vitest run",
42
+ "test:coverage": "vitest run --coverage",
43
+ "e2e": "node scripts/e2e-smoke.mjs",
44
+ "pack:check": "node scripts/pack-check.mjs",
45
+ "prepublishOnly": "npm run typecheck && npm run lint && npm run test && npm run build && npm run pack:check"
46
+ },
47
+ "dependencies": {
48
+ "@clack/prompts": "^1.7.0",
49
+ "commander": "^15.0.0",
50
+ "picocolors": "^1.1.1",
51
+ "yaml": "^2.9.0"
52
+ },
53
+ "devDependencies": {
54
+ "@eslint/js": "^9.39.5",
55
+ "@types/node": "^26.1.1",
56
+ "@vitest/coverage-v8": "^3.2.7",
57
+ "eslint": "^9.39.5",
58
+ "tsx": "^4.23.1",
59
+ "typescript": "^6.0.3",
60
+ "typescript-eslint": "^8.65.0",
61
+ "vitest": "^3.2.7"
62
+ }
63
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,70 @@
1
+ # Tripo CLI Skill
2
+
3
+ You (an AI coding agent) can generate production-ready 3D assets with the `tripo` CLI.
4
+ One command turns a text prompt or an image into local files: a 3D model (glb/fbx/stl/...), a `preview.png` render, and a `task.json` record.
5
+
6
+ ## Install & auth
7
+
8
+ ```bash
9
+ npm install -g tripo-cli # or: npx tripo-cli ...
10
+ export TRIPO_API_KEY=tsk_... # highest-priority auth; no interaction needed
11
+ tripo doctor # verify key, network, balance
12
+ ```
13
+
14
+ If there is no key, ask the human to run `tripo login` or to provide `TRIPO_API_KEY`.
15
+
16
+ Regions (ov = international, cn = China mainland) share one CLI: `tripo login --key tsk_...` auto-detects which region the key belongs to. On exit code 3 (auth), run `tripo doctor` — it diagnoses key-vs-region mismatches and prints the exact fix (`tripo config set region cn|ov`).
17
+
18
+ ## Behavior rules (read first)
19
+
20
+ 1. **`tripo make` is synchronous and blocking.** It submits the task, polls, downloads artifacts, then exits. Wait for the process to finish and read the final JSON from stdout. Do NOT re-implement polling, do NOT add your own timeout shorter than 15 minutes, do NOT stop just because you saw a task_id in the logs.
21
+ 2. **stdout is the contract; stderr is commentary.** With `--json` (auto-enabled when piped), stdout carries exactly one final JSON line. Progress/logs go to stderr.
22
+ 3. **Artifacts are local files.** The result JSON has `output_dir`, `model_file`, `preview`. Look at `preview.png` to judge quality; re-roll with `tripo redo` if needed.
23
+ 4. **Exit codes are stable** — branch on them:
24
+ - 0 success · 2 usage/params · 3 auth · 4 insufficient credits (tell the human to run `tripo topup`) · 5 content policy · 6 task failed (credits auto-refunded) · 7 network · 8 not found · 9 rate limit (retry with backoff)
25
+ 5. **Never invent parameters.** Unknown `--param key=value` pairs pass through to the API; stick to documented ones (see `commands/`).
26
+ 6. **Don't pick legacy model versions.** The CLI auto-selects `tripo-v3.1` (high fidelity) or `tripo-p1` (low-poly, face budget ≤ 20000). Only override `--model` when the human asks.
27
+
28
+ ## The one command you usually need
29
+
30
+ ```bash
31
+ tripo make "a medieval knight, T-pose" --for game-mobile --json --yes
32
+ tripo make concept.png --for print --json --yes
33
+ tripo make front.png back.png --json --yes # 2-4 views → multiview
34
+ tripo make hero.glb --then texture,rig --json --yes # import + process
35
+ tripo make @last --then convert:fbx --json --yes # continue from last task
36
+ ```
37
+
38
+ - `--for` scenario presets: `game-mobile` `game-pc` `film` `print` `ar-web` `anim` `toy`
39
+ - `--then` chain steps: `refine texture stylize convert import rig-check rig retarget segment complete decimate smartsegment`
40
+ - step args: `convert:format=FBX,texture_size=2048` (bare value = primary arg: `convert:fbx`, `stylize:lego`, `decimate:5000`)
41
+ - Output JSON: `{"task_id","type","status","credits_consumed","output_dir","files",["model_file"],["preview"],["chain"]}`
42
+
43
+ ## Pipes (composing steps yourself)
44
+
45
+ Downstream commands read the upstream task from stdin:
46
+
47
+ ```bash
48
+ tripo make cat.png --json | tripo anim rig --json | tripo anim retarget --param animation=preset:walk --json
49
+ ```
50
+
51
+ ## Other commands
52
+
53
+ | command | purpose |
54
+ | --- | --- |
55
+ | `tripo task get/watch <id> --download` | inspect / block on / download an existing task |
56
+ | `tripo balance` / `tripo usage` | credits: `{"balance","frozen"}` / recent spend |
57
+ | `tripo redo [@last]` | same request, new seed |
58
+ | `tripo view [@last]` | (humans) open a local 3D preview; agents read `preview.png` instead |
59
+ | `tripo files upload <path>` | get a `file_token` |
60
+ | `tripo batch run manifest.yaml` | bulk jobs, resumable |
61
+ | `tripo mcp` | run as an MCP server (tools: tripo_make, tripo_task_get, tripo_task_wait, tripo_balance, tripo_history) |
62
+ | `tripo docs --topic commands/<name>` | print detailed docs for any command |
63
+
64
+ ## Detailed docs in this package
65
+
66
+ - `commands/` — one file per command with every flag and parameter
67
+ - `examples/` — copy-paste recipes per scenario (game/print/animation/...)
68
+ - `common-errors.md` — error table with fixes
69
+
70
+ Print any of them: `tripo docs --topic examples/game-asset`.
@@ -0,0 +1,41 @@
1
+ # tripo login / balance / usage / topup / config / doctor
2
+
3
+ ## Auth
4
+
5
+ ```bash
6
+ export TRIPO_API_KEY=tsk_... # best for agents/CI — zero interaction
7
+ tripo login # humans: browser flow (or --paste / --key tsk_...)
8
+ tripo login --key tsk_... --region ov|cn
9
+ tripo whoami # masked key + region + balance
10
+ tripo logout # removes the local key only
11
+ ```
12
+
13
+ Region decides the API host: ov → `openapi.tripo3d.ai`, cn → `openapi.tripo3d.com`.
14
+
15
+ ## Credits
16
+
17
+ ```bash
18
+ tripo balance # {"balance":1000,"frozen":50} — frozen = running tasks' holds
19
+ tripo usage # recent per-task spend
20
+ tripo topup # opens the billing page, then polls until credits arrive
21
+ ```
22
+
23
+ Exit code 4 anywhere = insufficient credits → tell the human to run `tripo topup`.
24
+ Failed tasks refund their frozen credits automatically.
25
+
26
+ ## Config
27
+
28
+ ```bash
29
+ tripo config list
30
+ tripo config set region cn
31
+ tripo config set llm.base_url https://api.openai.com/v1 # enables `tripo ai` conversation mode
32
+ tripo config set llm.api_key sk-...
33
+ tripo config set llm.model gpt-4o-mini
34
+ tripo config context default_scenario=game-mobile output_dir=./assets # per-directory .tripo/context.json
35
+ ```
36
+
37
+ Env overrides: `TRIPO_API_KEY` `TRIPO_REGION` `TRIPO_API_BASE_URL` `TRIPO_LLM_BASE_URL` `TRIPO_LLM_API_KEY` `TRIPO_LLM_MODEL`.
38
+
39
+ ## tripo doctor
40
+
41
+ Checks node version, key, API reachability, balance, config permissions, terminal capabilities. Exit 1 when a critical check fails. Run this first when anything misbehaves.
@@ -0,0 +1,33 @@
1
+ # tripo batch run
2
+
3
+ Bulk production from a YAML manifest with concurrency, retries, and resume.
4
+
5
+ ```bash
6
+ tripo batch run assets.yaml [--concurrency 2] [--retries 1] [--fresh]
7
+ ```
8
+
9
+ ## Manifest
10
+
11
+ ```yaml
12
+ concurrency: 2
13
+ defaults:
14
+ for: game-mobile
15
+ then: "texture,convert:fbx"
16
+ out: ./assets
17
+ jobs:
18
+ - input: "a bronze sword"
19
+ - input: "a wooden shield"
20
+ name: shield # names become @references and state keys
21
+ - input: cat.png
22
+ for: print
23
+ then: "convert:stl,flatten_bottom=true"
24
+ - inputs: [hero-front.png, hero-back.png]
25
+ name: hero
26
+ params: { texture_quality: detailed }
27
+ ```
28
+
29
+ ## Behavior
30
+
31
+ - State is saved next to the manifest (`assets.yaml.state.json`) after every job. Re-running the same command **skips succeeded jobs** (resume). `--fresh` starts over.
32
+ - Failed jobs retry up to `--retries` times, then are reported; exit code 6 if any job stays failed.
33
+ - Final stdout JSON: `{"total","success","failed","state_file","jobs":{...}}`.
@@ -0,0 +1,34 @@
1
+ # tripo generate — deterministic endpoint access
2
+
3
+ Use `tripo make` unless you need exact endpoint control. All subcommands accept the shared task options (`--json --yes -o --no-wait --no-download --timeout --name -p key=value`).
4
+
5
+ ## 3D
6
+
7
+ ```bash
8
+ tripo generate text-to-model "a ceramic teapot" [--model tripo-v3.1|tripo-p1] [-p face_limit=15000] ...
9
+ tripo generate image-to-model photo.png [-p texture_alignment=original_image] [-p orientation=align_image]
10
+ tripo generate multiview-to-model front.png back.png [left.png right.png]
11
+ ```
12
+
13
+ Key params (hard rules enforced locally):
14
+ - `pbr=true` implies `texture=true`
15
+ - `generate_parts=true` excludes texture/pbr/quad (bare geometry; re-texture afterwards)
16
+ - `quad=true` forces FBX output (quads cannot be stored in GLB)
17
+ - P1: `face_limit` 50–20000; `quad`/`smart_low_poly`/`generate_parts`/`geometry_quality` unsupported
18
+ - model aliases (`tripo-v3.1`/`tripo-p1`/`v3.0`/`v2.5`) are normalized to server wire versions automatically
19
+ - `smart_low_poly=true`: face_limit 500–20000 (500–10000 with quad)
20
+ - seeds: `image_seed` / `model_seed` / `texture_seed` — record them for reproducibility (task.json does this automatically)
21
+
22
+ ## Images (2D pipeline before 3D)
23
+
24
+ ```bash
25
+ tripo generate text-to-image "front view of a knight, T-pose" [-p template=t_pose] [--model seedream_v4]
26
+ tripo generate image-to-image sketch.png --prompt "make it look like clay" [--model seedream_v5]
27
+ tripo generate image-to-multiview photo.png # 1 image → 4-view sheet
28
+ tripo generate edit-multiview <multiview-task-id> -p 'prompts=[{"view":"front","prompt":"add a sword"}]'
29
+ tripo generate image-to-splat photo.png # gaussian splat
30
+ ```
31
+
32
+ - image models: `seedream_v4` (t2i default) `seedream_v5` (i2i default) `banana` `banana_pro` `banana2` `chat_image_1` `chat_image_1.5` `chat_image_2`
33
+ - templates — text-to-image: `asset_extraction character_completion t_pose variants figure`; image-to-image: `t_pose character_completion 3d_enhance variants figure`
34
+ - `template=t_pose` is the golden pre-step for the animation pipeline
@@ -0,0 +1,47 @@
1
+ # tripo make
2
+
3
+ The magic command: input in, finished local 3D artifacts out. Blocking; exits when files are on disk.
4
+
5
+ ```
6
+ tripo make <input...> [options]
7
+ ```
8
+
9
+ ## Inputs (auto-detected)
10
+
11
+ | you pass | it runs |
12
+ | --- | --- |
13
+ | quoted text | text-to-model |
14
+ | one image (.png/.jpg/.jpeg/.webp/.bmp) or image URL | image-to-model |
15
+ | 2–4 images | multiview-to-model (filename hints front/back/left/right win; otherwise positional front,left,back,right; front required) |
16
+ | a model file (.glb/.gltf/.fbx/.obj/.stl) | import (add --then for processing) |
17
+ | task id / `@last` / `@name` | continue processing from that task (--then required) |
18
+
19
+ ## Options
20
+
21
+ - `--for <scenario>` — `game-mobile` `game-pc` `film` `print` `ar-web` `anim` `toy`. Sets model+params+chain+format from the domain knowledge base.
22
+ - `--then <steps>` — processing chain, comma-separated. Steps: `refine texture stylize convert import rig-check rig retarget segment complete decimate smartsegment`. Args: `step:key=value,...`; bare value maps to the step's primary arg (`convert:fbx` → format, `stylize:lego` → style, `decimate:5000` → face_limit, `retarget:preset:walk` → animation). Overrides the scenario chain.
23
+ - `--model <m>` — force `tripo-v3.1` (high fidelity, default) or `tripo-p1` (low-poly; face_limit 50–20000; quad/parts/geometry_quality unsupported and stripped). The CLI normalizes these aliases to the wire versions (`v3.1-20260211` / `P1-20260311`) the server actually accepts.
24
+ - `-n, --candidates <n>` — up to 4 parallel candidates with different seeds (interactive pick when chaining).
25
+ - `--seed <n>` — fixed model_seed for reproducible geometry.
26
+ - `-p, --param key=value` — extra API parameter, repeatable. Common: `texture=false pbr=false` (bare geometry, cheaper), `texture_quality=detailed`, `face_limit=15000`, `quad=true` (forces FBX), `auto_size=true`, `negative_prompt=...`.
27
+ - `-o, --out <dir>` — artifact base dir (default `./tripo-out/<name>-<id8>/`).
28
+ - `--no-wait` — submit only, print `{"task_id"}` and exit (poll later with `tripo task watch`).
29
+ - `--no-download` — wait but skip downloads.
30
+ - `--name <name>` — history name for `@name` references.
31
+ - `--notify` — desktop notification when done.
32
+ - `--timeout <seconds>` — watch timeout (default 1800).
33
+
34
+ ## Output (stdout, --json)
35
+
36
+ ```json
37
+ {"task_id":"...","type":"convert_model","status":"success","credits_consumed":25,
38
+ "output_dir":"tripo-out/knight-1a2b3c4d","files":["model.fbx","preview.png","task.json"],
39
+ "model_file":".../model.fbx","preview":".../preview.png",
40
+ "chain":[{"task_id":"...","type":"texture_model"}]}
41
+ ```
42
+
43
+ Exit codes: 0 ok · 2 params · 3 auth · 4 credits · 5 content policy · 6 task failed · 7 network · 9 rate limit.
44
+
45
+ ## Cost behavior
46
+
47
+ Balance is pre-checked before submitting; failed tasks auto-refund frozen credits. `texture=false pbr=false` skips texture credits entirely (right for 3D printing).
@@ -0,0 +1,50 @@
1
+ # tripo model / anim / mesh — processing steps
2
+
3
+ All subcommands take input as: explicit argument (task id / @last / @name / file / URL) > piped stdin JSON > `@last`.
4
+ Shared options: `--json --yes -o --no-wait --no-download --timeout --name -p key=value`.
5
+
6
+ ## tripo model
7
+
8
+ ```bash
9
+ tripo model refine [input] # only accepts text_to_model tasks
10
+ tripo model texture [input] --texture-quality detailed --texture-alignment geometry [-p pbr=true]
11
+ tripo model stylize [input] --style lego|voxel|voronoi|minecraft [--block-size 80]
12
+ tripo model convert [input] --format GLTF|USDZ|FBX|OBJ|STL|3MF \
13
+ [--texture-size 2048] [--texture-format JPEG|PNG|OPEN_EXR|...] [--face-limit N] \
14
+ [--quad] [--flatten-bottom] [--fbx-preset blender|3dsmax|mixamo] \
15
+ [--export-orientation +x|-x|+y|-y] [--scale-factor 1.5] [--auto-size] \
16
+ [--pivot-to-center-bottom] [--export-vertex-colors]
17
+ tripo model import <file-or-url> # GLB/GLTF/FBX/OBJ/STL ≤150MB
18
+ ```
19
+
20
+ Notes: quad cannot export GLTF; vertex colors only in OBJ/GLTF; any non-default convert option bills as "complex convert".
21
+
22
+ ## tripo anim
23
+
24
+ ```bash
25
+ tripo anim check [input] # rig-check: {"riggable":true,"rig_type":"biped"}; GLB input only
26
+ tripo anim rig [input] [--rig-type biped|quadruped|hexapod|octopod|avian|serpentine|aquatic] \
27
+ [--spec tripo|mixamo] [--out-format glb|fbx] # CLI defaults model=v2.5-20260210 (all body types)
28
+ tripo anim retarget [input] --animation preset:walk [preset:run ...] \
29
+ [--out-format glb|fbx] [--animate-in-place]
30
+ ```
31
+
32
+ - retarget only accepts a rig task id; ≤5 animations, billed per animation
33
+ - rig model wire versions: `v2.5-20260210` (CLI default) / `v1.0-20240301`; marketing names `rig-v1.0`/`rig-v2.0` are normalized automatically
34
+ - v2.5 rig presets (all body types): `preset:idle walk run dive climb jump slash shoot hurt fall turn` (+ body-specific like `preset:quadruped:*`)
35
+ - v1.0 rig presets (biped only): `preset:biped:idle` etc. (90+)
36
+ - Mixamo/Unity Humanoid → `--spec mixamo` (+ `--fbx-preset mixamo` at convert time)
37
+ - game code drives movement → `--animate-in-place`
38
+
39
+ ## tripo mesh
40
+
41
+ ```bash
42
+ tripo mesh segment [input] [--model v1.0-20250506|v2.0-20260430]
43
+ tripo mesh complete [input] [--completion-mode ai_completion|quick_cap] # needs a segment task
44
+ tripo mesh decimate [input] --face-limit 5000 [--quad] [--no-bake] # 500–20000 tri / 500–10000 quad
45
+ tripo mesh smartsegment <file-or-url> [--seg-type image|model] [--granularity coarse|medium|fine] [--hint "..."]
46
+ ```
47
+
48
+ - decimate bakes textures onto the low-poly by default (right for LODs); `-p model=v1.0` allows up to 2M faces but requires `face_limit` and does not support bake/part_names
49
+ - `mesh complete` only accepts segmentation tasks
50
+ - smartsegment takes a file/URL only (no task ids); `--seg-type model` needs a GLB and a 4×4 transform — the CLI auto-fills the identity matrix
@@ -0,0 +1,27 @@
1
+ # tripo task / files / history
2
+
3
+ ## tripo task get <id|@last|@name>
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).
6
+
7
+ ```bash
8
+ tripo task get @last --download --json
9
+ ```
10
+
11
+ ## tripo task watch <id>
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).
14
+
15
+ Rules for agents: treat `watch` as synchronous; read lines until process exit; exit code 6 means the task failed (credits refunded).
16
+
17
+ ## tripo task list [ids...]
18
+
19
+ Batch query. With no ids, shows the most recent local history entries (server-refreshed). JSON output is `{"tasks":[...],"missed":[id,...]}` — `missed` lists ids the server could not find (wrong account/region).
20
+
21
+ ## tripo files upload <path>
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.
24
+
25
+ ## tripo history
26
+
27
+ Local task history with `@name` references: `{"task_id","type","name","status","output_dir"}`.
@@ -0,0 +1,25 @@
1
+ # tripo view / redo / ai / mcp
2
+
3
+ ## tripo view [task|@last|file.glb]
4
+
5
+ Starts a local model-viewer page and opens the browser (humans). Headless callers should read `preview.png` from the artifact directory instead — the files are already local; the browser is optional. `--keep` holds the server until Ctrl+C.
6
+
7
+ ## tripo redo [task|@last] [--seed N]
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`.
10
+
11
+ ## tripo ai [request...]
12
+
13
+ - Without an LLM configured: interactive wizard (3–4 questions) → plan card → confirm → run. Terminal required.
14
+ - With an LLM (`tripo config set llm.*`): natural-language planning by producer + domain-specialist agents → same plan card → confirm (`--yes` skips) → run.
15
+ - Agents: prefer `tripo make --for <scenario>` — it is deterministic and needs no LLM. `@task-name` references inside the request resolve to task ids.
16
+
17
+ ## tripo mcp
18
+
19
+ MCP server on stdio for Cursor/Claude Desktop:
20
+
21
+ ```json
22
+ { "mcpServers": { "tripo": { "command": "tripo", "args": ["mcp"], "env": { "TRIPO_API_KEY": "tsk_..." } } } }
23
+ ```
24
+
25
+ Tools: `tripo_make` (blocking generate+download), `tripo_task_get`, `tripo_task_wait`, `tripo_balance`, `tripo_history`.
@@ -0,0 +1,38 @@
1
+ # Common errors & fixes
2
+
3
+ | exit | api code | meaning | fix |
4
+ | --- | --- | --- | --- |
5
+ | 3 | 1002 | authentication failed (invalid/missing API key) | set `TRIPO_API_KEY` or run `tripo login`; check the key wasn't revoked |
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 |
8
+ | 9 | 1007/2000 | rate or concurrency limit (task families share pools) | wait and retry with backoff; lower `--concurrency` in batch |
9
+ | 8 | 2001 | task not found | task ids are account-scoped — same key that created it? right region (ov/cn)? |
10
+ | 2 | 2003 | empty input file / unreachable URL | verify the file isn't empty and the URL is publicly accessible |
11
+ | 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) |
12
+ | 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) |
13
+ | 5 | 2008 | content policy violation | change the prompt/image |
14
+ | 2 | 2009 | prompt contains invalid characters | remove unusual characters from the prompt |
15
+ | 4 | 2010 | insufficient credits | `tripo topup` (human action); `tripo balance` to check |
16
+ | 2 | 2011/2012 | animation chain input invalid | rig-check needs a model-producing task; retarget needs a rig task |
17
+ | 2 | 2015/2016/2017 | version/type deprecated or invalid | drop the explicit `--model`; the CLI default is current |
18
+ | 2 | 2018 | too complex to remesh | lower `face_limit` or simplify the input model |
19
+ | 8 | 2019 | file not found (token expired?) | re-upload; file tokens are short-lived |
20
+ | 2 | 2020/2021/2022 | bad image URL / file too large / image too large | fix the URL or shrink the file |
21
+ | 7 | 1000/1001 | server-side error | 1000 auto-retries; if persistent, contact support with the `request_id` |
22
+ | 6 | — | task failed server-side | frozen credits auto-refund; `tripo redo` often succeeds with a new seed |
23
+ | 7 | — | network/5xx | auto-retried 3×; check `tripo doctor`; region mismatch (ov/cn) is a common cause |
24
+
25
+ ## Frequent local validations (caught before spending credits)
26
+
27
+ - `refine` only accepts a successful `text_to_model` task
28
+ - `complete` only accepts a `segment` task; `retarget` only accepts a `rig` task
29
+ - quad + GLTF export → rejected (quads cannot be stored in glTF); use FBX/OBJ/USDZ
30
+ - P1 + face_limit outside 50–20000 → rejected with a suggestion to use v3.1
31
+ - multiview without a front view → rejected (name a file "front" or pass it first)
32
+ - `-n` with `--then` needs an interactive terminal (pick the winner first, then chain)
33
+
34
+ ## Weird-but-normal
35
+
36
+ - `model_url` in task output points to a file that may be named `pbr_model` etc. — normal, just download it (the CLI does).
37
+ - Output URLs expire in ~5 minutes — never cache them; re-run `tripo task get <id> --download`.
38
+ - `frozen` balance = holds for running tasks; it settles or refunds automatically.
@@ -0,0 +1,33 @@
1
+ # Recipe: character animation
2
+
3
+ ## One shot (generate → rig → animate)
4
+
5
+ ```bash
6
+ tripo make "a cartoon fox character, T-pose" --for anim --json --yes
7
+ # rig-check gates the chain: if not riggable it stops early (no credits wasted)
8
+ ```
9
+
10
+ ## Step by step with pipes
11
+
12
+ ```bash
13
+ tripo make "a robot soldier, T-pose" --json --yes \
14
+ | tripo anim check --json \
15
+ | tripo anim rig --spec mixamo --out-format fbx --json \
16
+ | tripo anim retarget --animation preset:idle preset:walk preset:run --json
17
+ ```
18
+
19
+ ## Animate an existing model file
20
+
21
+ ```bash
22
+ tripo make hero.glb --then rig-check,rig,retarget:preset:walk --json --yes
23
+ ```
24
+
25
+ ## T-pose image first (better rigging on tricky subjects)
26
+
27
+ ```bash
28
+ tripo generate text-to-image "full-body front view of a ninja" -p template=t_pose --json --yes
29
+ tripo generate image-to-model @last --json --yes # image task id works as input
30
+ tripo make @last --then rig-check,rig,retarget:preset:run --json --yes
31
+ ```
32
+
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`.
@@ -0,0 +1,23 @@
1
+ # Recipe: AR / Web / e-commerce
2
+
3
+ iOS QuickLook needs USDZ; the web wants a small GLB. The ar-web scenario delivers both.
4
+
5
+ ```bash
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.
9
+ ```
10
+
11
+ Tighter mobile budget:
12
+
13
+ ```bash
14
+ tripo make product.jpg --for ar-web --then decimate:8000,convert:usdz --json --yes
15
+ ```
16
+
17
+ Web-only (skip USDZ):
18
+
19
+ ```bash
20
+ tripo make product.jpg --then decimate:10000 --json --yes
21
+ ```
22
+
23
+ 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.
@@ -0,0 +1,22 @@
1
+ # Recipe: film / offline rendering
2
+
3
+ Quads for subdivision, maximum quality, DCC handoff.
4
+
5
+ ```bash
6
+ tripo make "an antique brass telescope" --for film --json --yes
7
+ # → v3.1, quad=true (FBX out), geometry+texture detailed, 4K PBR
8
+ ```
9
+
10
+ USD pipeline handoff:
11
+
12
+ ```bash
13
+ tripo make @last --then convert:format=USDZ,texture_format=PNG --json --yes
14
+ ```
15
+
16
+ HDR textures for compositing:
17
+
18
+ ```bash
19
+ tripo make @last --then "convert:format=OBJ,texture_format=OPEN_EXR,texture_size=4096" --json --yes
20
+ ```
21
+
22
+ Notes: quad topology cannot live in GLB — deliverables are FBX/OBJ/USD; `geometry_quality=detailed` bills an extra HD credit; non-default convert options bill as complex convert.
@@ -0,0 +1,35 @@
1
+ # Recipe: game assets
2
+
3
+ ## Mobile / low-poly (P1, clean topology, FBX)
4
+
5
+ ```bash
6
+ tripo make "a stylized barbarian axe" --for game-mobile --json --yes
7
+ # → P1, face_limit 15000, 2K textures, convert to FBX
8
+ ```
9
+
10
+ Tighter budget and Unity delivery:
11
+
12
+ ```bash
13
+ tripo make "a health potion bottle" --for game-mobile \
14
+ -p face_limit=3000 --then convert:format=FBX,texture_size=1024 --json --yes
15
+ ```
16
+
17
+ ## PC / console (v3.1, detailed PBR)
18
+
19
+ ```bash
20
+ tripo make "an ornate treasure chest, fantasy style" --for game-pc --json --yes
21
+ ```
22
+
23
+ ## LODs from one high-poly
24
+
25
+ ```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
28
+ ```
29
+
30
+ ## Character with animations (see also examples/animation.md)
31
+
32
+ ```bash
33
+ 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)
35
+ ```