Skip to main content

Requirements

The quickest way to get PostgreSQL running locally is with Docker:
docker run -d --name mercur-postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 postgres:16
Or on macOS with Homebrew:
brew install postgresql@16 && brew services start postgresql@16

Create a new project

bunx @mercurjs/cli@latest create
The CLI will prompt for a project name and template, then handle everything automatically:
  • downloads the template
  • installs dependencies
  • creates and migrates the database
  • seeds initial data
  • starts the development server and opens the admin setup page in your browser

Options

OptionDescriptionDefault
--template <template>Template to use (basic or plugin)prompted
--db-connection-string <string>Full PostgreSQL connection string
--db-host <host>PostgreSQL hostlocalhost
--db-port <port>PostgreSQL port5432
--no-depsSkip dependency installation
--skip-dbSkip database setup

Start the development server

After stopping the server, start it again from your project directory:
cd <your-project-name>
bun dev

Initialize an existing project

If you have an existing Medusa project, initialize Mercur in it:
bunx @mercurjs/cli@latest init
This creates a blocks.json configuration file in your project.

Add blocks

Install blocks from the registry:
bunx @mercurjs/cli@latest add <block-name>
Browse available blocks:
bunx @mercurjs/cli@latest search

Run database migrations

After adding blocks that include modules:
bunx medusa db:generate <module1> <module2> ...
bunx medusa db:migrate