CLI overview
bun create pleyn <directory> is meant to leave a running application. There is
no README of six more commands afterwards — or there should not be, when every
step succeeds.
Flags are documented on Flags. What follows is the pipeline those flags skip or keep.
Before any step
Section titled “Before any step”The last path segment of <directory> is slugified into an npm package name and
a Postgres database name. An existing non-empty directory is refused; nothing is
touched.
The steps
Section titled “The steps”- Copy the template. From the bundled
template/(npm) ortemplates/app(checkout). See Project layout. - Write
.env. A random 32-byte base64SECRET_KEY, and aDATABASE_URLthat matches the project name. The compose file’spleyncredentials are rewritten to that name so two generated apps do not share one database. - Install (
bun install), unless--no-install. - Postgres. Default:
docker compose up -d, then pollpg_isreadyfor up to 60 seconds. Skipped with--no-docker. If Docker is missing, the project stays and the message says how to finish by hand. - Migrate (
bun run db:apply) when the database is ready and install ran. - Seed (
bun run cli seed). Demo credentialsdemo@example.com / pleyn-demo-passwordare printed only when the seed actually succeeded. - Stylesheet (
bun run css) when install ran. Soft-fail → a note. - Git (
git init+ initial commit), unless--no-git, git is missing, or.gitalready exists.
Done vs Copied
Section titled “Done vs Copied”If the seed ran, the CLI prints Done. and the demo sign-in. Otherwise it
prints Copied. plus the remaining commands (bun install, db:up,
db:apply, cli seed, css as needed), then bun run dev and bun run ok.
Requirements: Bun ≥ 1.2. Docker is optional for the default Postgres path.
When a step fails, see Failures & requirements.