@meshy-ai/cli 0.3.1 → 0.4.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.
- package/README.md +69 -565
- package/dist/cmd/auth.d.ts.map +1 -1
- package/dist/cmd/auth.js +14 -12
- package/dist/cmd/auth.js.map +1 -1
- package/dist/cmd/download.d.ts.map +1 -1
- package/dist/cmd/download.js +3 -2
- package/dist/cmd/download.js.map +1 -1
- package/dist/cmd/make.d.ts.map +1 -1
- package/dist/cmd/make.js +26 -10
- package/dist/cmd/make.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/dist/internal/color.d.ts +37 -0
- package/dist/internal/color.d.ts.map +1 -0
- package/dist/internal/color.js +57 -0
- package/dist/internal/color.js.map +1 -0
- package/dist/internal/command-helpers.d.ts.map +1 -1
- package/dist/internal/command-helpers.js +5 -1
- package/dist/internal/command-helpers.js.map +1 -1
- package/dist/internal/context.d.ts +5 -0
- package/dist/internal/context.d.ts.map +1 -1
- package/dist/internal/context.js +5 -0
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/doctor.d.ts +1 -0
- package/dist/internal/doctor.d.ts.map +1 -1
- package/dist/internal/doctor.js +17 -5
- package/dist/internal/doctor.js.map +1 -1
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +13 -4
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/global-options.d.ts.map +1 -1
- package/dist/internal/global-options.js +7 -3
- package/dist/internal/global-options.js.map +1 -1
- package/dist/internal/logger.d.ts.map +1 -1
- package/dist/internal/logger.js +2 -0
- package/dist/internal/logger.js.map +1 -1
- package/dist/internal/oauth-page.d.ts +4 -0
- package/dist/internal/oauth-page.d.ts.map +1 -0
- package/dist/internal/oauth-page.js +67 -0
- package/dist/internal/oauth-page.js.map +1 -0
- package/dist/internal/oauth.d.ts.map +1 -1
- package/dist/internal/oauth.js +10 -35
- package/dist/internal/oauth.js.map +1 -1
- package/dist/internal/output.d.ts +30 -4
- package/dist/internal/output.d.ts.map +1 -1
- package/dist/internal/output.js +96 -13
- package/dist/internal/output.js.map +1 -1
- package/dist/internal/progress.d.ts +62 -0
- package/dist/internal/progress.d.ts.map +1 -0
- package/dist/internal/progress.js +198 -0
- package/dist/internal/progress.js.map +1 -0
- package/dist/internal/runtime.d.ts +16 -1
- package/dist/internal/runtime.d.ts.map +1 -1
- package/dist/internal/runtime.js +22 -7
- package/dist/internal/runtime.js.map +1 -1
- package/dist/internal/task-command.d.ts +0 -1
- package/dist/internal/task-command.d.ts.map +1 -1
- package/dist/internal/task-command.js +40 -10
- package/dist/internal/task-command.js.map +1 -1
- package/dist/internal/update-notifier.d.ts +10 -2
- package/dist/internal/update-notifier.d.ts.map +1 -1
- package/dist/internal/update-notifier.js +13 -6
- package/dist/internal/update-notifier.js.map +1 -1
- package/dist/internal/version.d.ts +10 -0
- package/dist/internal/version.d.ts.map +1 -1
- package/dist/internal/version.js +17 -6
- package/dist/internal/version.js.map +1 -1
- package/dist/internal/views.d.ts +57 -0
- package/dist/internal/views.d.ts.map +1 -0
- package/dist/internal/views.js +570 -0
- package/dist/internal/views.js.map +1 -0
- package/dist/root.d.ts.map +1 -1
- package/dist/root.js +4 -1
- package/dist/root.js.map +1 -1
- package/package.json +3 -3
- package/skills/meshy-cli/SKILL.md +11 -3
package/dist/root.js
CHANGED
|
@@ -122,7 +122,7 @@ GLOBAL FLAGS (accepted at any position in the command line):
|
|
|
122
122
|
--base-url-v1 <url> override MESHY_BASE_URL_V1
|
|
123
123
|
--base-url-v2 <url> override MESHY_BASE_URL_V2
|
|
124
124
|
--base-url-creative-lab <url> override the Creative Lab base (default: <v1 origin>/openapi/creative-lab)
|
|
125
|
-
--format <fmt> json
|
|
125
|
+
--format <fmt> pretty on a terminal, json when piped | json | pretty | ndjson
|
|
126
126
|
--output-schema <s> legacy (default for existing commands) | v1 (stable envelope; new commands)
|
|
127
127
|
--output, -o <path> download task artifacts to a file or directory,
|
|
128
128
|
write meta.json alongside, and replace stdout
|
|
@@ -207,8 +207,11 @@ export function buildRootCommand() {
|
|
|
207
207
|
// unified exit in index.ts instead of Commander's own process.exit(1), so
|
|
208
208
|
// every command in the tree throws CommanderError. addCommand() does not
|
|
209
209
|
// inherit this setting, hence the walk.
|
|
210
|
+
// The same exit is the only place an error is printed: Commander's own
|
|
211
|
+
// `error: …` line would otherwise appear twice (its copy, then ours).
|
|
210
212
|
walkCommands(program, (cmd) => {
|
|
211
213
|
cmd.exitOverride();
|
|
214
|
+
cmd.configureOutput({ outputError: () => { } });
|
|
212
215
|
});
|
|
213
216
|
return program;
|
|
214
217
|
}
|
package/dist/root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sourceRoot":"","sources":["../src/root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,YAAY,GACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa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QAChB,eAAe;QACf,gBAAgB;QAChB,qBAAqB;QACrB,aAAa;QACb,cAAc;QACd,aAAa;QACb,cAAc;QACd,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,mBAAmB;QACnB,sBAAsB;QACtB,0BAA0B;QAC1B,yBAAyB;QACzB,aAAa;QACb,eAAe;QACf,kBAAkB;QAClB,uBAAuB;QACvB,gBAAgB;QAChB,eAAe;QACf,cAAc;QACd,cAAc;QACd,WAAW;QACX,aAAa;QACb,aAAa;KACd,EAAE,CAAC;QACF,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,2EAA2E;IAC3E,2EAA2E;IAC3E,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;QACnE,MAAM,iBAAiB,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,gCAAgC,CAAC,OAAO,CAAC,CAAC;IAE1C,yEAAyE;IACzE,0EAA0E;IAC1E,yEAAyE;IACzE,wCAAwC;IACxC,uEAAuE;IACvE,sEAAsE;IACtE,YAAY,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QAC5B,GAAG,CAAC,YAAY,EAAE,CAAC;QACnB,GAAG,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshy-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Official command-line interface for the Meshy AI API — text-to-3D, image-to-3D, text-to-motion, remesh, UV unwrap, rigging, animate, retexture, 2D images, multi-color print, Creative Lab, balance — plus selective downloads, project folders, face checks, OBJ print preparation and slicer launch.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"skills"
|
|
41
41
|
],
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=22.12.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsc",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"zod": "^4.5.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@types/node": "^
|
|
62
|
+
"@types/node": "^22.20.4",
|
|
63
63
|
"tsx": "^4.23.12",
|
|
64
64
|
"typescript": "^7.0.2"
|
|
65
65
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: meshy-cli
|
|
3
3
|
description: "Generate 3D models, motion clips, 2D images and Creative Lab print products with the Meshy API through the meshy-cli command — text-to-3D, image-to-3D, text-to-motion, remesh, UV unwrap, rigging, animation, retexture, printability, selective downloads, project folders, face checks, OBJ print preparation and slicer launch. Use for any Meshy asset or 3D-printing request."
|
|
4
4
|
license: MIT
|
|
5
|
-
compatibility: Requires meshy-cli on PATH (Node
|
|
5
|
+
compatibility: Requires meshy-cli on PATH (Node 22.12+, no Python) and a stored credential, MESHY_API_KEY or --api-key-file for API commands; network access to api.meshy.ai. Local helpers work offline.
|
|
6
6
|
metadata:
|
|
7
7
|
version: "1.1.0"
|
|
8
8
|
cli-help: "meshy --help"
|
|
@@ -22,9 +22,17 @@ network; `meshy doctor --check-api` makes one free balance call.
|
|
|
22
22
|
|
|
23
23
|
## Always ask for the stable envelope
|
|
24
24
|
|
|
25
|
-
Add `--output-schema v1 --format json` to every command you parse.
|
|
25
|
+
Add `--output-schema v1 --format json` to every command you parse. `--format` is
|
|
26
|
+
not optional politeness: untyped, it renders `pretty` for a human at a terminal
|
|
27
|
+
and `json` everywhere else. You will almost always be on the `json` side — a
|
|
28
|
+
subprocess pipe is not a TTY — and a typed `--output-schema v1` alone already
|
|
29
|
+
means JSON even in a pseudo-terminal, but say both and the shape is yours
|
|
30
|
+
regardless of how you are spawned. `pretty` is a human view that drops fields,
|
|
31
|
+
so never parse it. `json` and `ndjson` never carry terminal colour codes, so
|
|
32
|
+
you never need to strip escapes. stdout is then
|
|
26
33
|
exactly one JSON object with six keys — `schema_version, command, ok, result,
|
|
27
|
-
error, warnings` — and nothing else
|
|
34
|
+
error, warnings` — and nothing else. Progress goes to stderr as plain lines
|
|
35
|
+
(none under `ndjson`); it is for people, so read ids from stdout, not from it. `ok` is whether the
|
|
28
36
|
CLI operation completed; `result.task.status` is the server's task state (a `get`
|
|
29
37
|
of a FAILED task is `ok:true`). Fields the server did not send are `null` —
|
|
30
38
|
never treat a `null` `face_count` or `consumed_credits` as 0. `error.code` and
|