
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
@huyooo/ai-chat-cli
Advanced tools
终端 AI 对话工具,与业界 CLI(Claude Code、Aider、Gemini CLI、OpenCode)使用方式一致。
\ + Enter 换行@ 引用文件,/add /drop 管理上下文! 执行 Shell 命令/web URL 抓取网页内容/git 快速查看状态、diff、log/compress 压缩长对话# npm 全局安装
npm install -g @huyooo/ai-chat-cli
# 或从源码安装
cd ai-chat/packages/ai-chat-cli
npm link
# 设置 API Key(至少配置一个)
ai-chat config --set arkApiKey=YOUR_ARK_API_KEY
ai-chat config --set geminiApiKey=YOUR_GEMINI_KEY
ai-chat config --set qwenApiKey=YOUR_QWEN_KEY
# Web 搜索(可选)
ai-chat config --set tavilyApiKey=YOUR_TAVILY_KEY
# 查看配置
ai-chat config --list
配置文件:~/.ai-chat/config.json
ai-chat
界面:
◆ AI Chat • ask • doubao-seed-1-6 1.2k↑ 0.8k↓
你: 你好
AI: 你好!有什么我可以帮助你的吗?
❯ _
@ 文件 • / 命令 • ! Shell • \↵ 换行 • ^L 清屏
| 按键 | 功能 |
|---|---|
@ | 打开文件选择器 |
/ | 打开命令菜单 |
!cmd | 执行 Shell 命令 |
\ + Enter | 多行输入 |
↑↓ | 历史记录 |
Ctrl+L | 清屏 |
Ctrl+C | 取消生成/退出 |
Ctrl+D | 退出 |
t | 切换思考显示 |
输入 / 打开命令菜单,或直接输入:
| 命令 | 说明 |
|---|---|
/help | 显示帮助 |
/model | 选择模型 |
/mode ask|agent | 切换模式 |
/add <file> | 添加文件到上下文 |
/drop [file] | 移除文件(不带参数移除全部) |
/files | 列出上下文文件 |
/web <URL> | 抓取网页内容 |
/git [cmd] | Git 命令(status/diff/log/branch) |
/compress | 压缩对话上下文 |
/tokens | 显示 Token 统计 |
/clear | 清空对话 |
/exit | 退出 |
# 单次查询
ai-chat -p "解释这段代码"
# 管道输入
cat error.log | ai-chat -p "分析这个错误"
# JSON 输出
ai-chat -p "1+1" --json
# 继续上次对话
ai-chat -c -p "继续"
# 使用 readline 风格的经典界面
ai-chat --classic
在 .ai-chat/commands/ 创建 .md 文件定义自定义命令:
---
name: review
description: 代码审查
---
请审查以下代码,关注:
1. 代码质量
2. 潜在 bug
3. 性能问题
$ARGS
支持位置:
~/.ai-chat/commands/ - 全局命令.ai-chat/commands/ - 项目命令(优先)命令菜单中自定义命令显示 ✦ 标记。
创建 .aiignore 文件定义文件选择器排除规则:
# .aiignore
*.log
tmp/
secret/
支持位置:
.aiignore - 项目根目录.ai-chat/ignore - 项目配置目录~/.ai-chat/ignore - 全局配置类似 Claude Code 的 CLAUDE.md,支持项目级指令:
项目/
├── AI-CHAT.md # 项目指令(优先)
├── .ai-chat/
│ └── instructions.md # 备选位置
全局指令:~/.ai-chat/instructions.md
ai-chat chat list # 列出会话
ai-chat chat save <tag> # 保存会话
ai-chat chat resume <tag> # 恢复会话
ai-chat chat show <id> # 显示详情
ai-chat chat delete <id> # 删除会话
TUI 中使用 -c 继续上次对话:
ai-chat -c
| 特性 | Claude Code | Aider | Gemini CLI | ai-chat |
|---|---|---|---|---|
| TUI 界面 | ✅ | ✅ | ✅ | ✅ |
| @ 文件引用 | ✅ | ✅ | ✅ | ✅ |
| / 命令菜单 | ✅ | ✅ | ✅ | ✅ |
| ! Shell | ✅ | ✅ | ✅ | ✅ |
| 多行输入 | ✅ | ✅ | ✅ | ✅ |
| /add /drop | ✅ | ✅ | ✅ | ✅ |
| /web URL | ✅ | ✅ | ✅ | ✅ |
| Git 集成 | ✅ | ✅ | ✅ | ✅ |
| Token 统计 | ✅ | ✅ | ✅ | ✅ |
| 上下文压缩 | ✅ | ✅ | ✅ | ✅ |
| 自定义命令 | ✅ | ✅ | ✅ | ✅ |
| .ignore | ✅ | ✅ | ✅ | ✅ |
| 会话管理 | ✅ | ✅ | ✅ | ✅ |
Usage: ai-chat [options] [message]
Options:
-V, --version 版本号
-p, --print 非交互式打印模式
-c, --continue 继续上次对话
-r, --resume <id> 恢复指定会话
-m, --model <model> 指定模型
--mode <mode> 对话模式 (ask/agent)
--tui 使用 TUI 界面(默认)
--classic 使用经典 readline 界面
--search 启用 Web 搜索
--think 启用深度思考
--json JSON 格式输出
--no-instructions 禁用项目指令
-h, --help 帮助信息
Commands:
chat 会话管理
config 配置管理
models 列出可用模型
MIT
FAQs
AI Chat 命令行工具 - 终端中与 AI 对话
We found that @huyooo/ai-chat-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.