Installation

Create a new swift-rust project and run it locally.

Quick Start

  1. Create a new swift-rust project named my-app.
  2. cd my-app and install the dependencies.
  3. Start the dev server with bun run dev.
  4. Visit http://localhost:3210.
Terminal
bun create swift-rust@latest my-app --yes
cd my-app
bun install
bun run dev

--yes skips prompts using saved preferences or defaults. The default setup enables TypeScript, Tailwind CSS, ESLint, App Router, and src, with import alias @/*, and includes AGENTS.md (with a CLAUDE.md that references it) to guide coding agents to write up-to-date swift-rust code.

System Requirements

Before you begin, make sure your development environment meets the following requirements:

  • Bun 1.3.0+ (no Node.js)
  • Rust 1.85+ (only required for native builds)
  • Linux, macOS, or Windows

Supported Browsers

swift-rust supports modern browsers with zero configuration.

  • Chrome 111+
  • Edge 111+
  • Firefox 111+
  • Safari 16.4+
  • Zen

Scaffold a new project

The fastest way to start is with the create-swift-rust scaffolder. It asks a few questions (or accepts flags for a non-interactive run) and creates a new project in the current directory.

Terminal
bun create swift-rust@latest my-app
cd my-app
bun install
bun run dev

On installation, you'll see the following prompts:

Terminal
What is your project named? my-app
Would you like to use the recommended swift-rust defaults?
  Yes, use recommended defaults - TypeScript, ESLint, Tailwind CSS, App Router, AGENTS.md
  No, reuse previous settings
  No, customize settings - Choose your own preferences

If you choose to customize settings, you'll see the following prompts:

Terminal
Would you like to use TypeScript? No / Yes
Which linter would you like to use? ESLint / Biome / None
Would you like to use React Compiler? No / Yes
Would you like to use Tailwind CSS? No / Yes
Would you like your code inside a `src/` directory? No / Yes
Would you like to use App Router? (recommended) No / Yes
Would you like to customize the import alias (`@/*` by default)? No / Yes
What import alias would you like configured? @/*
Would you like to include AGENTS.md to guide coding agents to write up-to-date swift-rust code? No / Yes

After the prompts, create-swift-rust will create a folder with your project files. Enter that folder and run bun install before starting the development server.

Non-interactive mode

Every prompt can be replaced with a flag. Useful for CI, scripts, or when you know exactly what you want.

Terminal
bun create swift-rust@latest my-app \
  --ts \
  --tailwind \
  --shadcn \
  --renderer ssr-wasm \
  --import-alias "@/*" \
  --yes

Project dependencies

The scaffolder adds these dependencies to the new project's package manifest:

  • swift-rust — the framework
  • react and react-dom — for components and pages
  • clsx and tailwind-merge — for the cn() utility (shadcn only)
  • tailwindcss — for styling (optional)
  • typescript — for type checking (TS only)

Next steps

Continue to Project structure to learn how the file system maps to routes.