- Introduced comprehensive unit tests for the OpenAI plugin, covering SSE parsing, sentinel matching, delta extraction, request building, and more. - Created a new markdown file detailing coding and naming conventions for the dstalk project, including guidelines for comments, naming rules, code organization, and memory management practices.
40 lines
1.6 KiB
Markdown
40 lines
1.6 KiB
Markdown
# CLI 命令速查
|
|
|
|
dstalk 所有内置命令。在对话中直接输入 `/help` 或 `/h` 也可查看此列表。
|
|
|
|
---
|
|
|
|
## 命令表
|
|
|
|
| 命令 | 别名 | 作用 | 示例 |
|
|
|------|------|------|------|
|
|
| `/help` | `/h` | 显示命令列表 | `/help` |
|
|
| `/quit` | `/q` | 退出程序 | `/quit` |
|
|
| `/clear` | — | 清空当前会话上下文 | `/clear` |
|
|
| `/context` | — | 显示当前 Token 数和消息条数 | `/context` |
|
|
| `/status` | — | 显示当前运行状态 (脱敏: 不打印完整 API Key) | `/status` |
|
|
| `/model <name>` | — | 切换 AI 模型 | `/model gpt-4o` |
|
|
| `/file list [path]` | — | 列出目录内容, 不填 path 列出当前目录 | `/file list src/` |
|
|
| `/file show <path>` | — | 查看文件内容 | `/file show main.cpp` |
|
|
| `/file read <path>` | — | 读取文件内容 (同 `/file show`) | `/file read config.toml` |
|
|
| `/file write <path> <content>` | — | 写入文件内容 | `/file write hello.c #include <stdio.h>...` |
|
|
| `/save <path>` | — | 保存当前会话到文件 | `/save session.json` |
|
|
| `/load <path>` | — | 从文件恢复会话 | `/load session.json` |
|
|
|
|
---
|
|
|
|
## 命令规则
|
|
|
|
- 所有命令以 `/` 开头
|
|
- 不以下划线开头的输入视为 AI 对话内容, 由 AI 服务处理
|
|
- 模型切换即时生效, 不影响已累积的会话历史
|
|
- `/file show` 和 `/file read` 功能相同, 均为读取并打印文件内容
|
|
- `/status` 显示脱敏信息: API Key 只显示 "已设置" 或 "未设置", 不暴露完整值
|
|
|
|
---
|
|
|
|
## 相关文档
|
|
|
|
- [快速入门教程](../tutorial/quick-start.md) — 5 步上手
|
|
- [文档导航](../README.md) — 全部文档索引
|