mercur-cli
Use Mercur CLI commands correctly inside a project created from the Mercur basic starter. Use when choosing between `create`, `init`, `add`, `search`, `view`, and `diff`.
- License 许可
- MIT
- 所属仓库
- amoai-tech/mdeai
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- mercur-cli
- description
- Use Mercur CLI commands correctly inside a project created from the Mercur basic starter. Use when choosing between `create`, `init`, `add`, `search`, `view`, and `diff`.
03 SKILL.md 正文
Mercur CLI
Use this skill when:
- creating a new Mercur project
- initializing
blocks.json - searching, viewing, adding, or diffing blocks
- deciding whether a command should run from the project root or a workspace
Command map
create— create a new Mercur projectinit— createblocks.jsonin an existing projectsearch— search the registryview— inspect a block before installationadd— install a blockdiff— compare local installed block files against the registry
Where commands run
- Run Mercur CLI registry commands (
search,view,add,diff) from the project root whereblocks.jsonlives. - Run
medusacommands (db:generate,db:migrate) frompackages/apiusingbunx medusa. - Run admin or vendor verification from
apps/adminorapps/vendor.
Common flows
Discover and inspect a block
npx @mercurjs/cli@latest search --query <keyword>
npx @mercurjs/cli@latest view <block-name>
Add a block
npx @mercurjs/cli@latest add <block-name>
Important: When CLI asks to overwrite middlewares.ts, always decline (n) and merge manually.
Check local drift
npx @mercurjs/cli@latest diff <block-name>
After add
Follow the block docs output, but verify everything against the actual installed files:
- Middleware: Read the actual middleware file to get the correct export name and path. Add the import and spread to
src/api/middlewares.ts. - medusa-config.ts: Add modules, providers, plugin options, or env-driven config as docs specify.
- Migrations: If the block added a module with models, run
bunx medusa db:generate <module>andbunx medusa db:migratefrompackages/api. - Dependencies: If the dev server fails with "Cannot find module", install the missing dependency with
bun add <package>in the correct workspace. - Env vars: Add any required environment variables to
.env. - Validation: Run the dev server and check for startup errors before moving on.
Known CLI behaviors
- CLI may prompt "You need to create a blocks.json" even when it exists — this happens when running from the wrong directory.
- CLI's
addoutputs the block docs after installation — read them carefully but verify against installed files. - CLI may install files from one block that overlap with another block (shared files). Declining overwrites preserves existing work.
- The
searchcommand with--query ""returns all available blocks.
Avoid
- running registry commands outside the project root
- guessing block names without
searchorview - accepting
middlewares.tsoverwrite from CLI - assuming an installed block only changed one workspace
- trusting block docs blindly for import paths or dependencies
- skipping dev server validation after installing a block
04 同仓库更多 Skills
mde-pr-review-supabase
Use when reviewing MDE Supabase SQL, Auth and RLS changes in a pull request.
mde-pr-review-stripe
Use when reviewing MDE Stripe payments and webhooks changes in a pull request.
mde-pr-review-nextjs
Use when reviewing MDE Next.js App Router changes in a pull request.
mde-pr-review-mastra
Use when reviewing MDE Mastra agent, tool and workflow changes in a pull request.
mde-pr-review-maps
Use when reviewing MDE Google Maps and Places changes in a pull request.
mde-pr-review-copilotkit
Use when reviewing MDE CopilotKit and AG-UI changes in a pull request.