Work with the platform
The project lives on le.codes and you work on a copy of it — or the other way round: a folder that started on your disk becomes a project there.
Sign in: lecodes login
lecodes loginThe browser opens, you approve this machine, and the CLI keeps the token. Every command on this page needs that once.
Take a project to your machine: lecodes clone
lecodes clone <uuid-or-url> myapp # files + resources + types
cd myappThe project's id is in its address in the editor; the whole URL works too. lecodes create <name>
makes a new project on the server and the folder for it in one step.
Send your changes: status, diff, push
lecodes status # what changed since the last sync
lecodes diff # line by line, against the server
lecodes push -m "Tweak the menu" # all of it, as one checkpointThe model is simpler than git: no staging and no branches. push sends the working tree and the
server turns it into one checkpoint — added, edited, deleted and moved files at once. A renamed
file keeps its history and an unchanged binary is not uploaded again.
When the server has moved on since your last sync, push stops and shows what it would overwrite.
Take the server's state first, or pass --force and confirm the list.
Take the server's changes: lecodes pull
lecodes pull # the project's current state
lecodes pull src/menu.ts # only this file; every other local edit stays
lecodes pull --force # discard local changesPut a local folder on the platform: lecodes link
A project made with lecodes init joins the platform when you decide:
lecodes link # create a project for this folder
lecodes link --push -m "v1" # …and push the first checkpoint
lecodes link --project <uuid> # adopt an existing project insteadlink uploads nothing by itself: lecodes status shows what the first push would send. With
--project, the command prints what your next push would create, update and delete in that
project before it links.
The link is kept in .lecodes/ — treat it like .git: it belongs to this checkout. The editor
types are refreshed from the server on clone, pull and link, so they match the SDK the
project runs on.
Make it live: lecodes publish
lecodes publish
lecodes publish -m "Checkout v2"publish is the editor's Publish button: local changes are pushed as a checkpoint, the platform
builds the project, deploys its server code and makes the build the current release — what the
project's address, the le.codes app and the store run. A project that builds to what is live
already makes no release.
A change of the database schema that deletes production data is shown and asked about. Without a
terminal it stops, until you pass --allow-destructive.
lecodes push --publish does both steps in one command.
Roll a release back: lecodes releases
lecodes releases # the releases; ● marks the current one
lecodes releases use 1.2.3 # make that one current againEvery publish makes a release: a build that never changes, with its own version. releases use
makes an older one current without compiling anything, and deploys that release's server code
again.
The project's keys: lecodes secrets
A key — a token, a client secret, a maps key — is read in code as env.NAME. Server code
(*.server.ts) reads every key; the app reads only the ones named PUBLIC_…, because its bundle
is public.
On your machine the keys are lines of the project's .env. On le.codes they are in Project
Settings → Keys, which these commands edit:
lecodes secrets list # on le.codes, in .env, and what the code reads
lecodes secrets set STRIPE_KEY # asks for the value, without echo
lecodes secrets set STRIPE_KEY --from-env # takes the .env line
lecodes secrets push # every key of .env
lecodes secrets remove STRIPE_KEYA value never comes back from le.codes. lecodes dev and the builds name a key that the code reads
and nobody set.
Sign in without a browser: CI
Create a token in the web UI and hand it to the CLI in the environment:
LECODES_TOKEN=<token> lecodes push -m "CI build"LECODES_API names another API origin. On a machine you keep, lecodes login --token <token>
stores the token once.
Next
- Publishing & le.store — the link, the QR code and the store page of a published project
- Native apps — a build for the App Store and Google Play