@mercurjs/cli@latest) manages your marketplace project — creating projects, installing blocks, generating types, and checking for updates.
Installation
Commands
create
Scaffold a new Mercur project from a template.| Option | Description |
|---|---|
-t, --template <template> | Template to use (default: basic) |
--no-deps | Skip dependency installation |
--skip-db | Skip database configuration |
--db-connection-string <string> | PostgreSQL connection string |
init
Initialize an existing project by creating ablocks.json configuration file.
| Option | Description |
|---|---|
-d, --defaults | Use default paths without prompting |
-s, --silent | Suppress output |
add
Install blocks from the registry into your project.| Option | Description |
|---|---|
-o, --overwrite | Overwrite existing files |
-y, --yes | Skip confirmation |
-s, --silent | Suppress output |
search
Find available blocks in the registry.| Option | Description |
|---|---|
-q, --query <query> | Search by name or description |
-r, --registry <registry> | Registry to search (default: @mercurjs) |
view
Display detailed information about a block.diff
Compare local blocks against registry versions to check for updates.codegen
Generate TypeScript types from your API routes. Used by the API Client for type-safe requests.| Option | Description |
|---|---|
-w, --watch | Watch for changes and regenerate automatically |
registry:build
Build a custom registry from aregistry.json file.
| Option | Description |
|---|---|
-o, --output <path> | Output directory (default: ./r) |
-v, --verbose | Show detailed output |
info
Display project configuration and diagnostics.telemetry
Control anonymous usage data collection.Custom registries
Add custom block registries to yourblocks.json:
{name} as a placeholder for block names. Reference custom registries with the -r flag: