快速开始

前置条件

  • 为获得最佳 TUI 体验,推荐使用真正的终端(macOS Terminal、iTerm2、Windows Terminal 等)。
  • 如果通过 npm/pnpm/yarn 安装,建议使用较新版本的 Node.js。
  • 桌面 App 无需本地 Node.js 运行时。

桌面 App

下载 DimAgent Desktop 0.7.0

CLI 安装

当前 CLI 版本为 [email protected]

npm install -g dimcode@latest

其他包管理器:

# pnpm
pnpm add -g dimcode

# yarn
yarn global add dimcode

# bun
bun add -g dimcode

运行

dim
# or: npx dimcode

One-shot execution 会输出到 stdout,默认使用 full-access。需要收窄权限时,加 --policy read-only--policy workspace-write

dim exec "Review this repo and propose the next change"
dim exec --policy read-only "Review this repo without making changes"
cd /path/to/repo && dim exec --policy workspace-write "Run a focused code review"
echo "Review this code" | dim exec --stdin

验证

dim --version
dim

首次配置(推荐)

DimAgent 可以完全在 TUI 内完成配置:

  1. 打开命令面板:Ctrl+P
  2. 选择 Connect Provider(或直接输入 /connect
  3. 设置 API key / Base URL
  4. 选择模型:/models
  5. 设置工具审批:/approvalsautonormalstrict

提示:本地提供方(如 Ollama / LM Studio)通常不需要 API key,但需要在 Connect Provider 流程里补充模型 ID(或从端点拉取模型列表)。

应用内常用命令

命令面板

Ctrl+P 可快速访问:

  • 会话(切换/列表/新建)
  • 设置 / Connect Provider
  • 模型
  • 工具审批
  • 插件(配置 Serper 网页搜索)
  • MCP

斜杠命令

在输入框直接输入:

  • /connect - 连接提供方(API key / Base URL)
  • /models - 选择模型
  • /approvals - 工具审批模式(auto / normal / strict
  • /sessions - 列出会话
  • /new - 新建会话
  • /rename <title> - 重命名当前会话
  • /timeline(或 /tl)- 跳转到某条用户消息
  • /mcp - 配置 MCP 连接器与设置
  • /plugins - 配置 Serper 等插件
  • /language - 切换界面语言
  • /theme - 切换亮/暗主题

排障

没有 API key / unauthorized

  • 推荐使用 /connect 配置,或在环境变量里设置 OPENAI_API_KEY

终端渲染异常

可尝试:

dim --no-alt-screen --no-mouse

调试日志

dim --debug
# writes: ./dimcode-debug.log (override via DIMCODE_DEBUG_LOG=/path/to/file)