tynd init
bunx @tynd/cli initbunx @tynd/cli init --cwd ./my-app| Flag | Effect |
|---|---|
--cwd <dir> |
Project directory; defaults to current directory |
-f, --force |
Replace scaffold files such as tynd.config.ts and backend/main.ts |
Without --force, existing scaffold files are preserved.
What it does
Section titled “What it does”- Reads
package.jsonand detects Vite, Create React App, Angular, Parcel, Rsbuild, or Webpack. - Rejects known server-rendered frameworks; Tynd requires static SPA output.
- Writes a minimal
tynd.config.tsusing the detected output directory. - Writes
backend/main.ts. - When no frontend tool is detected and the project has no Tynd config yet, fails with
no frontend foundbefore writing any file. Scaffold a frontend first (e.g.bun create vite@latest) or start fresh withtynd create <name> --framework react. - Moves existing non-Tynd
dev/buildscripts todev:ui/build:uiwhen those names are free, then installsdev,start, andbuildTynd scripts. - Adds
@tynd/coreas a dependency, plus@tynd/cli,@tynd/host-src(the Rust sources the host is compiled from), and@types/bunas development dependencies unless already present at runtime. - Ensures
.gitignore,.bun-version,tsconfig.json, and@tynd/core/enveditor typing.
init edits manifests but does not run bun install. The tynd CLI binaries arrive through npm optional platform packages; the app host is compiled from @tynd/host-src by tynd dev and tynd build. There is no postinstall hook or command-time binary download.
Like create, init ends by checking the Rust toolchain and warns when it is missing or older than Rust 1.95.
Example
Section titled “Example”cd my-existing-appbunx @tynd/cli initbun installbun run dev