pointcode 0.1.0

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 ADDED
@@ -0,0 +1,343 @@
1
+ <div align="center">
2
+
3
+ # 🚀 PointCode
4
+
5
+ **下一代 AI 编程助手 CLI 工具**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/pointcode.svg?style=flat-square)](https://www.npmjs.com/package/pointcode)
8
+ [![npm downloads](https://img.shields.io/npm/dm/pointcode.svg?style=flat-square)](https://www.npmjs.com/package/pointcode)
9
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org/)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
11
+ [![Bun](https://img.shields.io/badge/bun-1.3.11-fbf8ec.svg?style=flat-square&logo=bun)](https://bun.sh/)
12
+
13
+ ⚡ 一行命令安装 · 🎨 完全可定制 · 🤖 多模型支持
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 📦 一键安装
20
+
21
+ > **前提条件**: 需要安装 Node.js v20.0.0 或更高版本
22
+
23
+ ### 🌐 全球用户(推荐)
24
+
25
+ ```bash
26
+ npm install -g pointcode
27
+ ```
28
+
29
+ ### 🐧 Linux / macOS
30
+
31
+ ```bash
32
+ curl -fsSL https://raw.githubusercontent.com/hhxpoint/pointcode/main/scripts/install.sh | bash
33
+ ```
34
+
35
+ ### 🪟 Windows PowerShell
36
+
37
+ ```powershell
38
+ iwr https://raw.githubusercontent.com/hhxpoint/pointcode/main/scripts/install.ps1 -useb | iex
39
+ ```
40
+
41
+ ### 🎯 免安装体验
42
+
43
+ ```bash
44
+ npx pointcode
45
+ ```
46
+
47
+ ---
48
+
49
+ ## 🎯 快速开始
50
+
51
+ 安装完成后,直接运行:
52
+
53
+ ```bash
54
+ pointcode
55
+ ```
56
+
57
+ ### 首次使用配置
58
+
59
+ ```bash
60
+ # 配置 API 密钥
61
+ /model key sk-your-api-key
62
+
63
+ # 选择模型
64
+ /model
65
+ ```
66
+
67
+ ---
68
+
69
+ ## 🌟 特性亮点
70
+
71
+ <div align="center">
72
+
73
+ | 🎨 自定义 UI | 🤖 多模型支持 | ⚡ 高性能 |
74
+ |:---:|:---:|:---:|
75
+ | 完全可定制的主题和界面 | 支持 DeepSeek、通义千问、智谱 GLM 等 | 基于 Bun 构建,启动速度快 |
76
+
77
+ | 🔒 安全可靠 | 📦 开箱即用 | 🌍 全球部署 |
78
+ |:---:|:---:|:---:|
79
+ | 权限控制,安全沙箱 | 一行命令安装,零配置启动 | npm 全球 CDN 分发 |
80
+
81
+ </div>
82
+
83
+ ---
84
+
85
+ ## 📊 系统要求
86
+
87
+ | 组件 | 最低版本 | 推荐版本 |
88
+ |------|---------|---------|
89
+ | **Node.js** | v20.0.0 | v22.x LTS |
90
+ | **npm** | v10.0.0 | v10.8.2+ |
91
+ | **Bun** (开发) | v1.0.0 | v1.3.11+ |
92
+ | **操作系统** | Windows 10 / macOS 10.15+ / Linux | 任意现代系统 |
93
+
94
+ ### 检查环境
95
+
96
+ ```bash
97
+ # 检查 Node.js 版本
98
+ node -v # 应 >= v20.0.0
99
+
100
+ # 检查 npm 版本
101
+ npm -v
102
+
103
+ # 检查 Bun (可选,仅开发需要)
104
+ bun -v
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 🤖 支持的 AI 模型
110
+
111
+ ### 国产大模型
112
+
113
+ | 服务商 | 模型 | 描述 | 状态 |
114
+ |--------|------|------|------|
115
+ | **DeepSeek** | `deepseek-chat` | 通用对话 | ✅ |
116
+ | **DeepSeek** | `deepseek-reasoner` | 推理增强 | ✅ |
117
+ | **通义千问** | `qwen3.5-plus` | 高性能 | ✅ |
118
+ | **通义千问** | `qwen3.5-flash` | 快速响应 | ✅ |
119
+ | **智谱 GLM** | `glm-5` | 通用模型 | ✅ |
120
+ | **智谱 GLM** | `glm-5-turbo` | 快速版本 | ✅ |
121
+ | **小米 MiMo** | `mimo-v2-pro` | 专业版 | ✅ |
122
+ | **小米 MiMo** | `mimo-v2-flash` | 快速版 | ✅ |
123
+
124
+ ### 本地模型 (Ollama)
125
+
126
+ ```bash
127
+ # 使用 Ollama 本地模型
128
+ CLAUDE_CODE_USE_OPENAI=1 OPENAI_BASE_URL=http://localhost:11434/v1 OPENAI_MODEL=qwen2.5:7b pointcode
129
+ ```
130
+
131
+ 支持模型:
132
+ - `qwen2.5:7b` - 代码能力强
133
+ - `llama3.2:3b` - 轻量快速
134
+ - `codellama:7b` - 专用代码模型
135
+
136
+ ---
137
+
138
+ ## 🎨 主题定制
139
+
140
+ ### 快速切换主题
141
+
142
+ ```bash
143
+ # 生成主题配置
144
+ bun run theme:generate
145
+
146
+ # 查看主题文件位置
147
+ bun run theme:open
148
+ ```
149
+
150
+ ### 示例主题
151
+
152
+ **🌃 赛博朋克**
153
+ ```json
154
+ {
155
+ "extends": "dark",
156
+ "colors": {
157
+ "claude": "rgb(255, 0, 128)",
158
+ "text": "rgb(0, 255, 255)",
159
+ "success": "rgb(0, 255, 128)",
160
+ "error": "rgb(255, 0, 64)"
161
+ }
162
+ }
163
+ ```
164
+
165
+ **🌲 森林**
166
+ ```json
167
+ {
168
+ "extends": "dark",
169
+ "colors": {
170
+ "claude": "rgb(139, 195, 74)",
171
+ "text": "rgb(200, 230, 200)"
172
+ }
173
+ }
174
+ ```
175
+
176
+ **🌊 海洋**
177
+ ```json
178
+ {
179
+ "extends": "dark",
180
+ "colors": {
181
+ "claude": "rgb(33, 150, 243)",
182
+ "text": "rgb(227, 242, 253)"
183
+ }
184
+ }
185
+ ```
186
+
187
+ ---
188
+
189
+ ## 🛠️ 开发指南
190
+
191
+ ### 克隆项目
192
+
193
+ ```bash
194
+ git clone https://github.com/hhxpoint/pointcode.git
195
+ cd pointcode
196
+ ```
197
+
198
+ ### 安装依赖
199
+
200
+ ```bash
201
+ bun install
202
+ ```
203
+
204
+ ### 构建项目
205
+
206
+ ```bash
207
+ bun run build
208
+ ```
209
+
210
+ ### 开发模式
211
+
212
+ ```bash
213
+ # 标准开发
214
+ bun run dev
215
+
216
+ # 快速模式 (Ollama + 轻量模型)
217
+ bun run dev:fast
218
+
219
+ # 使用特定模型
220
+ bun run dev:deepseek # DeepSeek
221
+ bun run dev:dashscope # 通义千问
222
+ bun run dev:zhipu # 智谱 GLM
223
+ bun run dev:ollama # Ollama 本地
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 📁 项目结构
229
+
230
+ ```
231
+ pointcode/
232
+ ├── 📦 bin/ # CLI 入口
233
+ │ └── pointcode
234
+ ├── 📦 dist/ # 构建输出
235
+ │ └── cli.mjs
236
+ ├── 📁 config/ # 配置文件
237
+ │ ├── custom-theme.json # 主题配置
238
+ │ └── ui-customization.json # UI 配置
239
+ ├── 📁 scripts/ # 构建/安装脚本
240
+ │ ├── build.ts
241
+ │ ├── install.sh # Linux/Mac 安装脚本
242
+ │ └── install.ps1 # Windows 安装脚本
243
+ ├── 📁 src/ # 源代码
244
+ │ ├── components/ # UI 组件
245
+ │ ├── screens/ # 页面组件
246
+ │ ├── ink/ # Ink 渲染器
247
+ │ └── utils/ # 工具函数
248
+ ├── 📄 package.json
249
+ ├── 📄 README.md
250
+ └── 📄 DEPLOYMENT.md # 部署文档
251
+ ```
252
+
253
+ ---
254
+
255
+ ## 🔧 环境变量
256
+
257
+ | 变量 | 说明 | 示例 |
258
+ |------|------|------|
259
+ | `CLAUDE_CODE_USE_OPENAI` | 启用 OpenAI 兼容模式 | `1` |
260
+ | `OPENAI_BASE_URL` | API 基础 URL | `https://api.deepseek.com` |
261
+ | `OPENAI_MODEL` | 模型名称 | `deepseek-chat` |
262
+ | `OPENAI_API_KEY` | API 密钥 | `sk-xxx` |
263
+
264
+ ---
265
+
266
+ ## 📝 常用命令
267
+
268
+ | 命令 | 说明 |
269
+ |------|------|
270
+ | `npm install -g pointcode` | 全局安装 |
271
+ | `pointcode` | 启动 PointCode |
272
+ | `npx pointcode` | 免安装运行 |
273
+ | `bun run build` | 构建项目 |
274
+ | `bun run dev` | 开发模式 |
275
+ | `bun run theme:generate` | 生成主题配置 |
276
+ | `bun run ui:generate` | 生成 UI 配置 |
277
+
278
+ ---
279
+
280
+ ## ❓ 常见问题
281
+
282
+ ### 安装失败
283
+
284
+ **问题**: `npm install -g pointcode` 失败
285
+
286
+ **解决**:
287
+ ```bash
288
+ # Linux/Mac 可能需要 sudo
289
+ sudo npm install -g pointcode
290
+
291
+ # 或者修改 npm 全局目录权限
292
+ sudo chown -R $(whoami) $(npm config get prefix)
293
+ ```
294
+
295
+ ### 命令不存在
296
+
297
+ **问题**: 安装后 `pointcode` 命令找不到
298
+
299
+ **解决**:
300
+ ```bash
301
+ # 检查 npm 全局目录是否在 PATH 中
302
+ echo $(npm config get prefix)/bin
303
+
304
+ # Linux/Mac 添加到 PATH
305
+ echo 'export PATH=$(npm config get prefix)/bin:$PATH' >> ~/.bashrc
306
+ source ~/.bashrc
307
+ ```
308
+
309
+ ### 模型配置
310
+
311
+ **问题**: 如何切换模型
312
+
313
+ **解决**:
314
+ ```bash
315
+ # 在 PointCode 内部
316
+ /model key sk-your-key
317
+ /model
318
+ ```
319
+
320
+ ---
321
+
322
+ ## 🔗 相关链接
323
+
324
+ - [GitHub 仓库](https://github.com/hhxpoint/pointcode)
325
+ - [npm 包页面](https://www.npmjs.com/package/pointcode)
326
+ - [作者主页](https://github.com/hhxpoint)
327
+ - [部署文档](DEPLOYMENT.md)
328
+
329
+ ---
330
+
331
+ ## 📄 许可证
332
+
333
+ MIT License © 2026 [hhxpoint](https://github.com/hhxpoint)
334
+
335
+ ---
336
+
337
+ <div align="center">
338
+
339
+ **👏 感谢使用 PointCode!**
340
+
341
+ [开始使用](#-快速开始) · [报告问题](https://github.com/hhxpoint/pointcode/issues) · [提出建议](https://github.com/hhxpoint/pointcode/discussions)
342
+
343
+ </div>
@@ -0,0 +1,7 @@
1
+ import { join } from 'path'
2
+ import { pathToFileURL } from 'url'
3
+
4
+ export function getDistImportSpecifier(baseDir) {
5
+ const distPath = join(baseDir, '..', 'dist', 'cli.mjs')
6
+ return pathToFileURL(distPath).href
7
+ }
@@ -0,0 +1,13 @@
1
+ import assert from 'node:assert/strict'
2
+ import test from 'node:test'
3
+
4
+ import { getDistImportSpecifier } from './import-specifier.mjs'
5
+
6
+ test('builds a file URL import specifier for dist/cli.mjs', () => {
7
+ const specifier = getDistImportSpecifier('C:\\repo\\bin')
8
+
9
+ assert.equal(
10
+ specifier,
11
+ 'file:///C:/repo/dist/cli.mjs',
12
+ )
13
+ })
package/bin/openclaude ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * OpenClaude — Claude Code with any LLM
5
+ *
6
+ * If dist/cli.mjs exists (built), run that.
7
+ * Otherwise, tell the user to build first or use `bun run dev`.
8
+ */
9
+
10
+ import { existsSync } from 'fs'
11
+ import { join, dirname } from 'path'
12
+ import { fileURLToPath, pathToFileURL } from 'url'
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url))
15
+ const distPath = join(__dirname, '..', 'dist', 'cli.mjs')
16
+
17
+ if (existsSync(distPath)) {
18
+ await import(pathToFileURL(distPath).href)
19
+ } else {
20
+ console.error(`
21
+ openclaude: dist/cli.mjs not found.
22
+
23
+ Build first:
24
+ bun run build
25
+
26
+ Or run directly with Bun:
27
+ bun run dev
28
+
29
+ See README.md for setup instructions.
30
+ `)
31
+ process.exit(1)
32
+ }
package/bin/pointcode ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * PointCode — 可自定义UI的AI编程助手
5
+ *
6
+ * If dist/cli.mjs exists (built), run that.
7
+ * Otherwise, tell the user to build first or use `bun run dev`.
8
+ */
9
+
10
+ import { existsSync } from 'fs'
11
+ import { join, dirname } from 'path'
12
+ import { fileURLToPath, pathToFileURL } from 'url'
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url))
15
+ const distPath = join(__dirname, '..', 'dist', 'cli.mjs')
16
+
17
+ if (existsSync(distPath)) {
18
+ await import(pathToFileURL(distPath).href)
19
+ } else {
20
+ console.error(`
21
+ pointcode: dist/cli.mjs not found.
22
+
23
+ Build first:
24
+ bun run build
25
+
26
+ Or run directly with Bun:
27
+ bun run dev
28
+
29
+ See README.md for setup instructions.
30
+ `)
31
+ process.exit(1)
32
+ }