Building and running

Building and running

The inner loop

peko test src/main.peko    # type-check one file, no codegen
peko build                 # build the whole project
peko run                   # build and run
peko format src/*.peko     # canonical formatting

peko test is the fast check. It parses and runs the semantic analyzer, then stops, so it catches type errors in a fraction of a full build. It checks one file at a time. --os and --arch check a different target's platform imports.

peko build catches what single-file checking cannot: cross-file errors, linking, and codegen.

peko build

A CLI project produces one host binary. A UI project produces a bundle for every platform in target_platforms.

Platform Debug --release
macOS .app, universal .app plus .dmg and .pkg, signed
iOS simulator .app for both arches device .app plus .ipa
Android universal .apk, dev-signed .aab, signed
Windows .exe .exe plus an .msix
Linux .AppImage per arch same

Useful flags:

Flag Effect
--release optimized, and runs each platform's signing step
--platform <os> build one platform instead of the declared list
--regenconfig reset the bundling config templates to their defaults
--demo include demo { } blocks and demo-scoped dependencies
--web-dist <dir> use an already-built frontend instead of running npm

The per-platform bundling configuration under .peko/bundling/configfiles/ is generated on the first build. After that it is yours: edit it and the next build picks the changes up automatically.

--regenconfig discards those edits and writes the defaults again. Reach for it when you want to start over or after a toolchain update changes the template, not to apply a change you just made.

peko run

For a CLI project this compiles and executes once.

For a UI project it is a dev loop: it starts the framework's dev server with npm run dev, points the native window at that URL so web edits reload through the framework's own hot reload, and on a .peko change recompiles incrementally and relaunches with the route restored.

That means a UI project needs a dev script in package.json. Without one the command stops and points you at peko build.

--devtools opens a diagnostics window driving the same loop.

Other commands

peko compile <file> compiles a single file outside the project system, with --object, --shared, and --emit-ir for inspecting output. peko clean removes the build cache and output, which is the fix for a stale incremental cache. peko clangflags prints the flags the C compiler would receive for a target.