CLI & local development
The browser editor covers the whole loop, but at some point you want your own editor, your own git and your own tooling. The lecodes CLI brings the project to your machine: local development with full IntelliSense, hot reload straight to your phone over the local network, and one-command sync with the platform.
Install
The CLI is the npm package lecodes-cli (Node ≥ 18); the command it installs is called lecodes:
npm i -g lecodes-cli # then: lecodes <command>
npx lecodes-cli <command> # or without installingNo Node on the machine? Grab the standalone build from the Downloads page: unpack the archive and run ./lecodes install — the bundle is copied to a library folder and lecodes lands on your PATH.
lecodes --version also reports the versions of the optional packages (lecodes-renderer, lecodes-design, …) — handy when a command complains something is missing.
A local project — no account
You can start without the platform at all: init scaffolds a project right on disk — no login, no server.
lecodes init myapp
cd myapp
lecodes devinit writes a starter main.ts, the SDK types and a tsconfig.json — VS Code autocompletes every global immediately, offline. The command is idempotent: existing files are never touched. The rules from Anatomy of a project apply here too — no package imports, an entry point with no exports.
lecodes dev — hot reload on a device
The heart of local development. lecodes dev starts a dev server on your local network and prints a QR code — scan it with the LeCodes app and the project opens on your phone, natively. From there the loop closes itself:
- Every save recompiles and hot-swaps the running app in place on the device; a build error rolls back to the last good version.
- The device's
console.logand errors stream back to the terminal. - The URL is stable across runs — the phone reconnects to the same address.
No login needed; assets are served from the working tree. Flags: --port (default 4499), --host if the LAN address was auto-detected wrong, --entry, --no-qr.
A platform project — clone & push
The second scenario: the project lives on le.codes and you work on a local copy.
lecodes login # opens the browser to authorize this machine
lecodes clone <uuid-or-url> myapp # files + resources + types
cd myapp
# …edit in your own editor…
lecodes status # what changed
lecodes diff # line-by-line diff vs the server
lecodes push -m "Tweak the menu" # all edits as one checkpointThe model is simpler than git — no staging, no branches. push sends your whole working tree and the server atomically rebuilds it into one checkpoint: adds, edits, deletes and moves at once; renames keep their history, unchanged binaries are never re-uploaded. pull takes the project's current server state (pass paths to update only those; --force discards local edits). If the server has moved on, push stops and shows what would be overwritten.
Metadata lives in .lecodes/ — it's like .git: commit it or don't. Types are fetched from the server on clone/pull, so they always match the deployed runtime. lecodes create <name> makes a new project on the server, and push --publish deploys the project live along with the checkpoint.
In CI you don't log in: pass the token and API origin via the LECODES_TOKEN and LECODES_API environment variables. Create the token in the web UI (or lecodes login --token).
Compile & headless render
lecodes compile -o app.js # the whole project as one portable bundle
lecodes render --png # a screenshot of the app, no device neededcompile builds the very bundle from Anatomy of a project — locally, in under a second. Without -o the bundle goes to stdout (pipeable), --no-minify keeps it readable. For a local init project the bundle is self-contained — you can open it in LeCodes Desktop.
render runs the project headless and returns a semantic JSON snapshot of the interface — or a PNG with --png. That's the foundation for automated checks and AI assistants: an agent edits the code, renders, and sees the result itself. Needs the optional lecodes-renderer package (npm i -D lecodes-renderer, plus @napi-rs/canvas for PNG); UI and 2D render, 3D scenes don't.
Next to the CLI — design & scene
The same command hosts two more local tools:
- LeCodes Design (
lecodes design) — a live canvas of screens for designing an app together with an AI assistant. - The scene editor (
lecodes scene) — a visual editor for.scene.tsfiles: a scene tree, an inspector and a gizmo; edits are written straight back to the source, and external IDE edits hot-reload (needs the optionallecodes-3d-editorpackage).
The full list of commands and flags: lecodes --help.