Skip to content

Installation

branchly is one dev dependency. Use whatever package manager your project already uses:

Terminal window
npm install --save-dev branchly # npm
pnpm add -D branchly # pnpm
yarn add -D branchly # Yarn
bun add -d branchly # Bun

Then let branchly set itself up:

Terminal window
npx branchly init # or: pnpm branchly init · yarn branchly init

That single command:

  1. Detects your stack — Prisma, Drizzle, or Knex; PostgreSQL, MySQL, or SQLite; your env setup.
  2. Installs the matching adapter packages with your detected package manager (pass --no-install to print the install command instead).
  3. Writes branchly.config.ts describing what it found.
  4. Installs the Git hookspost-checkout for provisioning and post-merge for cleanup offers, coexisting politely with Husky or a custom core.hooksPath.
  5. Gitignores the local manifest and your env file.

branchly never needs a new credential. It finds your existing connection — a .env file, Doppler, direnv, CI secrets, or your Prisma datasource — keeps the host and credentials, and just swaps the database name: a maintenance connection for creating and cloning databases, and a fresh app_<branch> database per branch.

  • Node.js ≥ 22
  • A Git repository
  • A database your migrations already run against (PostgreSQL, MySQL, or SQLite out of the box)

Commit the generated branchly.config.ts. Teammates install branchly, run branchly init (it keeps an existing config), and inherit the exact same setup.

Next up: the quickstart.