godot-cli 0.38.0 → 0.39.1
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/CHANGELOG.md +105 -0
- package/README.md +139 -16
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +7 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/check.d.ts +2 -0
- package/dist/commands/check.js +48 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/close.d.ts +3 -0
- package/dist/commands/close.js +82 -27
- package/dist/commands/close.js.map +1 -1
- package/dist/commands/commands.d.ts +3 -0
- package/dist/commands/commands.js +28 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/commands/exec.js +43 -28
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/export.d.ts +2 -0
- package/dist/commands/export.js +45 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/headless-common.d.ts +29 -0
- package/dist/commands/headless-common.js +69 -0
- package/dist/commands/headless-common.js.map +1 -0
- package/dist/commands/import.d.ts +2 -0
- package/dist/commands/import.js +32 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/install-plugin.js.map +1 -1
- package/dist/commands/open.js +38 -6
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/rql.d.ts +2 -0
- package/dist/commands/rql.js +81 -0
- package/dist/commands/rql.js.map +1 -0
- package/dist/commands/run-script.d.ts +2 -0
- package/dist/commands/run-script.js +33 -0
- package/dist/commands/run-script.js.map +1 -0
- package/dist/commands/run-system-tool.js +0 -1
- package/dist/commands/run-system-tool.js.map +1 -1
- package/dist/commands/run-tool-builder.d.ts +38 -4
- package/dist/commands/run-tool-builder.js +179 -56
- package/dist/commands/run-tool-builder.js.map +1 -1
- package/dist/commands/run-tool.js +0 -1
- package/dist/commands/run-tool.js.map +1 -1
- package/dist/commands/setup-skills.js +3 -2
- package/dist/commands/setup-skills.js.map +1 -1
- package/dist/commands/status.js +25 -19
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/test.d.ts +5 -0
- package/dist/commands/test.js +111 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/tools.d.ts +2 -0
- package/dist/commands/tools.js +120 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commands/update.js +1 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/wait-for-ready.js +18 -20
- package/dist/commands/wait-for-ready.js.map +1 -1
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/build.d.ts +1 -1
- package/dist/lib/build.js +21 -4
- package/dist/lib/build.js.map +1 -1
- package/dist/lib/check.d.ts +44 -0
- package/dist/lib/check.js +191 -0
- package/dist/lib/check.js.map +1 -0
- package/dist/lib/cli-guide.d.ts +26 -0
- package/dist/lib/cli-guide.js +51 -0
- package/dist/lib/cli-guide.js.map +1 -0
- package/dist/lib/configure-agent.js.map +1 -1
- package/dist/lib/exec.d.ts +19 -0
- package/dist/lib/exec.js +61 -10
- package/dist/lib/exec.js.map +1 -1
- package/dist/lib/export-project.d.ts +41 -0
- package/dist/lib/export-project.js +159 -0
- package/dist/lib/export-project.js.map +1 -0
- package/dist/lib/godot-log.d.ts +38 -0
- package/dist/lib/godot-log.js +145 -0
- package/dist/lib/godot-log.js.map +1 -0
- package/dist/lib/godot-run.d.ts +34 -0
- package/dist/lib/godot-run.js +113 -0
- package/dist/lib/godot-run.js.map +1 -0
- package/dist/lib/headless.d.ts +82 -0
- package/dist/lib/headless.js +117 -0
- package/dist/lib/headless.js.map +1 -0
- package/dist/lib/import-project.d.ts +9 -0
- package/dist/lib/import-project.js +15 -0
- package/dist/lib/import-project.js.map +1 -0
- package/dist/lib/install-server.js.map +1 -1
- package/dist/lib/junit.d.ts +36 -0
- package/dist/lib/junit.js +146 -0
- package/dist/lib/junit.js.map +1 -0
- package/dist/lib/list-tools.d.ts +51 -0
- package/dist/lib/list-tools.js +147 -0
- package/dist/lib/list-tools.js.map +1 -0
- package/dist/lib/open.js +3 -1
- package/dist/lib/open.js.map +1 -1
- package/dist/lib/progress.d.ts +1 -7
- package/dist/lib/progress.js +2 -15
- package/dist/lib/progress.js.map +1 -1
- package/dist/lib/rql.d.ts +32 -0
- package/dist/lib/rql.js +105 -0
- package/dist/lib/rql.js.map +1 -0
- package/dist/lib/run-script.d.ts +23 -0
- package/dist/lib/run-script.js +43 -0
- package/dist/lib/run-script.js.map +1 -0
- package/dist/lib/run-tests.d.ts +50 -0
- package/dist/lib/run-tests.js +181 -0
- package/dist/lib/run-tests.js.map +1 -0
- package/dist/lib/run-tool.js +6 -22
- package/dist/lib/run-tool.js.map +1 -1
- package/dist/lib/session.d.ts +8 -1
- package/dist/lib/session.js +36 -4
- package/dist/lib/session.js.map +1 -1
- package/dist/lib/setup-skills.d.ts +8 -13
- package/dist/lib/setup-skills.js +27 -24
- package/dist/lib/setup-skills.js.map +1 -1
- package/dist/lib/types.d.ts +7 -0
- package/dist/lib/update-project.js +1 -1
- package/dist/lib/update-project.js.map +1 -1
- package/dist/lib.d.ts +16 -0
- package/dist/lib.js +10 -0
- package/dist/lib.js.map +1 -1
- package/dist/utils/addon-deps.js +2 -2
- package/dist/utils/agents.d.ts +2 -6
- package/dist/utils/agents.js.map +1 -1
- package/dist/utils/cloud-login.js.map +1 -1
- package/dist/utils/connection.d.ts +59 -0
- package/dist/utils/connection.js +11 -10
- package/dist/utils/connection.js.map +1 -1
- package/dist/utils/csproj-deps.js +1 -1
- package/dist/utils/csproj-deps.js.map +1 -1
- package/dist/utils/editor-connection.d.ts +74 -0
- package/dist/utils/editor-connection.js +225 -0
- package/dist/utils/editor-connection.js.map +1 -0
- package/dist/utils/editor-mcp-server.d.ts +32 -0
- package/dist/utils/editor-mcp-server.js +134 -0
- package/dist/utils/editor-mcp-server.js.map +1 -0
- package/dist/utils/exit-codes.d.ts +2 -0
- package/dist/utils/exit-codes.js +4 -0
- package/dist/utils/exit-codes.js.map +1 -0
- package/dist/utils/extensions-catalog.js.map +1 -1
- package/dist/utils/godot-editor.d.ts +1 -1
- package/dist/utils/godot-editor.js.map +1 -1
- package/dist/utils/godot-process.d.ts +5 -0
- package/dist/utils/godot-process.js +16 -0
- package/dist/utils/godot-process.js.map +1 -1
- package/dist/utils/godot-shutdown.d.ts +3 -1
- package/dist/utils/godot-shutdown.js +4 -2
- package/dist/utils/godot-shutdown.js.map +1 -1
- package/dist/utils/input.d.ts +3 -3
- package/dist/utils/input.js +22 -35
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/machine-store.js.map +1 -1
- package/dist/utils/output.d.ts +45 -0
- package/dist/utils/output.js +101 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/project-godot.js.map +1 -1
- package/dist/utils/server-source.d.ts +1 -1
- package/dist/utils/server-source.js +1 -1
- package/dist/utils/server-source.js.map +1 -1
- package/dist/utils/skill-guides.d.ts +8 -11
- package/dist/utils/skill-guides.js +100 -43
- package/dist/utils/skill-guides.js.map +1 -1
- package/dist/utils/skills.d.ts +1 -14
- package/dist/utils/skills.js +0 -89
- package/dist/utils/skills.js.map +1 -1
- package/dist/utils/ui.d.ts +6 -1
- package/dist/utils/ui.js +72 -58
- package/dist/utils/ui.js.map +1 -1
- package/dist/utils/update-check.d.ts +6 -17
- package/dist/utils/update-check.js +10 -77
- package/dist/utils/update-check.js.map +1 -1
- package/package.json +9 -9
- package/dist/utils/json-parse.d.ts +0 -25
- package/dist/utils/json-parse.js +0 -83
- package/dist/utils/json-parse.js.map +0 -1
- package/dist/utils/semver.d.ts +0 -4
- package/dist/utils/semver.js +0 -25
- package/dist/utils/semver.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,111 @@ All notable changes to `godot-cli` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
- **Dependencies:** commander 15, chalk 6, yocto-spinner 1.2.2; dev: TypeScript 7 (native compiler), vitest 5.
|
|
8
|
+
Two visible changes, both from commander: a call with too many arguments now names them
|
|
9
|
+
(`error: too many arguments for 'check'. Expected 1 argument but got 2: a, b.`), and a negative number such as `-5` is
|
|
10
|
+
read as an argument (`exec -1`, `rql --schema -1`, `run-script x.gd -5`) instead of failing with `unknown option '-5'`.
|
|
11
|
+
commander 15 and chalk 6 declare
|
|
12
|
+
Node.js >= 22.12 / >= 22; `@baizor/gamedev-cli-core` already required Node.js >= 22.14.
|
|
13
|
+
- **A connection dropped mid-call exits 7 `UNREACHABLE`.** A socket the server took and then closed — before the
|
|
14
|
+
answer's headers, in the middle of its body, a reset (`ECONNRESET`, `EPIPE`, undici's `UND_ERR_SOCKET` "other side
|
|
15
|
+
closed" / "terminated") — now fails `run-tool`, `run-system-tool`, `exec`, `rql` and `tools` with exit **7** `UNREACHABLE`
|
|
16
|
+
(`connection-reset`), the same in all three engine CLIs (one helper, `networkFailureReason` of
|
|
17
|
+
`@baizor/gamedev-cli-core` ^0.11.1). It was exit 1 `ERROR`, and a body cut off after a 200 was read as an empty
|
|
18
|
+
answer. A connect timeout or an unreachable host (`ETIMEDOUT`, `EHOSTUNREACH`, `ENETUNREACH`) is exit 7 too (was 1).
|
|
19
|
+
`tools` fails the same way (exit 7) when no cached list exists: a server that dropped the connection is no longer
|
|
20
|
+
answered with the built-in list, which stays for an editor that is not running.
|
|
21
|
+
- **One failure table shared with `unity-mcp-cli` and `unreal-mcp-cli`.** A failed `run-tool`, `run-system-tool`,
|
|
22
|
+
`exec`, `rql` or `tools` call is classified by `classifyToolFailure` of `@baizor/gamedev-cli-core` ^0.11.0, so all
|
|
23
|
+
three engine CLIs give the same exit code and error code (table in the README, `errorCodes` in
|
|
24
|
+
`commands --format json`). The envelope error carries the server's HTTP status: `errors[{code, message, httpStatus}]`.
|
|
25
|
+
Behaviour changes:
|
|
26
|
+
- HTTP 404 (no such tool): exit **2** `NOT_FOUND` (was 6 `TOOL_FAILED`); `tools <name>` with no such tool: exit **2**
|
|
27
|
+
`NOT_FOUND` (was 6).
|
|
28
|
+
- HTTP 401 / 403: exit 6 `NOT_AUTHENTICATED` (was 6 `TOOL_FAILED`).
|
|
29
|
+
- HTTP 400 and any other 4xx: exit **2** `USAGE` (was 6 `TOOL_FAILED`); a 422 whose error starts with
|
|
30
|
+
`[invalid_params]` is `USAGE` too.
|
|
31
|
+
- HTTP 408: exit 14 `TIMEOUT`; HTTP 429: exit 17 `BUSY` (were 6 `TOOL_FAILED`).
|
|
32
|
+
- HTTP 503 whose error says no engine plugin is connected: exit **7** `UNREACHABLE` (was 17 `BUSY`).
|
|
33
|
+
- An editor start that waited out another CLI call's start lock: exit **17** `BUSY` (was 7 `UNREACHABLE`).
|
|
34
|
+
- A path that does not exist or is not a Godot project (no `project.godot`): error code `NOT_FOUND` (was `USAGE`;
|
|
35
|
+
exit 2 either way).
|
|
36
|
+
- **`close` stops the editor's local MCP server too.** The addon runs `gamedev-mcp-server` as a child of the editor and
|
|
37
|
+
stops it when the editor quits cleanly, but `close --force` hard-kills a GUI editor without its children, so the
|
|
38
|
+
server kept running. `close` now notes the servers in that editor's process tree before closing it (by parentage, not
|
|
39
|
+
by command line) and, once the editor is gone, kills each one still running with the processes it started, after
|
|
40
|
+
checking its PID still names the same process. Another project's or editor's server is never touched.
|
|
41
|
+
- **ReflectorNet 5.5.2.** The `install-plugin` fallback pin (addons without `nuget-deps.json`) follows the addon: its
|
|
42
|
+
reflection caches no longer reserve storage for their full capacity up front (about 1 MB less per converter).
|
|
43
|
+
- **`run-tool` no longer prints a screenshot's base64 in text mode.** A tool answer with an image fell back to the whole
|
|
44
|
+
response JSON, so one `screenshot-viewport` call wrote about 2 MB to stdout. The JSON now names the image's size
|
|
45
|
+
instead of its data; `--format json` and `--raw` keep the data, and a screenshot tool's `savePath` writes a file.
|
|
46
|
+
- **`setup-skills` writes a cold-start `godot-cli` skill** instead of the outdated install guide and the ten
|
|
47
|
+
hand-written tool-family skills: no `status` / `run-tool rql-schema` first, `rql` recipes, `check` / `test`,
|
|
48
|
+
`--format json` and the exit codes, with `references/rql.md` and `references/install.md` for depth. Offline, from
|
|
49
|
+
the same source as the root `--help` (`src/lib/cli-guide.ts`). The `godot-mcp*` skills of earlier versions are
|
|
50
|
+
removed; the addon's own install guide is now `godot-cli-install`, so the editor no longer overwrites `godot-cli`.
|
|
51
|
+
The skill shows every `rql` recipe, among them a Godot property or script variable by name (`props["..."]`);
|
|
52
|
+
`references/rql.md` holds the language. Its description says it is for editor work and that editing scripts alone
|
|
53
|
+
needs only `check`.
|
|
54
|
+
- **`rql '<query>'`: one RQL query without JSON quoting.** A query ending in `set` / `call` goes to `rql-mutate`
|
|
55
|
+
(`--dry-run`, `--max-targets`), any other to `rql-query`; `--schema [type]` runs `rql-schema`; `-f <file>` / `-f -`
|
|
56
|
+
reads the query. After a save (`SaveScene()`, `NewScene(...)`, resource edits) it lists the files written, and an
|
|
57
|
+
operator spelled as in another language (`startsWith`, `like`) gets a hint.
|
|
58
|
+
- **`run-tool` text mode prints the answer alone**: a text answer as its text, without the heading, the Tool / URL /
|
|
59
|
+
Auth lines, the divider and the spinner lines (`--verbose` adds the endpoint; status lines go to stderr; `--raw` and
|
|
60
|
+
`--format json` are unchanged).
|
|
61
|
+
- **A shorter root `--help` (5.7 KB -> 1.7 KB)**: the everyday commands, the other command names and seven RQL recipes;
|
|
62
|
+
a subcommand's help starts with a plain line instead of a box.
|
|
63
|
+
- **The exit codes, `--format`, the result envelope, the `commands` manifest and the local-server fallback rule
|
|
64
|
+
now come from `@baizor/gamedev-cli-core` 0.9.0** (one contract for the three engine CLIs). `commands --format json` lists the commands in registration order, adds `globalOptions` and option `choices`, leaves out hidden options (`close --url`) and has reworded exit-code descriptions; `--format` is trimmed, the last one on the command line wins (up to `--`), and a bad value reports `--format must be one of: …`; a `UsageError` reaching the entry point exits 2 (`USAGE`); the envelope is written synchronously, and a json/ndjson command that exits without one still leaves one on stdout. An unreadable
|
|
65
|
+
sign-in no longer prints PowerShell's DPAPI exception, and a forced close of an editor godot-cli started also kills its
|
|
66
|
+
child processes.
|
|
67
|
+
- **`tools [name]`** lists the editor's AI tools (MCP `tools/list`, starting a headless editor when none answers; cached in
|
|
68
|
+
`.ai-game-dev/tools.json`), and with a name shows its arguments and an example `run-tool` call. A tool that does not
|
|
69
|
+
exist (HTTP 404) now prints the server's error and points to `godot-cli tools`; the raw response only with `--verbose`.
|
|
70
|
+
The root `--help` ends with the everyday workflow.
|
|
71
|
+
- **`open` on a machine that never signed in** gives the editor the project's local server (Custom, the plugin starts
|
|
72
|
+
it; in memory, nothing is persisted) instead of a Cloud connection that cannot work, so `wait-for-ready` / `run-tool`
|
|
73
|
+
reach it. `status` and `wait-for-ready` follow the project's connection mode like `run-tool`.
|
|
74
|
+
- **A signed-in machine is never switched to a local server.** On a Cloud project, `open --headless` (and the
|
|
75
|
+
auto-start of `run-tool` / `tools`) no longer starts an editor on the project's local server: a sign-in that cannot be
|
|
76
|
+
used fails with its sign-in message (exit 6), a working one says to use `open`, `run-tool` and `exec`, which go
|
|
77
|
+
through ai-game.dev (exit 6). A windowed `open` with an unusable sign-in also exits 6 instead of starting an editor
|
|
78
|
+
on a connection it cannot use. `exec` calls a non-local `--url` / `GODOT_MCP_HOST` directly instead of starting an
|
|
79
|
+
editor on the local port, and `GODOT_MCP_CLOUD_URL` no longer turns a Custom project into a Cloud one.
|
|
80
|
+
- **`close` closes an editor godot-cli started** through its plugin (as `--owned-only` does) instead of a window close it
|
|
81
|
+
cannot receive. For an editor run by the `_console` build (no window of its own), a plain `close` asks the editor window
|
|
82
|
+
it runs to quit; **`close --force`** stops such an editor and its child process; `close` and `setup-skills` accept `--path`.
|
|
83
|
+
- **A C# build that fails before an editor start** is reported as its compiler errors (`file(line,col): error CS…`), and
|
|
84
|
+
an editor that never became ready points to `godot-cli check`.
|
|
85
|
+
|
|
86
|
+
- **Headless commands that judge Godot by its log, not its exit code** (an `--import` with a GDScript parse error or an
|
|
87
|
+
addon that fails to load still exits 0). `check [path] [--strict]`: a CI gate without an editor (import, `dotnet
|
|
88
|
+
build`, editor boot with the addon's load marker, a load of every GDScript) reporting `res://file:line` and
|
|
89
|
+
`file(line,col): error CS…`. `test [path]`: GUT or gdUnit4, headless, hard timeout, verdict from the JUnit report
|
|
90
|
+
cross-checked with the log (a test script that fails to load does not pass); `--filter`, `--output`, `--format github`.
|
|
91
|
+
`export <preset> <output> [--debug|--pack]`: checks the templates first and the output file and log afterwards.
|
|
92
|
+
`import [path]`, and `run-script <file.gd>` (one-shot `SceneTree` script, exit from `quit(code)`). They refuse a
|
|
93
|
+
project open in an editor (`PROJECT_OPEN`, `--allow-open` overrides). Library: `checkProject`, `importProject`,
|
|
94
|
+
`runTests`, `exportProject`, `runScript`, `parseGodotLog`, `parseJUnit`.
|
|
95
|
+
- **Exit codes and `--format` shared with unity-mcp-cli and unreal-mcp-cli.** 0 success, 1 unclassified, 2 usage
|
|
96
|
+
(also unknown options, which exited 1), 6 command failed (a tool answering `status: "error"` or an HTTP error
|
|
97
|
+
other than 502/503/504, script or compilation errors), 7 unreachable (was 1; also HTTP 502), 8 tests failed (a
|
|
98
|
+
suite-level setup/teardown failure counts), 14 timeout (`wait-for-ready` timed out with 1; also HTTP 504), 17 busy
|
|
99
|
+
(HTTP 503), 18 awaiting input. A headless run stopped by Ctrl+C / SIGTERM kills the Godot process tree and exits 1.
|
|
100
|
+
`--format text|json|ndjson` on `run-tool`, `run-system-tool`, `exec`, `status`, `wait-for-ready` and the new
|
|
101
|
+
commands: one `{success, command, data, errors, warnings}` envelope on stdout (also for argument errors), logs on
|
|
102
|
+
stderr (ndjson: one JSON event per line). `commands [--format json]` prints a manifest of every command, its
|
|
103
|
+
arguments and options, and the exit codes.
|
|
104
|
+
- **`run-tool`, `run-system-tool` and `exec` follow the project's connection mode.** Without `--url` / env / marker they
|
|
105
|
+
read the mode the addon uses (env, project `.env`, persisted config, default Cloud): Cloud goes to ai-game.dev with
|
|
106
|
+
the sign-in; a machine that never signed in falls back to the project's local server with a warning; a sign-in that
|
|
107
|
+
cannot be used fails with `NOT_AUTHENTICATED` (exit 6) instead of switching to a local server.
|
|
108
|
+
- **`run-tool` / `run-system-tool` start a headless editor** when the call is refused on the project's local server,
|
|
109
|
+
like `exec` (a running editor is reused and never closed). `--no-start` turns it off; `--once` closes the editor
|
|
110
|
+
afterwards when this call started it; `--no-build`, `--editor-path`, `--ready-timeout`.
|
|
111
|
+
|
|
7
112
|
- **`update` updates everything.** `update [path]` brings the project's addon and installed extensions to their latest
|
|
8
113
|
versions, then updates the CLI itself (it used to update only the CLI). From a subfolder it finds the project; outside a
|
|
9
114
|
project it updates only the CLI. `--check` reports (exit 2 when something is outdated); `--no-self`, `--no-project` and
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ The CLI is the Godot analog of [`unity-mcp-cli`](https://www.npmjs.com/package/u
|
|
|
43
43
|
- :white_check_mark: **Status check** — detect a running Godot editor and probe MCP-server health
|
|
44
44
|
- :white_check_mark: **Run tools** — execute MCP and system tools directly over the server's HTTP API
|
|
45
45
|
- :white_check_mark: **Setup MCP** — write AI-agent MCP-client config for any supported agent
|
|
46
|
-
- :white_check_mark: **Setup skills** —
|
|
46
|
+
- :white_check_mark: **Setup skills** — write the cold-start `godot-cli` agent skill locally (no live editor required)
|
|
47
47
|
- :white_check_mark: **Wait for ready** — poll until the Godot MCP server answers `ping`
|
|
48
48
|
- :white_check_mark: **Cross-platform** — Windows, macOS, and Linux
|
|
49
49
|
- :white_check_mark: **Library API** — a side-effect-free, typed library surface for embedding
|
|
@@ -89,15 +89,23 @@ npx godot-cli install-plugin /path/to/godot/project
|
|
|
89
89
|
| `open [path]` | Build the project's C# assembly (so the addon loads on first open — see below), resolve the Godot editor binary, and launch `--editor --path <project>` with `GODOT_MCP_*` connection env vars. `--no-build` skips the build. `--headless` starts a windowless editor session instead (see [`exec`](#exec)). |
|
|
90
90
|
| `exec [code]` | Run C# in the editor through `script-execute` (see [`exec`](#exec)): reuses a running editor, otherwise starts a headless one and keeps it warm. |
|
|
91
91
|
| `build [path]` | Build the project's C# assembly (`dotnet build`) so the `godot_mcp` addon loads on the next editor open. GDScript-only projects (no `.csproj`) are a no-op. This is the same build `open` runs before launching. |
|
|
92
|
-
| `run-
|
|
93
|
-
| `run-
|
|
92
|
+
| `rql [query]` | One RQL query from the command line, no JSON: `godot-cli rql 'nodes \| where name starts-with "Tree" \| count'`. A query whose last stage is `set` or `call` goes to `rql-mutate` (`--dry-run`, `--max-targets <n>`), any other to `rql-query`; `--schema [type]` runs `rql-schema`; `-f <file>` (`-f -`: stdin) reads the query when a shell strips its quotes. Starts a headless editor like `run-tool`. After `SaveScene()`, `NewScene(...)`, `CreateResource(...)` or a `godot.resource(...)` edit it prints the files written (`Saved to disk: res://scenes/forest.tscn`); an operator spelled as in another language (`startsWith`, `like`) gets a hint with RQL's spelling. `rql --help` lists recipes. |
|
|
93
|
+
| `run-tool <tool> [path]` | POST to `<url>/api/tools/<tool>` with JSON input. Text mode prints a text answer as its text (`--raw`: the response JSON; `--verbose`: also the endpoint). When no editor answers on the project's local server it starts a headless one like `exec` (`--no-start` disables; `--once` closes it after the call). |
|
|
94
|
+
| `run-system-tool <tool> [path]` | POST to `<url>/api/system-tools/<tool>` (tools not exposed to MCP clients). Same auto-start as `run-tool`. |
|
|
95
|
+
| `check [path]` | CI gate without a running editor: import, `dotnet build`, editor boot and a GDScript load check, judged from the logs (see [headless commands](#headless-commands-check-import-test-export-run-script)). |
|
|
96
|
+
| `import [path]` | `godot --headless --import`, failing on import and script errors in the log. |
|
|
97
|
+
| `test [path]` | Run the project's GUT or gdUnit4 tests headless with a hard timeout; verdict from the JUnit report and the log. |
|
|
98
|
+
| `export <preset> <output>` | Export a preset headless (`--debug`, `--pack`); checks the export templates first and the output afterwards. |
|
|
99
|
+
| `run-script <script> [args...]` | Run a one-shot `SceneTree` GDScript (`godot --headless -s`); exit 0 only after `quit(0)`. |
|
|
100
|
+
| `commands` | Machine-readable manifest of every command, its arguments and options, and the exit codes (`--format json`). |
|
|
101
|
+
| `tools [name]` | The editor's AI tools (MCP `tools/list`; starts a headless editor when none answers, caches the list in `.ai-game-dev/tools.json`, git-ignored). With a name: its description, arguments and an example `run-tool` call. `--refresh` asks the editor again; `--no-start` uses the cache or the built-in list. |
|
|
94
102
|
| `status [path]` | Detect a running Godot editor for the project and probe MCP-server health. |
|
|
95
103
|
| `wait-for-ready [path]` | Poll the MCP server until it answers `ping`. |
|
|
96
104
|
| `login [path]` | Authenticate with the ai-game.dev cloud via the OAuth 2.1 device-authorization flow (RFC 8628) — opens a browser, then saves a cloud credential to the shared machine store (`~/.ai-game-dev/credentials.json`) the editor plugin auto-adopts. See the `login` section below for its `--project` / `--base-url` / `--force` / `--tools-only` / `--yes` flags. |
|
|
97
105
|
| `setup-mcp <agent> [path]` | Write the agent's MCP-client config pointing at the project-pinned `<host>/mcp/p/<pin>` URL (so the agent routes to *this* project's editor). In Cloud mode the config carries this project's key (`Authorization: Bearer agd_pk_…`). Add `--no-pin` for the bare `<host>/mcp` URL, `--oauth` for a URL-only config, `--regenerate-key` to replace the key. |
|
|
98
|
-
| `setup-skills <agent> [path]` |
|
|
106
|
+
| `setup-skills <agent> [path]` | Write the `godot-cli` agent skill (cold-start workflow, RQL recipes, exit codes) and `ai-game-dev-app` under the agent's skills path, offline. `--list` shows each agent's skills support. |
|
|
99
107
|
| `configure [path]` | List / show / hide tools, prompts, and resources in the project-local `.godot-mcp/features.json` (`--enable-*` shows, `--disable-*` hides; a hidden tool still runs when called by name). |
|
|
100
|
-
| `close [path]` | Gracefully stop the Godot editor running for a project (`--force` to hard-kill). `--owned-only` closes only an editor `godot-cli` started (`exec` / `open --headless`). |
|
|
108
|
+
| `close [path]` | Gracefully stop the Godot editor running for a project (`--force` to hard-kill). Also stops the local MCP server that editor ran, if it outlived it. `--owned-only` closes only an editor `godot-cli` started (`exec` / `open --headless`). |
|
|
101
109
|
| `install-plugin [path]` | Install the `godot_mcp` addon end-to-end: materialize `res://addons/godot_mcp/` (download the matching GitHub release, or `--source <path>` a local copy), add the NuGet `PackageReference`s the installed addon needs + the extension-catalog `<EmbeddedResource>` to the project `.csproj`, and enable the plugin. Idempotent. |
|
|
102
110
|
| `install-extension <id> [path]` | Install a Godot-MCP **extension** (an optional RQL-module package) into the project: resolve `<id>` from the shared catalog, add/update its `<PackageReference>` in the project `.csproj`, then rebuild to restore. Idempotent — behaviorally identical to the in-editor dock. |
|
|
103
111
|
| `remove-plugin [path]` | Disable the `godot_mcp` addon in `project.godot` `[editor_plugins]` (does not delete the addon files). |
|
|
@@ -164,6 +172,17 @@ The cloud paths carry the `/mcp` hub segment so the request reaches the hub rath
|
|
|
164
172
|
backend (which serves no `/api/tools/*`). Pass `--url http://localhost:<port>` to target a
|
|
165
173
|
local/self-hosted server explicitly.
|
|
166
174
|
|
|
175
|
+
`run-tool`, `run-system-tool` and `exec` replace step 6 with the **project's connection mode**, read the way the addon
|
|
176
|
+
reads it (`GODOT_MCP_CONNECTION_MODE`, the project's `.env`, the persisted `user://godot-mcp-config.json`, else Cloud,
|
|
177
|
+
the addon's default). Custom mode uses the local server above. Cloud mode uses the cloud hub with the machine's sign-in
|
|
178
|
+
(no editor is started: only an editor connected to ai-game.dev answers). If this machine has **never** signed in to
|
|
179
|
+
ai-game.dev, the project's local server is used instead, with a warning (an editor started now serves it; nothing is
|
|
180
|
+
persisted). A sign-in that exists but cannot be used (expired, revoked, unreadable) is an error (exit 6,
|
|
181
|
+
`NOT_AUTHENTICATED`): a signed-in machine is never switched to a local server. The same holds for `open`, `tools` and
|
|
182
|
+
`open --headless`: on a Cloud project of a signed-in machine `open --headless` starts no editor and exits 6 (use `open`,
|
|
183
|
+
`run-tool` and `exec`, which go through ai-game.dev). An explicit `--url` / `--token` is used as is; a non-local
|
|
184
|
+
`--url` / `GODOT_MCP_HOST` is called directly by `exec` and refused by `open --headless` (a headless editor is local).
|
|
185
|
+
|
|
167
186
|

|
|
168
187
|
|
|
169
188
|
## `exec`
|
|
@@ -178,7 +197,7 @@ godot-cli exec 'Helper.Twice(21)' --include helpers # .cs files/folders un
|
|
|
178
197
|
|
|
179
198
|
The code is plain statements; the last expression is the result. The output is the value (`Type: value`) and,
|
|
180
199
|
under `logs:`, what the code printed (`Console`; `GD.Print` / push_warning / push_error with Godot.NET.Sdk 4.5+). A compile error points
|
|
181
|
-
at the snippet's line (`snippet.cs(2,12)`) and exits
|
|
200
|
+
at the snippet's line (`snippet.cs(2,12)`) and exits 6.
|
|
182
201
|
|
|
183
202
|
- **A running editor of the project** (yours, with a window, or one `godot-cli` started) is reused and never closed.
|
|
184
203
|
Yours must serve the project's **local** server (dock: Custom mode, server started).
|
|
@@ -201,6 +220,105 @@ call that starts the editor. Both files are listed in `<project>/.ai-game-dev/.g
|
|
|
201
220
|
server's 5-minute `tool-timeout`),
|
|
202
221
|
`--no-build`, `--editor-path`, `--token`, `--raw`.
|
|
203
222
|
|
|
223
|
+
`run-tool` / `run-system-tool` follow the same policy when the call is refused on a **local** URL of a Godot project:
|
|
224
|
+
they start a headless editor (building C# first unless `--no-build`), then retry. A running editor is reused and never
|
|
225
|
+
closed; `--once` closes the editor afterwards only when this call started it. `--no-start` turns this off, and a cloud
|
|
226
|
+
or remote URL never starts anything. Options: `--editor-path`, `--ready-timeout <ms>`.
|
|
227
|
+
|
|
228
|
+
## Exit codes and output formats
|
|
229
|
+
|
|
230
|
+
Exit codes are shared with `unity-mcp-cli` and `unreal-mcp-cli` (`godot-cli commands --format json` lists them):
|
|
231
|
+
|
|
232
|
+
| Code | Meaning |
|
|
233
|
+
| --- | --- |
|
|
234
|
+
| 0 | Success |
|
|
235
|
+
| 1 | Generic or unclassified error; also a run interrupted by Ctrl+C / SIGTERM (the Godot process tree is killed) |
|
|
236
|
+
| 2 | Usage error: unknown command or option, bad flag value or argument, an unknown tool (`NOT_FOUND`) (`--help` / `--version` exit 0) |
|
|
237
|
+
| 6 | The command ran and failed: the tool returned an error, script or compilation errors, no test verdict, refused credentials |
|
|
238
|
+
| 7 | The editor or MCP server is unreachable (also HTTP 502) |
|
|
239
|
+
| 8 | Tests ran and at least one failed (a suite-level setup/teardown failure counts) |
|
|
240
|
+
| 14 | Timeout (also HTTP 408 / 504) |
|
|
241
|
+
| 17 | The server is busy (HTTP 503 / 429); the call was not executed |
|
|
242
|
+
| 18 | The editor is blocked by a modal dialog (reserved: not detectable in a headless Godot) |
|
|
243
|
+
|
|
244
|
+
`update --check` still exits 2 when something is outdated.
|
|
245
|
+
|
|
246
|
+
**A tool call that did not succeed** (`run-tool`, `run-system-tool`, `exec`, `rql`, `tools`) maps to the same exit code
|
|
247
|
+
and error code in all three CLIs (the table lives in `@baizor/gamedev-cli-core`; `commands --format json` lists it as
|
|
248
|
+
`errorCodes`). When the MCP server answered, its HTTP status decides, and the envelope error carries it:
|
|
249
|
+
`errors[{code, message, httpStatus}]`.
|
|
250
|
+
|
|
251
|
+
| Condition | HTTP status | Exit | `errors[].code` |
|
|
252
|
+
|---|---|---|---|
|
|
253
|
+
| Bad arguments: a bad flag, tool arguments the CLI or the server rejected (any 4xx not listed here) | 400 (a 422 `[invalid_params]`) | `2` | `USAGE` |
|
|
254
|
+
| No tool by that name (list them with `tools`), or no project at the path | 404 | `2` | `NOT_FOUND` |
|
|
255
|
+
| No usable credentials, or the server refused them: sign in with `login` | 401, 403 | `6` | `NOT_AUTHENTICATED` |
|
|
256
|
+
| The tool ran and reported an error (`status: "error"`, any 5xx not listed here) | 409, 422, 500 | `6` | `TOOL_FAILED` |
|
|
257
|
+
| The project's code did not build, so no editor was started | — | `6` | `COMPILATION_FAILED` |
|
|
258
|
+
| Connection refused or reset, no engine plugin connected to the server, plugin lost after the call was sent | 502 | `7` | `UNREACHABLE` |
|
|
259
|
+
| No answer in time: `--timeout`, or the server's own tool timeout | 408, 504 | `14` | `TIMEOUT` |
|
|
260
|
+
| Busy and did not run the call (reloading, rate-limited, another CLI call holds the editor); retry later | 503, 429 | `17` | `BUSY` |
|
|
261
|
+
| Anything else (the call was aborted, an unexpected error) | — | `1` | `ERROR` |
|
|
262
|
+
|
|
263
|
+
`--format text|json|ndjson` (default `text`) is accepted by `run-tool`, `run-system-tool`, `exec`, `status`,
|
|
264
|
+
`wait-for-ready`, `check`, `import`, `test`, `export`, `run-script` and `commands`. `json` prints exactly one
|
|
265
|
+
envelope on stdout:
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{ "success": false, "command": "check", "data": { "...": "..." },
|
|
269
|
+
"errors": [{ "code": "SCRIPT_ERRORS", "message": "res://player.gd:12: error: Expected expression." }],
|
|
270
|
+
"warnings": [] }
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
`ndjson` prints events on stderr, one JSON object per line (`{"type":"progress","command":…,"message":…}`, and every
|
|
274
|
+
other line as `{"type":"log","command":…,"level":"info|error","message":…}`), and the envelope as one line on stdout.
|
|
275
|
+
In both, logs, spinners and headings go to stderr without colour. Error codes: `USAGE`, `TOOL_FAILED`, `UNREACHABLE`,
|
|
276
|
+
`TIMEOUT`, `BUSY`, `AWAITING_INPUT`, `TESTS_FAILED`, `TEST_RUN_ERROR`, `COMPILATION_FAILED`, `SCRIPT_ERRORS`,
|
|
277
|
+
`IMPORT_FAILED`, `PROJECT_OPEN`, `NOT_FOUND`, `EXPORT_FAILED`, `NOT_AUTHENTICATED`, `CLOUD_PROJECT`, `ERROR`. `--raw` keeps working as before.
|
|
278
|
+
|
|
279
|
+
## Headless commands (`check`, `import`, `test`, `export`, `run-script`)
|
|
280
|
+
|
|
281
|
+
These run Godot without an editor session and need no MCP server. Godot's exit code is not a verdict in headless mode
|
|
282
|
+
(an `--import` with a GDScript parse error, or an addon that fails to load, still exits 0), so each command judges the
|
|
283
|
+
run from its log (`SCRIPT ERROR`, `ERROR:`, `Parse Error`), a marker that proves the step ran, and the files it must
|
|
284
|
+
produce. Each process gets a hard `--timeout` (the whole Godot process tree is killed: exit 14). Logs and scratch
|
|
285
|
+
scripts go to `<project>/.godot/godot-cli/`. `check`, `import`, `test` and `export` refuse a project that is open in an
|
|
286
|
+
editor (exit 6, `PROJECT_OPEN`: an import fights that editor over `.godot/`); `--allow-open` overrides it, `close`
|
|
287
|
+
stops a `godot-cli` editor. The binary comes from `--editor-path`, `GODOT_BIN`, `PATH` or the usual install folders.
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
godot-cli check # 0 clean, 6 SCRIPT_ERRORS / COMPILATION_FAILED, 14 timeout
|
|
291
|
+
godot-cli check --strict # GDScript and C# compiler warnings fail too
|
|
292
|
+
godot-cli test --format github # ::error annotations; 0 pass, 8 failures, 6 no verdict / no runner
|
|
293
|
+
godot-cli export "Windows Desktop" build/game.exe
|
|
294
|
+
godot-cli run-script tools/migrate.gd -- --dry-run
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
- **`check [path] [--strict] [--include-addons]`** runs four separate processes (a single cold
|
|
298
|
+
`--build-solutions --quit` crashes on C# `[Tool]` plugins): `--headless --import`; `dotnet build` for a C# project
|
|
299
|
+
(errors as `file(line,col): error CS…`); `--headless --editor --quit`, which must print `[Godot-MCP] plugin loaded`
|
|
300
|
+
when the addon is enabled; and a GDScript pass that loads every `.gd` under `res://` (`res://addons/` only with
|
|
301
|
+
`--include-addons`) and reports parse errors as `res://file:line`. `--strict` also fails on GDScript warnings (the
|
|
302
|
+
project's Warn-level warnings raised to errors in memory, never saved) and C# `CS` warnings. Engine messages (a
|
|
303
|
+
plugin's runtime warnings, for example) are listed as warnings and never fail the check.
|
|
304
|
+
- **`import [path]`** fails on script errors (`SCRIPT_ERRORS`) and on resources that fail to import (`IMPORT_FAILED`).
|
|
305
|
+
- **`test [path]`** finds GUT (`addons/gut`) or gdUnit4 (`addons/gdUnit4`), imports the project (`--no-import` skips
|
|
306
|
+
it), and runs the runner's command-line script with a JUnit report (`-gjunit_xml_file`, or gdUnit4 `-rd`; gdUnit4
|
|
307
|
+
runs with `--ignoreHeadlessMode -c`). Exit 0 when all tests pass, 8 on failures, 6 (`TEST_RUN_ERROR`) when there is
|
|
308
|
+
no report, no test ran, or a test script failed to load (its tests are missing from the report, so it must not pass),
|
|
309
|
+
6 (`NOT_FOUND`) with an install hint when no runner is installed. `--runner gut|gdunit4`, `--dir <dir>` (repeatable;
|
|
310
|
+
default `res://test`, `res://tests`, or GUT's `.gutconfig.json`), `--filter <text>` (test scripts whose file name
|
|
311
|
+
contains it), `--output <file>` (copy the JUnit XML), `--format text|json|ndjson|github`.
|
|
312
|
+
- **`export <preset> <output> [--debug|--pack]`** checks that `export_presets.cfg` has the preset and that the export
|
|
313
|
+
templates for the editor's version are installed (unless `--pack` or the preset names its own template), runs
|
|
314
|
+
`--export-release|--export-debug|--export-pack`, and fails (`EXPORT_FAILED`) unless the output file exists, is not
|
|
315
|
+
empty and was written by this run, and the log has no export errors (Godot writes the executable and exits 0 even
|
|
316
|
+
when, say, the C# publish failed for want of a `.sln`).
|
|
317
|
+
- **`run-script <script> [args...]`** runs `godot --headless --path <project> -s <script> -- <args>`: the script
|
|
318
|
+
extends `SceneTree` or `MainLoop` and ends with `quit(code)`. Exit 0 for `quit(0)`; 6 for another code
|
|
319
|
+
(`data.scriptExitCode`) or a script that failed to load; 14 on `--timeout` (default 300000 ms). It does not import,
|
|
320
|
+
so it also runs while an editor has the project open.
|
|
321
|
+
|
|
204
322
|
## `login`
|
|
205
323
|
|
|
206
324
|
`godot-cli login` authenticates the editor plugin's **cloud** connection to
|
|
@@ -250,17 +368,19 @@ godot-cli setup-skills cursor ./MyGame # generate into MyGame/.cursor/ski
|
|
|
250
368
|
godot-cli setup-skills --list # list agents + their skills paths
|
|
251
369
|
```
|
|
252
370
|
|
|
253
|
-
|
|
254
|
-
`godot-mcp-node`, `godot-mcp-scene`, `godot-mcp-resource`, …) describing the `godot_mcp` addon's tool
|
|
255
|
-
families. It is **idempotent** — re-running rewrites the same bytes.
|
|
371
|
+
It writes, offline (no editor, no server, no network):
|
|
256
372
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
`
|
|
263
|
-
|
|
373
|
+
- `godot-cli/SKILL.md`: how an agent uses this CLI from a cold start: the first editor command starts a headless
|
|
374
|
+
editor, `rql` with recipes for scenes, nodes and resources, `check` / `test`, `--format json`, what each exit
|
|
375
|
+
code means. It is short on purpose (an agent keeps every byte it reads in context); `references/rql.md` and
|
|
376
|
+
`references/install.md` hold the depth, read only when needed. The recipes come from the same source as
|
|
377
|
+
`godot-cli --help` and `rql --help`, so the skill and the help cannot drift apart.
|
|
378
|
+
- `ai-game-dev-app/SKILL.md`: the companion app, for creative tools the CLI does not have.
|
|
379
|
+
|
|
380
|
+
It is **idempotent**: re-running rewrites the same bytes. It removes the `godot-mcp` / `godot-mcp-<family>` skills
|
|
381
|
+
earlier versions generated from a hand-written catalog. Per-tool skills are the addon's job: it generates them from
|
|
382
|
+
the tools it really registers whenever the editor runs (toggle in the addon's Skills panel), together with its
|
|
383
|
+
`godot-cli-install` guide.
|
|
264
384
|
|
|
265
385
|
## `install-plugin`
|
|
266
386
|
|
|
@@ -333,6 +453,9 @@ import { openProject, runTool, setupMcp, installPlugin, installExtension, execCo
|
|
|
333
453
|
// The shared extension catalog + lookup helpers are exported too, so a GUI (the app)
|
|
334
454
|
// can render the same list the dock + CLI install from:
|
|
335
455
|
import { EXTENSIONS_CATALOG, findExtension } from 'godot-cli';
|
|
456
|
+
|
|
457
|
+
// The headless commands, their log/JUnit parsers and the exit codes:
|
|
458
|
+
import { checkProject, importProject, runTests, exportProject, runScript, parseGodotLog, parseJUnit, ExitCode } from 'godot-cli';
|
|
336
459
|
```
|
|
337
460
|
|
|
338
461
|
Every function returns a discriminated union (`{ kind: 'success', ... }` / `{ kind: 'failure', error }`)
|
package/dist/cli.d.ts
CHANGED
|
@@ -12,3 +12,10 @@ export { closeCommand } from './commands/close.js';
|
|
|
12
12
|
export { createUpdateCommand } from './commands/update.js';
|
|
13
13
|
export { installPluginCommand } from './commands/install-plugin.js';
|
|
14
14
|
export { removePluginCommand } from './commands/remove-plugin.js';
|
|
15
|
+
export { checkCommand } from './commands/check.js';
|
|
16
|
+
export { importCommand } from './commands/import.js';
|
|
17
|
+
export { testCommand } from './commands/test.js';
|
|
18
|
+
export { exportCommand } from './commands/export.js';
|
|
19
|
+
export { runScriptCommand } from './commands/run-script.js';
|
|
20
|
+
export { createCommandsCommand } from './commands/commands.js';
|
|
21
|
+
export { toolsCommand } from './commands/tools.js';
|
package/dist/cli.js
CHANGED
|
@@ -17,4 +17,11 @@ export { closeCommand } from './commands/close.js';
|
|
|
17
17
|
export { createUpdateCommand } from './commands/update.js';
|
|
18
18
|
export { installPluginCommand } from './commands/install-plugin.js';
|
|
19
19
|
export { removePluginCommand } from './commands/remove-plugin.js';
|
|
20
|
+
export { checkCommand } from './commands/check.js';
|
|
21
|
+
export { importCommand } from './commands/import.js';
|
|
22
|
+
export { testCommand } from './commands/test.js';
|
|
23
|
+
export { exportCommand } from './commands/export.js';
|
|
24
|
+
export { runScriptCommand } from './commands/run-script.js';
|
|
25
|
+
export { createCommandsCommand } from './commands/commands.js';
|
|
26
|
+
export { toolsCommand } from './commands/tools.js';
|
|
20
27
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,uBAAuB;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAA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BAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import * as ui from '../utils/ui.js';
|
|
3
|
+
import { CommandOutput, addFormatOption, parseFormat } from '../utils/output.js';
|
|
4
|
+
import { checkProject, failingDiagnostics } from '../lib/check.js';
|
|
5
|
+
import { addHeadlessOptions, diagnosticErrors, finishHeadless, headlessProjectPath, headlessTimeout, printDiagnostics, printSteps, } from './headless-common.js';
|
|
6
|
+
export const checkCommand = addFormatOption(addHeadlessOptions(new Command('check')
|
|
7
|
+
.description('CI gate without an editor: import, C# build, editor boot and a GDScript load check, judged from the logs')
|
|
8
|
+
.argument('[path]', 'Godot project path')
|
|
9
|
+
.option('--strict', 'Fail on GDScript and C# compiler warnings too')
|
|
10
|
+
.option('--include-addons', 'Also load the GDScript under res://addons/'), 900000)).action(async (positional, options) => {
|
|
11
|
+
const output = new CommandOutput('check', parseFormat(options.format));
|
|
12
|
+
const timeoutMs = headlessTimeout(options);
|
|
13
|
+
const result = await checkProject({
|
|
14
|
+
projectPath: headlessProjectPath(positional, options),
|
|
15
|
+
timeoutMs,
|
|
16
|
+
strict: options.strict === true,
|
|
17
|
+
includeAddons: options.includeAddons === true,
|
|
18
|
+
allowOpenProject: options.allowOpen === true,
|
|
19
|
+
...(options.editorPath ? { editorPath: options.editorPath } : {}),
|
|
20
|
+
onProgress: (m) => output.progress(m),
|
|
21
|
+
});
|
|
22
|
+
const diagnostics = result.diagnostics ?? [];
|
|
23
|
+
const failing = failingDiagnostics(diagnostics, options.strict === true);
|
|
24
|
+
for (const m of result.engineMessages ?? [])
|
|
25
|
+
output.warnings.push(`engine ${m.severity}: ${m.message}`);
|
|
26
|
+
for (const d of diagnostics.filter((x) => x.severity === 'warning' && !options.strict))
|
|
27
|
+
output.warnings.push(`${d.file ?? ''}${d.line ? `:${d.line}` : ''} ${d.message}`.trim());
|
|
28
|
+
if (!output.machine) {
|
|
29
|
+
ui.heading('Godot Check');
|
|
30
|
+
if (result.projectPath)
|
|
31
|
+
ui.label('Project', result.projectPath);
|
|
32
|
+
printSteps(result.steps ?? []);
|
|
33
|
+
printDiagnostics(diagnostics);
|
|
34
|
+
}
|
|
35
|
+
const data = result.kind === 'failure' && result.steps === undefined ? null : {
|
|
36
|
+
projectPath: result.projectPath,
|
|
37
|
+
addon: result.addon,
|
|
38
|
+
gdscript: result.gdscript,
|
|
39
|
+
csharp: result.csharp,
|
|
40
|
+
diagnostics,
|
|
41
|
+
steps: result.steps,
|
|
42
|
+
};
|
|
43
|
+
const errors = result.kind === 'failure'
|
|
44
|
+
? diagnosticErrors((d) => (d.source === 'csharp' ? 'COMPILATION_FAILED' : 'SCRIPT_ERRORS'), failing)
|
|
45
|
+
: [];
|
|
46
|
+
finishHeadless(output, result, data, errors, 'No script or compilation errors');
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,gBAA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M,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,SAAS;QACtC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;QACpG,CAAC,CAAC,EAAE,CAAC;IACP,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iCAAiC,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC"}
|
package/dist/commands/close.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
export interface CloseOptions {
|
|
3
|
+
path?: string;
|
|
3
4
|
timeout?: string;
|
|
4
5
|
force?: boolean;
|
|
5
6
|
ownedOnly?: boolean;
|
|
@@ -18,4 +19,6 @@ export declare function isGodotProjectRoot(projectPath: string): boolean;
|
|
|
18
19
|
export declare function parseTimeoutSeconds(raw: string | undefined): number | null;
|
|
19
20
|
/** Resolve the editor PID for a given project path, or null when not running. */
|
|
20
21
|
export declare function resolveEditorPid(projectPath: string): number | null;
|
|
22
|
+
/** Whether a command line runs Godot's `_console` build: a windowless wrapper whose child is the editor. */
|
|
23
|
+
export declare function isConsoleWrapper(commandLine: string): boolean;
|
|
21
24
|
export declare const closeCommand: Command;
|