mercur-cli

Guides correct usage of Mercur CLI commands for installing and managing Medusa blocks.

1|Updated Sep 15, 2026
One-click install
npx skills add https://github.com/amoai-tech/mdeai --skill mercur-cli-amoai-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mercur-cli
Source: https://github.com/amoai-tech/mdeai/tree/main/commerce/mercur/.claude/skills/mercur-cli
Command: npx skills add https://github.com/amoai-tech/mdeai --skill mercur-cli-amoai-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working with Mercur-based Medusa projects often run CLI commands from the wrong directory, accept destructive file overwrites, or trust block documentation blindly, leading to broken middlewares, missing migrations, and failed dev servers. ## Core Features & Use Cases - Command Selection: Clarifies when to use create, init, search, view, add, and diff against the Mercur block registry. - Directory Discipline: Enforces running registry commands from the project root where blocks.json lives, and Medusa commands from packages/api. - Post-Install Verification: Walks through middleware wiring, medusa-config updates, migrations, dependency installs, and env vars after adding a block. - Use Case: After running npx @mercurjs/cli@latest add reviews, use this Skill to correctly merge the new middleware export into src/api/middlewares.ts, generate migrations with bunx medusa db:generate, and validate the dev server starts cleanly. ## Quick Start Ask the assistant to search the Mercur registry for a reviews block, install it, and wire up its middleware and migrations correctly.

Frequently Asked Questions about mercur-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a block to a Mercur project?

Run npx @mercurjs/cli@latest add <block-name> from the project root where blocks.json lives. Afterward, manually merge middleware into src/api/middlewares.ts, update medusa-config.ts, and run migrations from packages/api if the block added models.

How do I search the Mercur block registry?

Run npx @mercurjs/cli@latest search --query <keyword> from the project root. Passing an empty query string returns all available blocks, and you can inspect one with the view command before installing.

Why does the Mercur CLI say blocks.json is missing when it exists?

This happens when the command runs from the wrong directory. Registry commands like search, view, add, and diff must run from the project root where blocks.json actually lives, not from a workspace subdirectory.

Should I accept the middlewares.ts overwrite prompt from the Mercur CLI?

No, always decline the overwrite and merge manually. Accepting it can destroy existing middleware wiring, so read the installed middleware file for the correct export name and add the import and spread yourself.

What should I do after installing a Mercur block?

Verify the actual installed files rather than trusting the printed docs. Wire middleware, update medusa-config.ts, run bunx medusa db:generate and db:migrate from packages/api if models were added, install missing dependencies, set env vars, and start the dev server to check for errors.