Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ”§ chore: stop prettier from rewriting shell blocks in Markdown (#20016)

YuTengjing769c006afcc6
diff --git a/.agents/skills/cli/references/agent.md b/.agents/skills/cli/references/agent.md
index a111dcaf9f4..38a256df2cd 100644
--- a/.agents/skills/cli/references/agent.md
+++ b/.agents/skills/cli/references/agent.md
@@ -8,7 +8,7 @@ Manage AI agents: create, edit, delete, list, run, and check status.
List all agents.
-```text
+```bash
lh agent list [-L <n>] [-k <keyword>] [--json [fields]]
```
@@ -26,7 +26,7 @@ lh agent list [-L <n>] [-k <keyword>] [--json [fields]]
View agent configuration details. `agentId` may be omitted when `-s, --slug` is given instead.
-```text
+```bash
lh agent view [agentId] [-s <slug>] [--json [fields]]
```
@@ -38,7 +38,7 @@ lh agent view [agentId] [-s <slug>] [--json [fields]]
Create a new agent.
-```text
+```bash
lh agent create [-t <title>] [-d <desc>] [-m <model>] [-p <provider>] [-s <role>] [--group <groupId>]
```
@@ -61,7 +61,7 @@ Update an existing agent. `agentId` may be omitted when `--slug` is given instea
`create`/`view`, this flag has no `-s` short alias here because `-s` is used for `--system-role`).
Only specified fields are updated.
-```text
+```bash
lh agent edit [agentId] [--slug <slug>] [-t <title>] [-d <desc>] [-m <model>] [-p <provider>] [-s <role>] [--graph-file <path>] [--enable-graph] [--disable-graph] [--agency-config-file <path>] [--config-file <path>] [--json [fields]]
```
@@ -86,7 +86,7 @@ lh agent edit [agentId] [--slug <slug>] [-t <title>] [-d <desc>] [-m <model>] [-
Delete an agent.
-```text
+```bash
lh agent delete <agentId> [--yes]
```
@@ -98,7 +98,7 @@ Requires confirmation unless `--yes` is provided.
Duplicate an existing agent.
-```text
+```bash
lh agent duplicate <agentId> [-t <title>]
```
@@ -115,7 +115,7 @@ lh agent duplicate <agentId> [-t <title>]
Start an agent execution. Streams over the agent gateway WebSocket by default, or via SSE with
`--sse`.
-```text
+```bash
lh agent run [-a <id>] [-s <slug>] [-p <text>] [-t <id>] [--no-auto-start] [--device <target>] [--no-headless] [--json] [-v] [--replay <file>] [--sse]
```
@@ -154,7 +154,7 @@ falls back to polling `agent status` every 10 seconds until the run reaches a te
Check agent operation status.
-```text
+```bash
lh agent status <operationId> [--json [fields]] [--history] [--history-limit <n>]
```
diff --git a/.agents/skills/cli/references/conversation.md b/.agents/skills/cli/references/conversation.md
index 0b16ef45567..39bc592e113 100644
--- a/.agents/skills/cli/references/conversation.md
+++ b/.agents/skills/cli/references/conversation.md
@@ -8,7 +8,7 @@ Manage conversation topics (threads).
### `lh topic list`
-```text
+```bash
lh topic list [--agent-id <id>] [-L <n>] [-P <n>] [--json [fields]]
```
@@ -22,13 +22,13 @@ lh topic list [--agent-id <id>] [-L <n>] [-P <n>] [--json [fields]]
### `lh topic search <keywords>`
-```text
+```bash
lh topic search <keywords> [--agent-id <id>] [--json [fields]]
```
### `lh topic create`
-```text
+```bash
lh topic create -t <title> [--agent-id <id>] [--favorite]
```
@@ -40,7 +40,7 @@ lh topic create -t <title> [--agent-id <id>] [--favorite]
### `lh topic edit <id>`
-```text
+```bash
lh topic edit <id> [-t <title>] [--favorite] [--no-favorite]
```
@@ -49,13 +49,13 @@ lh topic edit <id> [-t <title>] [--favorite] [--no-favorite]
IDs may be passed as arguments, read from a file with `-f, --file <path>` (one per line, or a
JSON array), or both combined; at least one ID must resolve or the command errors.
-```text
+```bash
lh topic delete [id1] [id2...] [-f <path>] [--yes]
```
### `lh topic recent`
-```text
+```bash
lh topic recent [-L <n>] [--json [fields]]
```
@@ -73,7 +73,7 @@ Manage chat messages within topics.
### `lh message list`
-```text
+```bash
lh message list [--topic-id <id>] [--agent-id <id>] [--role <role>] [--start <date>] [--end <date>] [-L <n>] [-P <n>] [--user] [--json [fields]]
```
@@ -94,7 +94,7 @@ lh message list [--topic-id <id>] [--agent-id <id>] [--role <role>] [--start <da
### `lh message search <keywords>`
-```text
+```bash
lh message search <keywords> [--json [fields]]
```
@@ -102,13 +102,13 @@ Full-text search across all messages.
### `lh message delete <ids...>`
-```text
+```bash
lh message delete <id1> [id2...] [--yes]
```
### `lh message count`
-```text
+```bash
lh message count [--topic-id <id>] [--agent-id <id>] [--role <role>] [--start <date>] [--end <date>] [--group-by <field>] [--json]
```
@@ -126,7 +126,7 @@ lh message count [--topic-id <id>] [--agent-id <id>] [--role <role>] [--start <d
### `lh message heatmap`
-```text
+```bash
lh message heatmap [--json]
```
diff --git a/.agents/skills/cli/references/generate.md b/.agents/skills/cli/references/generate.md
index f8e90a2c6b4..419d3721efe 100644
--- a/.agents/skills/cli/references/generate.md
+++ b/.agents/skills/cli/references/generate.md
@@ -31,7 +31,7 @@ Generate text completion.
**Source**: `apps/cli/src/commands/generate/text.ts`
-```text
+```bash
lh gen text <prompt> [-m <model>] [-p <provider>] [-s <prompt>] [--temperature <n>] [--max-tokens <n>] [--stream] [--json] [--pipe]
```
@@ -66,7 +66,7 @@ Generate images from text prompt. This is an async operation β€” the command sub
**Source**: `apps/cli/src/commands/generate/image.ts`
-```text
+```bash
lh gen image <prompt> [-m <model>] [-p <provider>] [-n <n>] [--width <px>] [--height <px>] [--steps <n>] [--seed <n>] [--json]
```
@@ -117,7 +117,7 @@ Generate video from text prompt. This is an async operation.
**Source**: `apps/cli/src/commands/generate/video.ts`
-```text
+```bash
lh gen video <prompt> -m <model> -p <provider> [--aspect-ratio <ratio>] [--duration <sec>] [--resolution <res>] [--seed <n>] [--image <url>] [--images <urls...>] [--end-image <url>] [--json]
```
@@ -171,7 +171,7 @@ Text-to-speech generation.
**Source**: `apps/cli/src/commands/generate/tts.ts`
-```text
+```bash
lh gen tts <text> [-o <file>] [--voice <voice>] [--speed <n>] [--model <model>]
```
@@ -190,7 +190,7 @@ Audio-to-text transcription (Automatic Speech Recognition). Accepts a local path
**Source**: `apps/cli/src/commands/generate/asr.ts`
-```text
+```bash
lh gen asr <audio-file> [--model <model>] [--provider <provider>] [--language <lang>] [--json]
```
@@ -216,7 +216,7 @@ Wait for an async generation task to complete and download the result file.
> ⚠️ `<asyncTaskId>` is the UUID printed after "β†’ Task" in the video/image output.
> Do **not** pass the generation ID (`gen_xxx`) here β€” that will cause a server error.
-```text
+```bash
lh gen download <generationId> <asyncTaskId> [-o <path>] [--interval <sec>] [--timeout <sec>]
```
@@ -247,7 +247,7 @@ Check the status of an async generation task.
> ⚠️ `<asyncTaskId>` is the UUID printed after "β†’ Task" in the video/image output.
> Do **not** pass the generation ID (`gen_xxx`) here β€” that will cause a server error.
-```text
+```bash
lh gen status <generationId> <asyncTaskId> [--json]
```
@@ -271,7 +271,7 @@ lh gen status gen_xxx 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx
List all generation topics.
-```text
+```bash
lh gen list [--json [fields]]
```
diff --git a/.agents/skills/cli/references/knowledge.md b/.agents/skills/cli/references/knowledge.md
index 2f3035f4559..6cbbc928410 100644
--- a/.agents/skills/cli/references/knowledge.md
+++ b/.agents/skills/cli/references/knowledge.md
@@ -16,7 +16,7 @@ lh kb list [--json [fields]]
### `lh kb view <id>`
-```text
+```bash
lh kb view <id> [--json [fields]]
```
@@ -26,7 +26,7 @@ lh kb view <id> [--json [fields]]
### `lh kb create`
-```text
+```bash
lh kb create -n <name> [-d <desc>] [--avatar <url>]
```
@@ -40,7 +40,7 @@ lh kb create -n <name> [-d <desc>] [--avatar <url>]
### `lh kb edit <id>`
-```text
+```bash
lh kb edit <id> [-n <name>] [-d <desc>] [--avatar <url>]
```
@@ -48,7 +48,7 @@ Requires at least one change flag. Errors if none specified.
### `lh kb delete <id>`
-```text
+```bash
lh kb delete <id> [--remove-files] [--yes]
```
@@ -59,7 +59,7 @@ lh kb delete <id> [--remove-files] [--yes]
### `lh kb add-files <knowledgeBaseId>`
-```text
+```bash
lh kb add-files <kbId> --ids <fileId1> [fileId2...]
```
@@ -67,7 +67,7 @@ Link existing files to a knowledge base.
### `lh kb remove-files <knowledgeBaseId>`
-```text
+```bash
lh kb remove-files <kbId> --ids <fileId1> [fileId2...] [--yes]
```
@@ -75,7 +75,7 @@ Unlink files from a knowledge base.
### `lh kb mkdir <knowledgeBaseId>`
-```text
+```bash
lh kb mkdir <kbId> -n <name> [--parent <folderId>]
```
@@ -88,7 +88,7 @@ Create a folder in a knowledge base. Uses `document.createDocument` with `fileTy
### `lh kb create-doc <knowledgeBaseId>`
-```text
+```bash
lh kb create-doc <kbId> -t <title> [-c <content>] [--parent <folderId>]
```
@@ -102,7 +102,7 @@ Create a document in a knowledge base. Uses `document.createDocument` with `file
### `lh kb move <id>`
-```text
+```bash
lh kb move <id> [--type <file|doc>] [--parent <folderId>]
```
@@ -117,7 +117,7 @@ Uses `document.updateDocument` for docs, `file.updateFile` for files.
### `lh kb upload <knowledgeBaseId> <filePath>`
-```text
+```bash
lh kb upload <kbId> <filePath> [--parent <folderId>]
```
@@ -139,7 +139,7 @@ Manage uploaded files.
### `lh file list`
-```text
+```bash
lh file list [--kb-id <id>] [-L <n>] [--json [fields]]
```
@@ -152,7 +152,7 @@ lh file list [--kb-id <id>] [-L <n>] [--json [fields]]
### `lh file view <id>`
-```text
+```bash
lh file view <id> [--json [fields]]
```
@@ -160,7 +160,7 @@ lh file view <id> [--json [fields]]
### `lh file delete <ids...>`
-```text
+```bash
lh file delete <id1> [id2...] [--yes]
```
@@ -168,7 +168,7 @@ Supports deleting multiple files at once.
### `lh file recent`
-```text
+```bash
lh file recent [-L <n>] [--json [fields]]
```
@@ -186,7 +186,7 @@ Manage text documents (notes, wiki pages).
### `lh doc list`
-```text
+```bash
lh doc list [-L <n>] [--file-type <type>] [--source-type <type>] [--json [fields]]
```
@@ -200,7 +200,7 @@ lh doc list [-L <n>] [--file-type <type>] [--source-type <type>] [--json [fields
### `lh doc view <id>`
-```text
+```bash
lh doc view <id> [--json [fields]]
```
@@ -208,7 +208,7 @@ lh doc view <id> [--json [fields]]
### `lh doc create`
-```text
+```bash
lh doc create -t <title> [-b <content>] [-F <path>] [--parent <id>] [--slug <slug>] [--kb <id>] [--file-type <type>]
```
@@ -236,13 +236,13 @@ Each object in the array can have: `title`, `content`, `fileType`, `knowledgeBas
### `lh doc edit <id>`
-```text
+```bash
lh doc edit <id> [-t <title>] [-b <content>] [-F <path>] [--parent <id>] [--file-type <type>]
```
### `lh doc delete <ids...>`
-```text
+```bash
lh doc delete <id1> [id2...] [--yes]
```
@@ -250,7 +250,7 @@ lh doc delete <id1> [id2...] [--yes]
Parse an uploaded file into a document.
-```text
+```bash
lh doc parse <fileId> [--with-pages] [--json [fields]]
```
@@ -264,7 +264,7 @@ lh doc parse <fileId> [--with-pages] [--json [fields]]
Associate a document with a topic. Creates a linked copy via the notebook router.
-```text
+```bash
lh doc link-topic <docId> <topicId>
```
@@ -272,7 +272,7 @@ lh doc link-topic <docId> <topicId>
List documents associated with a topic.
-```text
+```bash
lh doc topic-docs <topicId> [--type <type>] [--json [fields]]
```
diff --git a/.agents/skills/cli/references/memory.md b/.agents/skills/cli/references/memory.md
index 81aa590163a..e308d79d737 100644
--- a/.agents/skills/cli/references/memory.md
+++ b/.agents/skills/cli/references/memory.md
@@ -38,7 +38,7 @@ lh memory list preference # Only preferences
Create a new identity memory entry.
-```text
+```bash
lh memory create [--type <type>] [--role <role>] [--relationship <rel>] [-d <desc>] [--labels <labels...>]
```
@@ -56,7 +56,7 @@ lh memory create [--type <type>] [--role <role>] [--relationship <rel>] [-d <des
Edit a memory entry. Options vary by category:
-```text
+```bash
lh memory edit identity <id> [--type <type>] [--role <role>] [--relationship <rel>] [-d <desc>] [--labels <labels...>]
lh memory edit activity <id> [--narrative <text>] [--notes <text>] [--status <status>]
lh memory edit context <id> [--title <title>] [--description <desc>] [--status <status>]
@@ -90,7 +90,7 @@ lh memory edit preference <id> [--directives <text>] [--suggestions <text>]
## `lh memory delete <category> <id>`
-```text
+```bash
lh memory delete <category> <id> [--yes]
```
@@ -100,7 +100,7 @@ lh memory delete <category> <id> [--yes]
Display the compiled memory persona summary.
-```text
+```bash
lh memory persona [--json [fields]]
```
@@ -112,7 +112,7 @@ lh memory persona [--json [fields]]
Trigger async memory extraction from chat history.
-```text
+```bash
lh memory extract [--from <date>] [--to <date>]
```
@@ -129,7 +129,7 @@ Starts a background task that analyzes chat history and creates new memory entri
Check the status of a memory extraction task.
-```text
+```bash
lh memory extract-status [--task-id <id>] [--json [fields]]
```
diff --git a/.agents/skills/cli/references/models-providers.md b/.agents/skills/cli/references/models-providers.md
index 02bc2a7761d..b55fc1419c6 100644
--- a/.agents/skills/cli/references/models-providers.md
+++ b/.agents/skills/cli/references/models-providers.md
@@ -29,7 +29,7 @@ lh model list lobehub --type video --json
### `lh model view <id>`
-```text
+```bash
lh model view <id> [--json [fields]]
```
@@ -37,7 +37,7 @@ lh model view <id> [--json [fields]]
### `lh model create`
-```text
+```bash
lh model create --id <id> --provider <providerId> [--display-name <name>] [--type <type>]
```
@@ -50,7 +50,7 @@ lh model create --id <id> --provider <providerId> [--display-name <name>] [--typ
### `lh model edit <id>`
-```text
+```bash
lh model edit <id> --provider <providerId> [--display-name <name>] [--type <type>]
```
@@ -58,7 +58,7 @@ lh model edit <id> --provider <providerId> [--display-name <name>] [--type <type
Enable or disable a model.
-```text
+```bash
lh model toggle <id> --provider <providerId> --enable
lh model toggle <id> --provider <providerId> --disable
```
@@ -79,7 +79,7 @@ lh model batch-toggle model1 model2 model3 --provider openai --enable
### `lh model delete <id>`
-```text
+```bash
lh model delete <id> --provider <providerId> [--yes]
```
@@ -87,7 +87,7 @@ lh model delete <id> --provider <providerId> [--yes]
Clear all models (or only remote/fetched models) for a provider.
-```text
+```bash
lh model clear --provider <providerId> [--remote] [--yes]
```
@@ -101,7 +101,7 @@ Manage AI service providers.
### `lh provider list`
-```text
+```bash
lh provider list [--json [fields]]
```
@@ -109,7 +109,7 @@ lh provider list [--json [fields]]
### `lh provider view <id>`
-```text
+```bash
lh provider view <id> [--json [fields]]
```
@@ -117,7 +117,7 @@ lh provider view <id> [--json [fields]]
### `lh provider create`
-```text
+```bash
lh provider create --id <id> -n <name> [-s <source>] [-d <desc>] [--logo <url>] [--sdk-type <type>]
```
@@ -132,7 +132,7 @@ lh provider create --id <id> -n <name> [-s <source>] [-d <desc>] [--logo <url>]
### `lh provider edit <id>`
-```text
+```bash
lh provider edit <id> [-n <name>] [-d <desc>] [--logo <url>] [--sdk-type <type>]
```
@@ -174,13 +174,13 @@ lh provider test openai -m gpt-4o --json
### `lh provider toggle <id>`
-```text
+```bash
lh provider toggle <id> --enable
lh provider toggle <id> --disable
```
### `lh provider delete <id>`
-```text
+```bash
lh provider delete <id> [--yes]
```
diff --git a/.agents/skills/cli/references/search-config.md b/.agents/skills/cli/references/search-config.md
index d4aeccd7a74..b5a6b07bd41 100644
--- a/.agents/skills/cli/references/search-config.md
+++ b/.agents/skills/cli/references/search-config.md
@@ -11,7 +11,7 @@ Search across local resources, or the web with `--web`.
`-q, --query` is not a positional argument β€” it's an option. If omitted, the command prints help
and exits instead of erroring.
-```text
+```bash
lh search -q <query> [-w] [-t <type>] [-L <n>] [-e <engines>] [-c <categories>] [-T <range>] [--json [fields]]
```
@@ -55,7 +55,7 @@ results are printed as a table of TITLE, URL, SCORE, CONTENT.
View details of a single result: a URL crawls the page (web result); `type:id` (e.g.
`agent:abc123`) looks up a local resource.
-```text
+```bash
lh search view <target> [-i <impls>] [--json [fields]]
```
@@ -76,7 +76,7 @@ lh search view <target> [-i <impls>] [--json [fields]]
Display current authenticated user information.
-```text
+```bash
lh whoami [--json [fields]]
```
@@ -86,7 +86,7 @@ lh whoami [--json [fields]]
Display usage statistics.
-```text
+```bash
lh usage [--month <YYYY-MM>] [--agent-id <id>] [--daily] [--json [fields]]
```
diff --git a/.agents/skills/cli/references/skills-plugins.md b/.agents/skills/cli/references/skills-plugins.md
index 3c246598aaa..7f3c620fc46 100644
--- a/.agents/skills/cli/references/skills-plugins.md
+++ b/.agents/skills/cli/references/skills-plugins.md
@@ -8,7 +8,7 @@ Manage agent skills (custom instructions and capabilities).
### `lh skill list`
-```text
+```bash
lh skill list [--source <source>] [--json [fields]]
```
@@ -20,7 +20,7 @@ lh skill list [--source <source>] [--json [fields]]
### `lh skill view <id>`
-```text
+```bash
lh skill view <id> [--json [fields]]
```
@@ -28,7 +28,7 @@ lh skill view <id> [--json [fields]]
### `lh skill create`
-```text
+```bash
lh skill create -n <name> -d <desc> -c <content> [-i <id>]
```
@@ -43,19 +43,19 @@ lh skill create -n <name> -d <desc> -c <content> [-i <id>]
Requires at least one of `-c`/`-n`/`-d`; errors if none specified.
-```text
+```bash
lh skill edit <id> [-n <name>] [-d <desc>] [-c <content>]
```
### `lh skill delete <id>`
-```text
+```bash
lh skill delete <id> [--yes]
```
### `lh skill search <query>`
-```text
+```bash
lh skill search <query> [--json [fields]]
```
@@ -93,7 +93,7 @@ lh skill i my-cool-skill
List files/resources within a skill.
-```text
+```bash
lh skill resources <id> [--json [fields]]
```
@@ -103,7 +103,7 @@ lh skill resources <id> [--json [fields]]
Read a specific resource file from a skill.
-```text
+```bash
lh skill read-resource <id> <path>
```
@@ -119,7 +119,7 @@ Install and manage plugins (external tool integrations).
### `lh plugin list`
-```text
+```bash
lh plugin list [--json [fields]]
```
@@ -127,7 +127,7 @@ lh plugin list [--json [fields]]
### `lh plugin install`
-```text
+```bash
lh plugin install -i <id> --manifest <json> [--type <type>] [--settings <json>]
```
@@ -140,7 +140,7 @@ lh plugin install -i <id> --manifest <json> [--type <type>] [--settings <json>]
### `lh plugin uninstall <id>`
-```text
+```bash
lh plugin uninstall <id> [--yes]
```
@@ -148,6 +148,6 @@ lh plugin uninstall <id> [--yes]
Requires `--manifest` or `--settings` (at least one); errors if neither is specified.
-```text
+```bash
lh plugin update <id> [--manifest <json>] [--settings <json>]
```
diff --git a/AGENTS.md b/AGENTS.md
index cd220823936..426aab27e4a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -15,8 +15,6 @@ Guidelines for using AI coding agents in this opensource LobeHub repository.
`AGENTS.md` owns repository-wide architecture and workflow. Keep detailed implementation rules in skills so they have one source of truth.
-In skill and agent Markdown, put command synopses or shell snippets containing `<placeholder>` or `[optional]` syntax in ` ```text ` fences. Prettier's shell plugin formats ` ```bash ` fences and rewrites those placeholders as redirections and globs, e.g. `<id>` becomes `< id >`.
-
The `acceptance` skill is generated from the default branch of [lobehub/acceptance](https://github.com/lobehub/acceptance). Maintain its source there; update the committed `.agents/skills/acceptance/` copy using `bun apps/cli/src/index.ts acceptance update`. Repository-specific acceptance setup stays in `.agents/acceptance/`.
- **React and TSX**: Before editing components, component state, render boundaries, or memoization, read the `react` skill. It owns component selection, styling, state locality, and render-performance rules.
diff --git a/prettier.config.mjs b/prettier.config.mjs
index 9e4f773a4e0..28c65bd9591 100644
--- a/prettier.config.mjs
+++ b/prettier.config.mjs
@@ -1,3 +1,17 @@
import { prettier } from '@lobehub/lint';
-export default prettier;
+export default {
+ ...prettier,
+ overrides: [
+ ...prettier.overrides,
+ {
+ /**
+ * Leave shell code blocks in docs untouched. prettier-plugin-sh parses command synopses such as
+ * `lh model view <id> [--json]` as real shell and rewrites `<id>` into a redirection and
+ * `[--json]` into a glob. Standalone `.sh` files keep the shell formatter.
+ */
+ files: ['*.md', '*.mdx'],
+ options: { plugins: prettier.plugins.filter((plugin) => plugin !== 'prettier-plugin-sh') },
+ },
+ ],
+};