Installation
branchly is one dev dependency. Use whatever package manager your project already uses:
npm install --save-dev branchly # npmpnpm add -D branchly # pnpmyarn add -D branchly # Yarnbun add -d branchly # BunThen let branchly set itself up:
npx branchly init # or: pnpm branchly init · yarn branchly initThat single command:
- Detects your stack — Prisma, Drizzle, or Knex; PostgreSQL, MySQL, or SQLite; your env setup.
- Installs the matching adapter packages with your detected package manager (pass
--no-installto print the install command instead). - Writes
branchly.config.tsdescribing what it found. - Installs the Git hooks —
post-checkoutfor provisioning andpost-mergefor cleanup offers, coexisting politely with Husky or a customcore.hooksPath. - Gitignores the local manifest and your env file.
Connection detection
Section titled “Connection detection”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.
Requirements
Section titled “Requirements”- Node.js ≥ 22
- A Git repository
- A database your migrations already run against (PostgreSQL, MySQL, or SQLite out of the box)
Share it with your team
Section titled “Share it with your team”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.