blade-code 0.1.0 → 0.1.1
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.en.md +46 -91
- package/README.md +47 -86
- package/dist/blade.js +597 -570
- package/docs/README.md +81 -0
- package/package.json +46 -56
- package/CHANGELOG.md +0 -574
- package/vendor/ripgrep/darwin-arm64/rg +0 -0
- package/vendor/ripgrep/darwin-x64/rg +0 -0
- package/vendor/ripgrep/linux-arm64/rg +0 -0
- package/vendor/ripgrep/linux-x64/rg +0 -0
- package/vendor/ripgrep/win32-x64/rg.exe +0 -0
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# 🗡️ Blade Code
|
|
4
4
|
|
|
5
|
-
**Next-Generation AI
|
|
5
|
+
**Next-Generation AI Coding Assistant (CLI)**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/blade-code)
|
|
8
8
|
[](LICENSE)
|
|
@@ -17,131 +17,79 @@ English | [简体中文](README.md)
|
|
|
17
17
|
|
|
18
18
|
## ✨ Key Features
|
|
19
19
|
|
|
20
|
-
- 🤖 **
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- 🔒 **Secure
|
|
20
|
+
- 🤖 **Smart Chat** - Context-aware, multi-turn collaboration with session continuity
|
|
21
|
+
- 🆓 **Out of the Box** - Built-in free GLM-4.7 model, plus custom models
|
|
22
|
+
- 🛠️ **Rich Tooling** - 20+ built-in tools: file/search/shell/git/web and more
|
|
23
|
+
- 🔗 **Extensible** - MCP, plugins, and Skills system
|
|
24
|
+
- 📋 **Structured Workflows** - Spec / Plan / Subagents
|
|
25
|
+
- 🔒 **Secure Control** - Permission modes: default/autoEdit/plan/yolo + allow/deny lists
|
|
26
|
+
- 🎨 **Modern UI** - React + Ink TUI with Markdown and syntax highlighting
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
|
29
30
|
## 🚀 Quick Start
|
|
30
31
|
|
|
31
|
-
### Try Without Installation
|
|
32
|
-
|
|
33
32
|
```bash
|
|
34
33
|
npx blade-code
|
|
35
|
-
npx blade-code --print "Explain what TypeScript is"
|
|
36
|
-
```
|
|
37
34
|
|
|
38
|
-
### Global Installation
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
35
|
npm install -g blade-code
|
|
42
36
|
# or
|
|
43
37
|
pnpm add -g blade-code
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Basic Usage
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
blade
|
|
50
|
-
blade "
|
|
51
|
-
blade --print "Write a quicksort" # Print mode (for piping)
|
|
52
|
-
blade --continue # Continue last conversation
|
|
39
|
+
blade
|
|
40
|
+
blade "Help me analyze this project"
|
|
41
|
+
blade --print "Write a quicksort"
|
|
53
42
|
```
|
|
54
43
|
|
|
55
|
-
>
|
|
44
|
+
> Uses the built-in free model by default; run `blade` to configure your own provider.
|
|
56
45
|
|
|
57
46
|
---
|
|
58
47
|
|
|
59
|
-
##
|
|
48
|
+
## ⚙️ Optional Configuration
|
|
60
49
|
|
|
61
|
-
|
|
50
|
+
Config supports global and project scope: `~/.blade/config.json` or `.blade/config.json`.
|
|
51
|
+
See docs for the full schema.
|
|
62
52
|
|
|
63
|
-
```
|
|
64
|
-
mkdir -p ~/.blade
|
|
65
|
-
cat > ~/.blade/config.json << 'EOF'
|
|
53
|
+
```json
|
|
66
54
|
{
|
|
67
55
|
"provider": "openai-compatible",
|
|
68
|
-
"apiKey": "
|
|
56
|
+
"apiKey": "${BLADE_API_KEY}",
|
|
69
57
|
"baseUrl": "https://api.openai.com/v1",
|
|
70
|
-
"model": "gpt-
|
|
58
|
+
"model": "gpt-4o-mini"
|
|
71
59
|
}
|
|
72
|
-
EOF
|
|
73
60
|
```
|
|
74
61
|
|
|
75
|
-
Supports environment variable interpolation: `"apiKey": "${BLADE_API_KEY}"`
|
|
76
|
-
|
|
77
|
-
### Get API Keys
|
|
78
|
-
|
|
79
|
-
- **Qwen**: [DashScope Console](https://dashscope.console.aliyun.com/apiKey)
|
|
80
|
-
- **VolcEngine**: [Volcano Ark Console](https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey)
|
|
81
|
-
- **OpenAI**: [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
82
|
-
|
|
83
62
|
---
|
|
84
63
|
|
|
85
|
-
##
|
|
64
|
+
## 🧰 CLI At a Glance
|
|
86
65
|
|
|
87
|
-
|
|
88
|
-
# Smart tool invocation
|
|
89
|
-
blade "List all TypeScript files"
|
|
90
|
-
blade "Find code containing TODO"
|
|
91
|
-
blade "Review code in src/utils"
|
|
92
|
-
|
|
93
|
-
# Session management
|
|
94
|
-
blade --session-id "my-project" "Start new project"
|
|
95
|
-
blade --resume <id> # Resume session
|
|
96
|
-
blade --resume <id> --fork-session # Fork session
|
|
97
|
-
|
|
98
|
-
# Security control
|
|
99
|
-
blade --allowed-tools "Read,Grep" "Read-only operations"
|
|
100
|
-
blade --permission-mode plan "Plan only, no execution"
|
|
101
|
-
blade --yolo "Auto-approve all operations"
|
|
102
|
-
```
|
|
66
|
+
**Common Commands**
|
|
103
67
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
| Command | Description |
|
|
111
|
-
|---------|-------------|
|
|
112
|
-
| `blade` | Start interactive assistant |
|
|
113
|
-
| `blade config` | Configuration management |
|
|
114
|
-
| `blade mcp` | MCP server management |
|
|
115
|
-
| `blade doctor` | System health check |
|
|
116
|
-
| `blade update` | Check for updates |
|
|
117
|
-
|
|
118
|
-
### Common Options
|
|
119
|
-
|
|
120
|
-
| Option | Short | Description |
|
|
121
|
-
|--------|-------|-------------|
|
|
122
|
-
| `--print` | `-p` | Print response and exit |
|
|
123
|
-
| `--continue` | `-c` | Continue recent session |
|
|
124
|
-
| `--resume <id>` | `-r` | Resume specific session |
|
|
125
|
-
| `--yolo` | | Auto-approve all operations |
|
|
68
|
+
- `blade` start interactive UI
|
|
69
|
+
- `blade mcp` manage MCP servers
|
|
70
|
+
- `blade doctor` environment check
|
|
71
|
+
- `blade update` check for updates
|
|
72
|
+
- `blade install` install a specific version (experimental)
|
|
126
73
|
|
|
127
|
-
|
|
74
|
+
**Common Options**
|
|
128
75
|
|
|
129
|
-
|
|
76
|
+
- `--print/-p` print mode (pipe-friendly)
|
|
77
|
+
- `--output-format` output: text/json/stream-json
|
|
78
|
+
- `--permission-mode` permission mode
|
|
79
|
+
- `--resume/-r` resume session / `--session-id` set session
|
|
130
80
|
|
|
131
81
|
---
|
|
132
82
|
|
|
133
83
|
## 📖 Documentation
|
|
134
84
|
|
|
135
|
-
- **[User Docs](https://echovic.github.io/blade-doc/#/)**
|
|
136
|
-
- **[
|
|
137
|
-
- **[Contributing Guide](CONTRIBUTING.md)**
|
|
85
|
+
- **[User Docs](https://echovic.github.io/blade-doc/#/)**
|
|
86
|
+
- **[Docs entry in repo](docs/README.md)**
|
|
87
|
+
- **[Contributing Guide](CONTRIBUTING.md)**
|
|
138
88
|
|
|
139
89
|
---
|
|
140
90
|
|
|
141
91
|
## 🤝 Contributing
|
|
142
92
|
|
|
143
|
-
Contributions welcome! See [Contributing Guide](CONTRIBUTING.md).
|
|
144
|
-
|
|
145
93
|
```bash
|
|
146
94
|
git clone https://github.com/echoVic/blade-code.git
|
|
147
95
|
cd blade-code && pnpm install && pnpm dev
|
|
@@ -151,20 +99,27 @@ cd blade-code && pnpm install && pnpm dev
|
|
|
151
99
|
|
|
152
100
|
## 💬 Community
|
|
153
101
|
|
|
154
|
-
Add WeChat **VIc-Forever
|
|
102
|
+
Add WeChat **VIc-Forever**, remark "Blade" to join the group.
|
|
155
103
|
|
|
156
104
|
---
|
|
157
105
|
|
|
158
|
-
##
|
|
106
|
+
## 🔗 Related Resources
|
|
159
107
|
|
|
160
|
-
|
|
108
|
+
- [NPM Package](https://www.npmjs.com/package/blade-code)
|
|
109
|
+
- [Discord Community](https://discord.gg/utXDVcv6) - Join our Discord server
|
|
110
|
+
- [Report Issues](https://github.com/echoVic/blade-code/issues)
|
|
161
111
|
|
|
162
112
|
---
|
|
163
113
|
|
|
164
|
-
##
|
|
114
|
+
## ⭐ Star History
|
|
165
115
|
|
|
166
|
-
|
|
167
|
-
|
|
116
|
+
<a href="https://star-history.com/#echoVic/blade-code&Date">
|
|
117
|
+
<picture>
|
|
118
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=echoVic/blade-code&type=Date&theme=dark" />
|
|
119
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=echoVic/blade-code&type=Date" />
|
|
120
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=echoVic/blade-code&type=Date" />
|
|
121
|
+
</picture>
|
|
122
|
+
</a>
|
|
168
123
|
|
|
169
124
|
---
|
|
170
125
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# 🗡️ Blade Code
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**新一代 AI 编程助手(CLI)**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/blade-code)
|
|
8
8
|
[](LICENSE)
|
|
@@ -17,131 +17,79 @@
|
|
|
17
17
|
|
|
18
18
|
## ✨ 核心特性
|
|
19
19
|
|
|
20
|
-
- 🤖 **智能对话** -
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- 🔒 **安全可控** -
|
|
20
|
+
- 🤖 **智能对话** - 上下文理解、多轮协作、可继续会话
|
|
21
|
+
- 🆓 **开箱即用** - 内置免费 GLM-4.7 模型,可选自定义模型
|
|
22
|
+
- 🛠️ **丰富工具** - 20+ 内置工具:文件/搜索/Shell/Git/Web 等
|
|
23
|
+
- 🔗 **扩展能力** - MCP、插件与 Skills 系统
|
|
24
|
+
- 📋 **结构化工作流** - Spec / Plan / Subagents
|
|
25
|
+
- 🔒 **安全可控** - default/autoEdit/plan/yolo 权限模式与工具白/黑名单
|
|
26
|
+
- 🎨 **现代 UI** - React + Ink 终端 UI,支持 Markdown 与高亮
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
|
29
30
|
## 🚀 快速开始
|
|
30
31
|
|
|
31
|
-
### 零安装试用
|
|
32
|
-
|
|
33
32
|
```bash
|
|
34
33
|
npx blade-code
|
|
35
|
-
npx blade-code --print "解释什么是 TypeScript"
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### 全局安装
|
|
39
34
|
|
|
40
|
-
```bash
|
|
41
35
|
npm install -g blade-code
|
|
42
36
|
# 或
|
|
43
37
|
pnpm add -g blade-code
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 基本使用
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
blade
|
|
50
|
-
blade "
|
|
51
|
-
blade --print "写一个快排算法" # 打印模式(适合管道)
|
|
52
|
-
blade --continue # 继续上次对话
|
|
39
|
+
blade
|
|
40
|
+
blade "帮我分析这个项目"
|
|
41
|
+
blade --print "写一个快排算法"
|
|
53
42
|
```
|
|
54
43
|
|
|
55
|
-
>
|
|
44
|
+
> 默认使用内置免费模型;要使用自有模型,可运行 `blade` 按提示配置。
|
|
56
45
|
|
|
57
46
|
---
|
|
58
47
|
|
|
59
|
-
##
|
|
48
|
+
## ⚙️ 可选配置
|
|
60
49
|
|
|
61
|
-
|
|
50
|
+
配置文件支持全局和项目级:`~/.blade/config.json` 或 `.blade/config.json`。
|
|
51
|
+
更多配置项见文档。
|
|
62
52
|
|
|
63
|
-
```
|
|
64
|
-
mkdir -p ~/.blade
|
|
65
|
-
cat > ~/.blade/config.json << 'EOF'
|
|
53
|
+
```json
|
|
66
54
|
{
|
|
67
55
|
"provider": "openai-compatible",
|
|
68
|
-
"apiKey": "
|
|
69
|
-
"baseUrl": "https://
|
|
70
|
-
"model": "
|
|
56
|
+
"apiKey": "${BLADE_API_KEY}",
|
|
57
|
+
"baseUrl": "https://api.openai.com/v1",
|
|
58
|
+
"model": "gpt-4o-mini"
|
|
71
59
|
}
|
|
72
|
-
EOF
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
支持环境变量插值:`"apiKey": "${BLADE_API_KEY}"`
|
|
76
|
-
|
|
77
|
-
### 获取 API 密钥
|
|
78
|
-
|
|
79
|
-
- **千问**: [DashScope 控制台](https://dashscope.console.aliyun.com/apiKey)
|
|
80
|
-
- **火山引擎**: [火山方舟控制台](https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey)
|
|
81
|
-
- **OpenAI**: [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 💬 使用示例
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
# 智能工具调用
|
|
89
|
-
blade "列出所有 TypeScript 文件"
|
|
90
|
-
blade "查找包含 TODO 的代码"
|
|
91
|
-
blade "审查 src/utils 目录的代码"
|
|
92
|
-
|
|
93
|
-
# 会话管理
|
|
94
|
-
blade --session-id "my-project" "开始新项目"
|
|
95
|
-
blade --resume <id> # 恢复会话
|
|
96
|
-
blade --resume <id> --fork-session # Fork 会话
|
|
97
|
-
|
|
98
|
-
# 安全控制
|
|
99
|
-
blade --allowed-tools "Read,Grep" "只读操作"
|
|
100
|
-
blade --permission-mode plan "只规划不执行"
|
|
101
|
-
blade --yolo "自动批准所有操作"
|
|
102
60
|
```
|
|
103
61
|
|
|
104
62
|
---
|
|
105
63
|
|
|
106
|
-
##
|
|
107
|
-
|
|
108
|
-
### 主要命令
|
|
64
|
+
## 🧰 命令速览
|
|
109
65
|
|
|
110
|
-
|
|
111
|
-
|------|------|
|
|
112
|
-
| `blade` | 启动交互式助手 |
|
|
113
|
-
| `blade config` | 配置管理 |
|
|
114
|
-
| `blade mcp` | MCP 服务器管理 |
|
|
115
|
-
| `blade doctor` | 系统健康检查 |
|
|
116
|
-
| `blade update` | 检查更新 |
|
|
66
|
+
**常用命令**
|
|
117
67
|
|
|
118
|
-
|
|
68
|
+
- `blade` 启动交互式界面
|
|
69
|
+
- `blade mcp` 管理 MCP 服务器
|
|
70
|
+
- `blade doctor` 环境自检
|
|
71
|
+
- `blade update` 检查更新
|
|
72
|
+
- `blade install` 安装指定版本(实验)
|
|
119
73
|
|
|
120
|
-
|
|
121
|
-
|------|------|------|
|
|
122
|
-
| `--print` | `-p` | 打印响应并退出 |
|
|
123
|
-
| `--continue` | `-c` | 继续最近会话 |
|
|
124
|
-
| `--resume <id>` | `-r` | 恢复指定会话 |
|
|
125
|
-
| `--yolo` | | 自动批准所有操作 |
|
|
74
|
+
**常用选项**
|
|
126
75
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
76
|
+
- `--print/-p` 打印模式(适合管道)
|
|
77
|
+
- `--output-format` 输出格式(text/json/stream-json)
|
|
78
|
+
- `--permission-mode` 权限模式
|
|
79
|
+
- `--resume/-r` 恢复会话 / `--session-id` 指定会话
|
|
130
80
|
|
|
131
81
|
---
|
|
132
82
|
|
|
133
83
|
## 📖 文档
|
|
134
84
|
|
|
135
|
-
- **[用户文档](https://echovic.github.io/blade-doc/#/)**
|
|
136
|
-
- **[
|
|
137
|
-
- **[贡献指南](CONTRIBUTING.md)**
|
|
85
|
+
- **[用户文档](https://echovic.github.io/blade-doc/#/)**
|
|
86
|
+
- **[本仓库文档入口](docs/README.md)**
|
|
87
|
+
- **[贡献指南](CONTRIBUTING.md)**
|
|
138
88
|
|
|
139
89
|
---
|
|
140
90
|
|
|
141
91
|
## 🤝 贡献
|
|
142
92
|
|
|
143
|
-
欢迎贡献!详见 [贡献指南](CONTRIBUTING.md)。
|
|
144
|
-
|
|
145
93
|
```bash
|
|
146
94
|
git clone https://github.com/echoVic/blade-code.git
|
|
147
95
|
cd blade-code && pnpm install && pnpm dev
|
|
@@ -158,10 +106,23 @@ cd blade-code && pnpm install && pnpm dev
|
|
|
158
106
|
## 🔗 相关资源
|
|
159
107
|
|
|
160
108
|
- [NPM 包](https://www.npmjs.com/package/blade-code)
|
|
109
|
+
- [Discord 社区](https://discord.gg/utXDVcv6) - 加入我们的 Discord 服务器
|
|
161
110
|
- [问题反馈](https://github.com/echoVic/blade-code/issues)
|
|
162
111
|
|
|
163
112
|
---
|
|
164
113
|
|
|
114
|
+
## ⭐ Star History
|
|
115
|
+
|
|
116
|
+
<a href="https://star-history.com/#echoVic/blade-code&Date">
|
|
117
|
+
<picture>
|
|
118
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=echoVic/blade-code&type=Date&theme=dark" />
|
|
119
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=echoVic/blade-code&type=Date" />
|
|
120
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=echoVic/blade-code&type=Date" />
|
|
121
|
+
</picture>
|
|
122
|
+
</a>
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
165
126
|
## 📄 许可证
|
|
166
127
|
|
|
167
128
|
[MIT](LICENSE) - Made with ❤️ by [echoVic](https://github.com/echoVic)
|