Project shapes
Project shapes
A project is a directory with a peko.toml. Which tables it contains decides
what kind of project it is.
| Shape | Manifest | peko build produces |
|---|---|---|
| UI app | [project] and [ui] |
a bundle per target platform |
| CLI program | [project], no [ui] |
one host binary |
| Library | [package] and [lib] |
nothing by default |
[project] and [package] are mutually exclusive.
Creating one
peko project newInteractively this offers the three types and prompts for a name, a bundle id,
and a version. Non-interactively, pass --name and pick the type:
peko project new --name myapp --type ui --framework react-ts
peko project new --name mytool --type cli
peko project new --name mylib --type package--dir chooses where to scaffold, and --force overwrites an existing folder.
What a UI project gets
The scaffold runs npm create vite with your chosen template, then overlays the
native half:
peko.tomlwith[ui] framework = "static"and apekouidependency pinned to the newest installed version.src/main.peko, the native entry.- A patched
vite.config, addingbase: './'andbuild: { outDir: 'assets', emptyOutDir: true }. @peko/clientadded topackage.jsonand imported from the web entry.
Fifteen templates are offered. The static ones are react, react-ts (the default),
vue, vue-ts, svelte, svelte-ts, solid, preact, and vanilla. The server ones are
next, nuxt, sveltekit, remix, astro, and angular; picking one of those runs that
framework's own scaffolder and sets [ui].framework to it.
What a CLI project gets
mytool/
peko.toml
src/main.peko
import std::io;
fn on_start() {
io::println("Hello World!")
}What a library gets
mylib/
peko.toml
README.md
source/lib.peko
Adopting an existing web app
Running peko project new in a directory that already has a package.json with
react, vue, svelte, solid, preact, or vite detects it and offers to convert in
place rather than scaffolding a new folder. That applies the same overlay: the
manifest, the native entry, the vite patch, and the client dependency.
Inspecting
peko project show-info # the resolved configuration
peko project show-assets # open the assets folder
peko project show-icon # preview the app iconadd-asset <path> and remove-asset <name> manage the assets/ directory. All
of these need a UI project; a CLI project has no assets or icon.