Docs / Installation
Installation
Install the CLI, confirm Bun 1.3+, scaffold your first project.
Hopak runs on Bun. Install the CLI globally, scaffold a project with hopak new, and you have a working server on http://localhost:3000.
Requirements
- Bun ≥ 1.3
Install the CLI
bun add -g @hopak/cli
Scaffold a project
hopak new my-app # SQLite by default (zero-install)
cd my-app
hopak dev
hopak new runs bun install for you — no separate step.
Pick a dialect up front
Want Postgres or MySQL from the start? Pick the dialect at creation time — the driver gets installed, hopak.config.ts is pre-set, and .env.example already has DATABASE_URL:
hopak new my-app --db postgres
hopak new my-app --db mysql
hopak new my-app --db sqlite # explicit opt-in (default)
Scaffold only, skip install (CI / offline):
hopak new my-app --no-install
Switch dialects later
Already inside a project? Switch dialects with hopak use:
hopak use postgres # installs `postgres` driver, patches config, updates .env.example
hopak use mysql # installs `mysql2`, etc.
hopak use sqlite # back to default
Picking the dialect up front (or via hopak use) writes the right database: block into hopak.config.ts, adds the driver to package.json, and seeds .env.example with a DATABASE_URL placeholder.
Next: Quick start.