Skip to Content

tynd init

bunx @tynd/cli init

Adds Tynd to an existing project. Inspects package.json to detect the build tool and fills frontendDir / dev command accordingly.

Flags

FlagEffect
--cwd <dir>Project directory (default: current)
-r, --runtime <r>full or lite. Prompts if missing.
-f, --forceOverwrite existing tynd.config.ts / backend/main.ts

What it does

Detects the build tool

Reads package.json dependencies:

Build toolTriggeroutDir default
Vitevite / @vitejs/*dist
CRAreact-scriptsbuild
Angular CLI@angular/clidist/<project>/browser
Parcelparceldist
Rsbuild@rsbuild/coredist
Webpackwebpack + webpack-clidist

Rejects SSR frameworks

Fails fast on next, nuxt, @sveltejs/kit, @remix-run/*, gatsby, @solidjs/start, @angular/platform-server, etc.

Writes tynd.config.ts

Minimal config with detected build tool’s outDir and dev URL. --force overwrites an existing config.

Creates backend/main.ts

Minimal app.start + one greeting function.

Patches package.json

Adds @tynd/cli, @tynd/core, @tynd/host to deps, merges scripts, and appends "@tynd/host" to trustedDependencies so Bun runs its postinstall (which downloads the native host binary) on the next bun install without a manual bun pm trust step.

Example

cd my-existing-app bunx @tynd/cli init -r lite bun install bun run dev
Last updated on