Skip to content

idleRain/LLM-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Chat CLI

一个终端 LLM 对话应用,参考 Claude Code 的交互风格。默认适配 DeepSeek

特性

  • 🧠 流式思考过程:原生支持 DeepSeek reasoning_content,并按最新 thinking 模式发送 thinking / reasoning_effort
  • 🎨 Markdown 终端渲染:回复结束后自动渲染 Markdown,代码块带终端高亮
  • 状态提示:等待模型首包时显示 spinner
  • 📂 历史 session:每次启动新建会话,可通过 /sessions 列表 + /load 加载历史继续对话
  • 🔧 运行期可调/model/baseurl/temp/system 等命令热切换

安装

bun install

配置

复制环境变量模板:

cp .env.example .env

编辑 .env,至少填入 DeepSeek 的 API Key:

LLM_BASE_URL=https://api.deepseek.com
LLM_API_KEY=sk-xxx
LLM_MODEL=deepseek-v4-pro

DeepSeek thinking 模式默认开启:

  • 默认 thinking=enabled
  • 默认 reasoning_effort=high
  • 会话中可用 /thinking <on|off>/effort <high|max> 随时切换。

也可以切到其他 OpenAI 兼容端点:

厂商 base_url
DeepSeek(默认) https://api.deepseek.com
OpenAI https://api.openai.com/v1
智谱 GLM https://open.bigmodel.cn/api/paas/v4
Moonshot Kimi https://api.moonshot.cn/v1
阿里通义 https://dashscope.aliyuncs.com/compatible-mode/v1
OpenRouter https://openrouter.ai/api/v1

启动

bun run dev      # Bun 自动加载 .env
#
bun run start    # 同样自动加载 .env,也可使用进程环境变量覆盖

命令

  • /help — 显示帮助
  • /sessions — 列出历史会话
  • /load <序号|id> — 加载历史会话继续聊
  • /new — 新建会话
  • /history — 显示当前会话所有消息
  • /model <name> — 切换模型
  • /baseurl <url> — 切换 API 端点
  • /temp <n> — 调整温度(留空环境变量则使用模型默认)
  • /thinking <on|off> — 开关 DeepSeek thinking 模式
  • /effort <high|max> — 设置 DeepSeek reasoning_effort
  • /system <prompt> — 设置系统提示
  • /config — 显示当前配置
  • /where — 显示当前 session 落盘路径
  • /clear — 清屏
  • /exit 或 Ctrl+C×2 — 退出

存储位置

默认在 ~/.llm-chat/sessions/(可通过 LLM_SESSIONS_DIR 覆盖)。

每个 session 两个文件:

  • <id>.jsonl — 每行一条消息事件,实时追加
  • <id>.meta.json — 元数据(标题、模型、时间戳)

About

终端窗口 LLM 对话应用

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors