Files
openchamber/packages/docs/content/docs/zh-cn/commands-snippets.mdx
T
Bohdan Triapitsyn 967704a9b9 docs: add OpenChamber feature docs and translations (#1400)
* docs: add OpenChamber feature docs and translations

Add 30 new docs pages covering OpenChamber-specific workflows and setup:
OpenCode server, providers/models/agents, MCP, skills, commands & snippets,
usage, projects, context, notes/todos/plans, scheduled tasks, project actions,
preview, worktrees, multi-run, git & GitHub, magic prompts, git identities,
mobile/PWA, security, notifications, voice, project icons, remote instances,
desktop browser, updates, and three troubleshooting pages.

Rebuild sidebar into eight task-oriented sections and translate every new
page into all six supported locales (uk, zh-cn, es, pt-br, ko, pl).

* docs: surface new sections on homepage and cross-link tunnels

Add an Explore block to the docs homepage (all seven locales) linking to
the new section anchors, and cross-link the Tunnels page to Security and
PWA & Mobile.
2026-05-24 14:15:55 +03:00

40 lines
1.6 KiB
Plaintext

---
title: 命令与代码片段
description: 为聊天创建可复用的斜杠命令和文本片段。
---
# 命令与代码片段
命令和代码片段都能让你免于重复输入相同的内容。命令是你用 `/` 触发的完整提示词;代码片段是你用 `#` 插入到消息中的文本片段。
## 命令
命令是你用斜杠运行的已保存提示词,比如 `/review`。在 **Settings → Commands** 中管理它们。
1. 打开 **Settings → Commands** 并创建一个命令。
2. 给它一个名称、一段描述,以及它应发送的提示词文本。
3. 可选地将它固定到特定的智能体或模型。
4. 选择个人或项目范围。
在聊天中,将 `/` 作为消息的**第一个**字符即可调出命令,然后选择一个。你的文本可以使用占位符:
- `$ARGUMENTS` — 你在命令后输入的任何内容
- `@filename` — 插入某个文件的内容
- `` !`command` `` — 插入某个 shell 命令的输出
内置的 `init` 和 `review` 命令可以重置,但不能删除。
## 代码片段
代码片段是你用井号在行内引用的可复用文本,比如 `#signoff`。在 **Settings → Snippets** 中管理它们。
1. 打开 **Settings → Snippets** 并创建一个代码片段。
2. 给它一个名称以及它所代表的文本。如果你想要多个触发词,可以添加别名。
3. 选择个人或项目范围。
在聊天中,输入 `#` 并选择一个代码片段。OpenChamber 会在发送前替换为完整文本。
## 相关内容
- [Skills](/zh-cn/skills/) — 按需加载更大的指令集