lecodes-cli 0.9.2 → 0.10.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 +4 -0
- package/dist/index.js +666 -227
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ lecodes push -m "Tweak the menu" # push as a new checkpoint
|
|
|
55
55
|
| `install` | **Standalone build only.** Install the unpacked release bundle so `lecodes` is on your PATH: copies the `lecodes`+`chisel`+`runtime/` bundle to a library folder, then (Linux/macOS) symlinks it into a `bin` dir. PATH itself is edited only with `--modify-path` (appends `export PATH=…` to your shell rc on Linux/macOS, or adds the folder to your user PATH on Windows); otherwise it prints how to finish. Per-user by default; `--system` installs to `/usr/local` (needs sudo, and `/usr/local/bin` is already on PATH). `--dir <path>` overrides the library folder, `--bin <path>` the symlink folder. Refuses when run from an npm/source install (there, install globally with your package manager). |
|
|
56
56
|
| `login` | Authorize in the browser; stores an access token in `~/.lecodes/config.json`. `--token <pat>` to use a token created in the web UI instead, `--api <url>` for the API origin (default `https://le.codes`), `--web <url>` for the app origin. |
|
|
57
57
|
| `clone <uuid\|url> [dir]` | Download a project's file tree + binary resources, plus `.d.ts` types and a `tsconfig.json` for IntelliSense. `--no-types` to skip types. |
|
|
58
|
+
| `link [dir]` | **Connect an existing local folder to the platform** — the reverse of `clone`, for a project started with `init`. Creates a project on the server (`--name`, `--team`), writes `.lecodes/manifest.json` and refreshes the types from the server; nothing is uploaded until you `push`, so `status` shows what would go up first. `--project <uuid\|url>` adopts an **existing** project instead: the manifest is built from its server tree and the command prints exactly what your next push would create/update/delete there before linking (then `push` to let local win, or `pull` to take the server's version). `--push [-m <msg>]` links and pushes in one step (`--publish` also deploys), `--force` re-links an already-linked folder, `--no-types` skips the type refresh. |
|
|
58
59
|
| `status` | Show added / modified / moved / deleted files vs the last sync. |
|
|
59
60
|
| `pull` | Overwrite local files with the project's current remote state. `--force` to discard local edits. |
|
|
60
61
|
| `push` | Push all local changes as **one** new checkpoint. `-m`/`--message` for the message, `--force` to override the "server moved on" guard. |
|
|
@@ -65,6 +66,7 @@ lecodes push -m "Tweak the menu" # push as a new checkpoint
|
|
|
65
66
|
| `design snapshot [screen…]` | Render design screens headless (needs `lecodes-renderer`). One screen → semantic JSON to stdout; otherwise JSON files in `design/.snapshots/`; `--png` also rasterizes PNGs (needs `@napi-rs/canvas`); `--out-dir <dir>`, `--logs`. |
|
|
66
67
|
| `scene [path]` | **LeCodes Scene Editor** — visually edit a `.scene.ts` 3D scene (needs the optional `lecodes-3d-editor` package). Works inside a cloned project **or standalone in any folder**. Starts a local editor server + browser app: a scene tree, a per-node inspector, and a move/rotate/scale gizmo; add mesh/light/camera/model/aspect nodes; edits are written straight back to the `.scene.ts`, and external (IDE) edits hot-reload over SSE. Registers an MCP server in `.mcp.json` so Claude Code can call `scene_state` (scenes + models + aspect classes with field hints) and `check_scene` (compile status) — `--no-mcp` to skip. `path` is a folder or a `.scene.ts` to host (default: the current folder / enclosing project). `--port <n>` (default 4488), `--no-open`. |
|
|
67
68
|
| `render` | Render the local project (**UI + 2D**). By default emits a semantic JSON description (great for AI/automated checks) to stdout or `-o`/`--out <file>`; `--png [file]` rasterizes a PNG (default `screenshot.png`, `--scale <n>` for DPR). A creator-2d scene is composited **under** the UI; `--time <ms>` advances its physics/animation. `asset('./x.png')` resources (images, sprite textures) load from the local working tree by default — use `--remote-assets` (or an explicit `--public-url`) to fetch them from the server instead (which then needs `--wait-network`). `--width`/`--height` set the viewport (default 390×844). Requires the optional `lecodes-renderer` package (`npm i -D lecodes-renderer@^0.2.0`); PNG also needs `@napi-rs/canvas`. 3D scenes aren't rendered. |
|
|
69
|
+
| `types [dir]` | Re-materialize the IDE type surface (`.lecodes/types/` + `tsconfig.json`). Fetches `GET /api/types` from the server by default — so a project scaffolded offline by `init` picks up the SDK the platform actually runs — falling back to the copy bundled in this CLI when the server is unreachable. `--local` to use that bundled copy outright (fully offline), `--check` to report drift without writing (exits non-zero when stale — handy in CI), `--api <url>` for the server. IDE-only: the compiler always uses the SDK vendored in the CLI, and the command warns when the two disagree. |
|
|
68
70
|
|
|
69
71
|
## How it works
|
|
70
72
|
|
|
@@ -73,5 +75,7 @@ lecodes push -m "Tweak the menu" # push as a new checkpoint
|
|
|
73
75
|
file tree (adds, edits, deletes, renames and moves all at once) and freezes a single checkpoint.
|
|
74
76
|
Renames/moves keep their history; unchanged binaries are never re-uploaded.
|
|
75
77
|
- Types are fetched from the server on `clone`/`pull`, so they always match the deployed runtime.
|
|
78
|
+
A local `init` project starts with the copy bundled in the CLI instead; `lecodes types` refreshes
|
|
79
|
+
either kind on demand.
|
|
76
80
|
|
|
77
81
|
Config can also be supplied via the `LECODES_API` and `LECODES_TOKEN` environment variables (useful in CI).
|