lecodes-cli
v2.9.0
Published
Clone, edit and push LeCodes projects from your machine.
Readme
lecodes-cli
Build, run and ship LeCodes projects from your machine: local projects with hot reload on a device, the desktop and the browser; headless render / flow tests; the design and scene editors; native iOS / Android / desktop shells; and the clone / push loop against the platform, with full TypeScript IntelliSense for the SDK in your editor.
The package is lecodes-cli; the command it installs is lecodes.
lecodes --help # every command, grouped
lecodes <command> --help # that command's options, subcommands and examplesThe full reference is the command reference —
generated from the command definitions, so it always matches --help.
Install
npm install -g lecodes-cli # then run: lecodes <command>
# or without installing:
npx lecodes-cli <command>Optional peers
Some commands live in separate packages the CLI installs on first use into ~/.lecodes/peers
(after a prompt; --yes / LECODES_YES=1 skips it):
| Package | Needed by |
|---|---|
| lecodes-renderer (pinned to the CLI's own version) + @napi-rs/canvas for PNG | render, test, design snapshot |
| lecodes-design | design |
| lecodes-3d-editor | scene, thumbs |
| lecodes-assets | assets |
A copy you installed yourself (npm install -g lecodes-renderer, or in a project's
devDependencies next to a local lecodes-cli) wins over the prefix. lecodes --version shows
each peer's version and where it came from.
Standalone build (the release archive, no Node/Bun needed): unpack it and run ./lecodes install
to copy the bundle to a library folder and put lecodes on your PATH — per-user by default, or
--system for all users on Linux/macOS. The archive ships the lecodes binary alongside the chisel
bundler and a runtime/ folder; keep them together, or let install place them for you. The
standalone build resolves no npm packages, so the peer-backed commands need the npm install.
Quick start
Start a project locally — no account, no login:
lecodes init myapp # scaffold a local project (starter + types + tsconfig)
cd myapp
# …edit main.ts in VS Code (IntelliSense works out of the box)…
lecodes dev # run it on a device with hot reload (scan the QR)
lecodes dev --web # …and in the browser (Web Lite host)
lecodes dev --desktop # …and in the native desktop host
lecodes render --png shot.png # a headless screenshot; `lecodes test` runs tests/*.flow.json
lecodes compile -o app.js # one self-contained bundle for LeCodes DesktopOr work against a project on the platform:
lecodes login # opens the browser to authorize this machine
lecodes clone <project-uuid> myapp # download files + types into ./myapp
cd myapp
# …edit files in VS Code…
lecodes status # see what changed
lecodes push -m "Tweak the menu" # push as a new checkpoint
lecodes publish # release it: https://<handle>.le.codes, the viewers, the store
lecodes releases # the releases; `releases use <version>` rolls backA local project joins the platform later with lecodes link (create) or
lecodes link --project <uuid> (adopt an existing one — it shows what your next push would change
there before connecting anything).
Commands at a glance
| Group | Commands |
|---|---|
| Project | init create clone link status diff pull push publish releases login |
| Run & test | dev compile render test desktop |
| Editors | design scene thumbs |
| Content | assets shaders lightmap navmesh |
| Native apps | app (ios / android / desktop shells) pn (push notifications) |
| Maintenance | update install |
How it works
- Project metadata and the path → asset map live in
.lecodes/(per-checkout state, like.git; keep it out of the project's own git —init/clonewrite the.gitignoreline). - A push sends your whole working tree to the server, which atomically rebuilds the project's
file tree (adds, edits, deletes, renames and moves all at once) and freezes a single checkpoint.
Renames / moves keep their history; unchanged binaries are never re-uploaded.
pushrefuses to overwrite a server that moved on;diffshows the conflict,pulltakes the server's version,push --forceyours. - Types are fetched from the server on
clone/pull/link, so they match the deployed runtime. A localinitproject starts with the copy bundled in the CLI;lecodes updaterefreshes either kind (and the desktop host, matc, the shader compiles, the native shell pins and the optional peers). - Config lives in
~/.lecodes/config.json;LECODES_API/LECODES_TOKENoverride it (CI). A.envnext toapp.jsonis read at startup forLECODES_*/CREATOR_*keys — the shell's own environment wins,./paths resolve against the project, and the file is never pushed.
