@qoder-ai/qodercli 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -23
- package/package.json +18 -18
- package/scripts/install.js +12 -9
package/README.md
CHANGED
|
@@ -1,37 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Qoder CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
into your terminal. It provides lightweight access to Gemini, giving you the
|
|
5
|
-
most direct path from your prompt to our model.
|
|
3
|
+
Qoder CLI 是Qoder品牌下的 CLI AI 编程助手,将强大的 AI 编程能力直接带入你的终端。
|
|
6
4
|
|
|
7
|
-
##
|
|
5
|
+
## 🚀 Why Qoder CLI?
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
- **🧠 强大的 AI 模型** — 支持多种大语言模型,百万级 token 上下文窗口
|
|
8
|
+
- **🔧 内置工具** — 文件操作、Shell 命令执行、Web 搜索、代码搜索
|
|
9
|
+
- **🔌 可扩展** — 支持 MCP (Model Context Protocol) 协议,轻松接入自定义工具
|
|
10
|
+
- **💻 终端优先** — 为命令行开发者设计,高效交互
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
## 📦 安装
|
|
13
|
+
|
|
14
|
+
**需要 Node.js >= 20.0.0**
|
|
15
|
+
|
|
16
|
+
全局安装:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
12
19
|
npm install -g @qoder-ai/qodercli
|
|
13
20
|
```
|
|
14
21
|
|
|
15
|
-
## 📋
|
|
22
|
+
## 📋 发布渠道
|
|
23
|
+
|
|
24
|
+
### Stable(稳定版)
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install -g @qoder-ai/qodercli@latest
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Node原生兼容版(beta)
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npm install -g @qoder-ai/qodercli@beta
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🚀 快速开始
|
|
37
|
+
|
|
38
|
+
### 基本用法
|
|
39
|
+
|
|
40
|
+
在当前目录启动交互式会话:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
qodercli
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
指定模型:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
qodercli -m <model-name>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
非交互模式(适合脚本调用):
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
qodercli -p "解释这个代码仓库的架构"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 使用示例
|
|
59
|
+
|
|
60
|
+
**分析现有代码:**
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
cd your-project/
|
|
64
|
+
qodercli
|
|
65
|
+
> 给我总结一下昨天的所有代码变更
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**生成代码:**
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
qodercli
|
|
72
|
+
> 帮我写一个 Express 中间件,实现请求频率限制
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**调试问题:**
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
qodercli
|
|
79
|
+
> 这个测试为什么会失败?帮我修复它
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 📋 核心功能
|
|
83
|
+
|
|
84
|
+
### 代码理解与生成
|
|
85
|
+
|
|
86
|
+
- 查询和编辑大型代码库
|
|
87
|
+
- 支持多模态输入(图片、PDF 等)生成代码
|
|
88
|
+
- 自然语言调试
|
|
89
|
+
|
|
90
|
+
### 自动化与集成
|
|
91
|
+
|
|
92
|
+
- 自动化 Git 操作、PR 处理等任务
|
|
93
|
+
- 通过 MCP 服务器扩展能力
|
|
94
|
+
- 支持非交互模式在脚本中运行
|
|
95
|
+
|
|
96
|
+
### 高级能力
|
|
97
|
+
|
|
98
|
+
- Web 搜索获取实时信息
|
|
99
|
+
- 会话检查点(保存/恢复对话)
|
|
100
|
+
- 自定义上下文文件,定制项目行为
|
|
101
|
+
|
|
102
|
+
## 🔐 认证配置
|
|
103
|
+
|
|
104
|
+
Qoder CLI 使用自有认证体系(已移除所有 Gemini 原生认证),支持以下认证方式:
|
|
105
|
+
|
|
106
|
+
### 方式一:浏览器登录(推荐)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
qodercli
|
|
111
|
+
# 首次运行自动打开浏览器引导登录
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
或显式执行登录命令:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
qodercli login
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
后台每 30 分钟自动刷新 token(通过 `/api/v1/deviceToken/refresh`),无需手动干预
|
|
121
|
+
|
|
122
|
+
> 如果环境不支持自动打开浏览器,设置 `NO_BROWSER=1` 后 CLI 会打印 URL 供手动访问。
|
|
123
|
+
|
|
124
|
+
### 方式二:Personal Access Token (PAT)
|
|
125
|
+
|
|
126
|
+
适用于 CI/CD 流水线或无浏览器环境:
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
export QODER_PERSONAL_ACCESS_TOKEN="your-pat-token"
|
|
130
|
+
qodercli
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
PAT 可在 Qoder 账号设置页 (`https://qoder.com/account/integrations`) 创建和管理。
|
|
134
|
+
|
|
16
135
|
|
|
17
|
-
###
|
|
136
|
+
### 认证相关环境变量
|
|
18
137
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
138
|
+
| 环境变量 | 说明 |
|
|
139
|
+
|---------|------|
|
|
140
|
+
| `QODER_PERSONAL_ACCESS_TOKEN` | PAT 令牌,设置后自动使用 PAT 认证 |
|
|
141
|
+
| `QODER_CONFIG_DIR` | 自定义配置目录(默认 `~/.qoder`) |
|
|
142
|
+
| `NO_BROWSER` | 设置后禁止自动打开浏览器 |
|
|
22
143
|
|
|
23
|
-
### Automation & Integration
|
|
24
144
|
|
|
25
|
-
|
|
26
|
-
rebases
|
|
27
|
-
- Use MCP servers to connect new capabilities such as media generation, internal
|
|
28
|
-
tools, and custom automation
|
|
29
|
-
- Run non-interactively in scripts for workflow automation
|
|
145
|
+
### 会话内命令
|
|
30
146
|
|
|
31
|
-
|
|
147
|
+
| 命令 | 说明 |
|
|
148
|
+
|------|------|
|
|
149
|
+
| `/login` 或 `/signin` | 在会话中执行登录 |
|
|
150
|
+
| `/logout` 或 `/signout` | 退出登录(需确认) |
|
|
32
151
|
|
|
33
|
-
|
|
34
|
-
- Conversation checkpointing to save and resume complex sessions
|
|
35
|
-
- Custom context files (GEMINI.md) to tailor behavior for your projects
|
|
152
|
+
## 🔌 MCP 扩展
|
|
36
153
|
|
|
37
|
-
|
|
154
|
+
在配置文件中添加 MCP 服务器,扩展 CLI 的能力
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qoder-ai/qodercli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "qodercli - npm installer",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -44,55 +44,55 @@
|
|
|
44
44
|
],
|
|
45
45
|
"preferGlobal": true,
|
|
46
46
|
"binaries": {
|
|
47
|
-
"version": "0.2.
|
|
47
|
+
"version": "0.2.7",
|
|
48
48
|
"files": [
|
|
49
49
|
{
|
|
50
50
|
"os": "darwin",
|
|
51
51
|
"arch": "arm64",
|
|
52
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
53
|
-
"sha256": "
|
|
52
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-darwin-arm64.tar.gz",
|
|
53
|
+
"sha256": "e14f421be078ec251eecadf94edb9b14141d77f8443e9b38ea6ef6adb6c8e8a6"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"os": "darwin",
|
|
57
57
|
"arch": "amd64",
|
|
58
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
59
|
-
"sha256": "
|
|
58
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-darwin-x64.tar.gz",
|
|
59
|
+
"sha256": "1be56744ff6b82b5c74c189af53cc29eae0e8ece60cb378c226fc1337407286a"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"os": "linux",
|
|
63
63
|
"arch": "arm64-musl",
|
|
64
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
65
|
-
"sha256": "
|
|
64
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-linux-arm64-musl.tar.gz",
|
|
65
|
+
"sha256": "d403eb2c836f832bf05183ad938731770c97f824e7b663998830c7e946b02aa3"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"os": "linux",
|
|
69
69
|
"arch": "arm64",
|
|
70
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
71
|
-
"sha256": "
|
|
70
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-linux-arm64.tar.gz",
|
|
71
|
+
"sha256": "cc39c8d499e2c709be9472f86fd682de5e5bd33c47b78d676bd885878fc1d24a"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"os": "linux",
|
|
75
75
|
"arch": "amd64-baseline",
|
|
76
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
77
|
-
"sha256": "
|
|
76
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-linux-x64-baseline.tar.gz",
|
|
77
|
+
"sha256": "f3e177d8b762f59cb13c519afbfcc0bac2d7f9f57e3060893191aa7db7bf731b"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"os": "linux",
|
|
81
81
|
"arch": "amd64-musl",
|
|
82
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
83
|
-
"sha256": "
|
|
82
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-linux-x64-musl.tar.gz",
|
|
83
|
+
"sha256": "78c92674ae8c56ac232c01157743cb7f4e6b54a8956527969fe6f05395a7b57c"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"os": "linux",
|
|
87
87
|
"arch": "amd64",
|
|
88
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
89
|
-
"sha256": "
|
|
88
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-linux-x64.tar.gz",
|
|
89
|
+
"sha256": "c0936a2dea744c9438b28e6cf017e4b60ccd788ad1da397bb1571009b624309f"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"os": "windows",
|
|
93
93
|
"arch": "amd64",
|
|
94
|
-
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.
|
|
95
|
-
"sha256": "
|
|
94
|
+
"url": "https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/releases/0.2.7/qodercli-windows-x64.zip",
|
|
95
|
+
"sha256": "1e466bc14119840fb208460a1c5eee10ee53e576f2f02fb1b60ee76c6dabda94"
|
|
96
96
|
}
|
|
97
97
|
]
|
|
98
98
|
}
|
package/scripts/install.js
CHANGED
|
@@ -57,9 +57,10 @@ class QoderInstaller {
|
|
|
57
57
|
const arch = process.arch;
|
|
58
58
|
switch (arch) {
|
|
59
59
|
case 'x64':
|
|
60
|
-
// On Linux x64, check if CPU supports
|
|
61
|
-
//
|
|
62
|
-
|
|
60
|
+
// On Linux x64, check if CPU supports AVX2 instructions.
|
|
61
|
+
// Bun optimized binaries require AVX2/BMI2/FMA3 (-march=haswell).
|
|
62
|
+
// CPUs with only AVX1 (e.g. Ivy Bridge) will SIGILL on BMI2 instructions.
|
|
63
|
+
if (process.platform === 'linux' && !this.hasAVX2()) {
|
|
63
64
|
return 'amd64-baseline';
|
|
64
65
|
}
|
|
65
66
|
return 'amd64';
|
|
@@ -71,16 +72,18 @@ class QoderInstaller {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
|
-
* Check if the CPU supports
|
|
75
|
-
*
|
|
76
|
-
*
|
|
75
|
+
* Check if the CPU supports AVX2 instructions by reading /proc/cpuinfo.
|
|
76
|
+
* Bun optimized binaries are compiled with -march=haswell, requiring
|
|
77
|
+
* AVX2/BMI1/BMI2/FMA3. AVX1-only CPUs (e.g. Ivy Bridge) will SIGILL.
|
|
78
|
+
* Returns true if AVX2 is present or detection is unavailable.
|
|
79
|
+
* Only returns false when we can confirm AVX2 is absent.
|
|
77
80
|
*/
|
|
78
|
-
|
|
81
|
+
hasAVX2() {
|
|
79
82
|
try {
|
|
80
83
|
const cpuinfo = fs.readFileSync('/proc/cpuinfo', 'utf-8');
|
|
81
|
-
return /^flags\s*:.*\
|
|
84
|
+
return /^flags\s*:.*\bavx2\b/m.test(cpuinfo);
|
|
82
85
|
} catch (e) {
|
|
83
|
-
// If we can't read cpuinfo, assume
|
|
86
|
+
// If we can't read cpuinfo, assume AVX2 is present (safer default)
|
|
84
87
|
return true;
|
|
85
88
|
}
|
|
86
89
|
}
|