jialing-code
v1.3.18
Published
嘉陵江-code — 终端 AI 编程助手,支持 22+ 大模型厂商,默认本地 Ollama 零配置启动
Maintainers
Readme
嘉陵江-code
嘉陵江-code — 终端 AI 编程助手 CLI 工具。
快速开始
环境要求
一定要最新版本的 bun 啊, 不然一堆奇奇怪怪的 BUG!!! bun upgrade!!!
- Bun >= 1.3.11
- 配置 API Key(支持 Anthropic / AWS Bedrock / Google Vertex / Azure)
安装
bun install运行
# 开发模式, 看到版本号 888 说明就是对了
bun run dev
# 构建
bun run build
# 构建产物运行(bun 或 node 均可)
bun dist/cli.js
node dist/cli.js构建采用 code splitting 多文件打包(build.ts),产物输出到 dist/ 目录(入口 dist/cli.js + 约 450 个 chunk 文件)。
构建出的版本 bun 和 node 都可以启动, 你 publish 到私有源可以直接启动。
能力清单
✅ = 已实现 ⚠️ = 部分实现 / 条件启用 ❌ = stub / 移除 / feature flag 关闭
核心系统
| 能力 | 状态 | 说明 |
|------|------|------|
| REPL 交互界面(Ink 终端渲染) | ✅ | 主屏幕 5000+ 行,完整交互 |
| API 通信 — Anthropic Direct | ✅ | 支持 API Key + OAuth |
| API 通信 — AWS Bedrock | ✅ | 支持凭据刷新、Bearer Token |
| API 通信 — Google Vertex | ✅ | 支持 GCP 凭据刷新 |
| API 通信 — Azure Foundry | ✅ | 支持 API Key + Azure AD |
| 流式对话与工具调用循环 | ✅ | 1700+ 行,含自动压缩、token 追踪 |
| 会话引擎 | ✅ | 1300+ 行,管理对话状态与归因 |
| 权限系统(plan/auto/manual 模式) | ✅ | 6300+ 行,含路径验证、规则匹配 |
| Hook 系统(pre/post tool use) | ✅ | 支持 settings.json 配置 |
| 会话恢复 (/resume) | ✅ | 独立 ResumeConversation 屏幕 |
| Doctor 诊断 (/doctor) | ✅ | 版本、API、插件、沙箱检查 |
| 自动压缩 (compaction) | ✅ | auto-compact / micro-compact / API compact |
工具 — 始终可用
| 工具 | 状态 | 说明 | |------|------|------| | BashTool | ✅ | Shell 执行,沙箱,权限检查 | | FileReadTool | ✅ | 文件 / PDF / 图片 / Notebook 读取 | | FileEditTool | ✅ | 字符串替换式编辑 + diff 追踪 | | FileWriteTool | ✅ | 文件创建 / 覆写 + diff 生成 | | NotebookEditTool | ✅ | Jupyter Notebook 单元格编辑 | | AgentTool | ✅ | 子代理派生(fork / async / background / remote) | | WebFetchTool | ✅ | URL 抓取 → Markdown → AI 摘要 | | WebSearchTool | ✅ | 网页搜索 + 域名过滤 | | GlobTool | ✅ | 文件搜索 | | GrepTool | ✅ | 内容搜索 |
斜杠命令
/help /clear /compact /config /diff /doctor /exit /export /fast /feedback /help /hooks /ide /init /login /logout /mcp /memory /model /plan /permissions /resume /review /theme /vim 等 40+ 命令
项目结构
嘉陵江-code/
├── src/
│ ├── entrypoints/
│ │ ├── cli.tsx # 入口文件
│ │ └── sdk/ # SDK 子模块
│ ├── main.tsx # 主 CLI 逻辑(Commander 定义)
│ └── types/ # 类型声明
├── packages/ # Monorepo workspace 包
├── scripts/ # 自动化脚本
├── build.ts # 构建脚本
├── dist/ # 构建输出
└── package.json # Bun workspaces monorepo 配置许可证
本项目仅供学习研究用途。
