@yxai/code 0.0.1 → 0.0.2
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 +137 -25
- package/README.md +106 -35
- package/package.json +4 -4
- package/public/favicon.ico +0 -0
- package/public/index.html +6 -4
- package/server.js +41 -26
package/README.en.md
CHANGED
|
@@ -1,36 +1,148 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
|
3
|
+
<img src="./codelogo.png" alt="YXCode Logo" width="120" height="120">
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
Software architecture description
|
|
5
|
+
# @yxai/code
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>YiXin Code</strong> - Zero-barrier Visual Lightweight Tool for Claude Code
|
|
9
|
+
</p>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="./README.md">🇨🇳 简体中文</a> | <a href="./README.en.md">🇺🇸 English</a>
|
|
13
|
+
</p>
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen" alt="Node.js Version">
|
|
17
|
+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License">
|
|
18
|
+
<img src="https://img.shields.io/badge/code%20lines-%3C4000-orange" alt="Code Lines">
|
|
19
|
+
</p>
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
2. xxxx
|
|
19
|
-
3. xxxx
|
|
21
|
+
</div>
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
---
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
2. Create Feat_xxx branch
|
|
25
|
-
3. Commit your code
|
|
26
|
-
4. Create Pull Request
|
|
25
|
+
## ✨ Introduction
|
|
27
26
|
|
|
27
|
+
A visual interaction interface based on **Node.js + WebSocket + HTML/CSS/JS**, allowing you to interact with Claude AI through a web interface.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
- Consistent capabilities with Claude Code
|
|
30
|
+
- Perfect for transitioning from Trae, Cursor, conversational, and plugin-based programming to Claude Code
|
|
31
|
+
- Minimal dependencies - only requires Node.js
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 Features
|
|
36
|
+
|
|
37
|
+
<table>
|
|
38
|
+
<tr>
|
|
39
|
+
<td width="50%">
|
|
40
|
+
|
|
41
|
+
### 🎯 Minimalist Architecture
|
|
42
|
+
- Node.js + WebSocket + HTML/CSS/JS
|
|
43
|
+
- Less than 4,000 lines of code
|
|
44
|
+
- Only depends on Node.js
|
|
45
|
+
|
|
46
|
+
</td>
|
|
47
|
+
<td width="50%">
|
|
48
|
+
|
|
49
|
+
### 🎨 Visual Interface
|
|
50
|
+
- Friendly and modern Web UI
|
|
51
|
+
- Intuitive user experience
|
|
52
|
+
- Clean and elegant design
|
|
53
|
+
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td width="50%">
|
|
58
|
+
|
|
59
|
+
### ⚡ Extreme Performance
|
|
60
|
+
- WebSocket real-time communication
|
|
61
|
+
- Optimized for speed
|
|
62
|
+
- Lightweight and fast
|
|
63
|
+
|
|
64
|
+
</td>
|
|
65
|
+
<td width="50%">
|
|
66
|
+
|
|
67
|
+
### 📦 Full Tool Capabilities
|
|
68
|
+
- Consistent with Claude Code capabilities
|
|
69
|
+
- Fully based on Claude Code
|
|
70
|
+
- Complete feature set
|
|
71
|
+
|
|
72
|
+
</td>
|
|
73
|
+
</tr>
|
|
74
|
+
</table>
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 📦 Installation
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install -g @yxai/code
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🎮 Usage
|
|
87
|
+
|
|
88
|
+
After installation, simply run the command to start:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
yxai
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The program will automatically:
|
|
95
|
+
1. Start the server (default port: 6060)
|
|
96
|
+
2. Open your browser at http://localhost:6060
|
|
97
|
+
|
|
98
|
+
### Command Line Options
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Display help information
|
|
102
|
+
yxai --help
|
|
103
|
+
|
|
104
|
+
# Display version number
|
|
105
|
+
yxai --version
|
|
106
|
+
|
|
107
|
+
# Specify port number
|
|
108
|
+
yxai --port 6060
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Environment Variables
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Use environment variable to specify port
|
|
115
|
+
PORT=8080 yxai
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 💻 System Requirements
|
|
121
|
+
|
|
122
|
+
| Requirement | Version |
|
|
123
|
+
|-------------|---------|
|
|
124
|
+
| Node.js | >= 22.0.0 |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 📄 License
|
|
129
|
+
|
|
130
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 👥 About Us
|
|
135
|
+
|
|
136
|
+
This project is self-developed by **YiXin AI Team + Claude + Claude Code** using Vibecoding
|
|
137
|
+
|
|
138
|
+
- 🌐 Official Website: [https://yxai.chat](https://yxai.chat)
|
|
139
|
+
- 💬 Contact Us: You can add our contact information through the YiXin AI official website
|
|
140
|
+
- 🐛 Issue Feedback: For tool-related issues, please submit an issue, and YiXin AI Lobster will review and complete your issue within 24 hours~
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
<div align="center">
|
|
145
|
+
|
|
146
|
+
Made with ❤️ by YXAI Team
|
|
147
|
+
|
|
148
|
+
</div>
|
package/README.md
CHANGED
|
@@ -1,77 +1,148 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="./codelogo.png" alt="YXCode Logo" width="120" height="120">
|
|
4
|
+
|
|
1
5
|
# @yxai/code
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>意心 Code</strong> - 无门槛的 Claude Code 可视化轻量工具
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="./README.md">🇨🇳 简体中文</a> | <a href="./README.en.md">🇺🇸 English</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen" alt="Node.js 版本">
|
|
17
|
+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="许可证">
|
|
18
|
+
<img src="https://img.shields.io/badge/code%20lines-%3C4000-orange" alt="代码行数">
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## ✨ 简介
|
|
26
|
+
|
|
27
|
+
一个基于 **Node.js + WebSocket + HTML/CSS/JS** 的可视化交互界面,让你可以通过 Web 界面与 Claude AI 进行交互。
|
|
28
|
+
|
|
29
|
+
- 能力与 Claude Code 一致
|
|
30
|
+
- 适合从 Trae、Cursor、对话式、插件式编程方式过渡到 Claude Code
|
|
31
|
+
- 极简依赖,仅需 Node.js
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 特性
|
|
36
|
+
|
|
37
|
+
<table>
|
|
38
|
+
<tr>
|
|
39
|
+
<td width="50%">
|
|
40
|
+
|
|
41
|
+
### 🎯 极简架构
|
|
42
|
+
- Node.js + WebSocket + HTML/CSS/JS
|
|
43
|
+
- 代码行数小于 4000 行
|
|
44
|
+
- 仅依赖 Node.js
|
|
4
45
|
|
|
5
|
-
|
|
46
|
+
</td>
|
|
47
|
+
<td width="50%">
|
|
6
48
|
|
|
7
|
-
|
|
49
|
+
### 🎨 可视化界面
|
|
50
|
+
- 友好的且现代化的 Web UI
|
|
51
|
+
- 直观的用户体验
|
|
52
|
+
- 简洁优雅的设计
|
|
8
53
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- 🌐 自动打开浏览器
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td width="50%">
|
|
14
58
|
|
|
15
|
-
|
|
59
|
+
### ⚡ 极致性能
|
|
60
|
+
- 采用 WebSocket 实时通信
|
|
61
|
+
- 极致优化
|
|
62
|
+
- 轻量快速
|
|
63
|
+
|
|
64
|
+
</td>
|
|
65
|
+
<td width="50%">
|
|
66
|
+
|
|
67
|
+
### 📦 完整工具能力
|
|
68
|
+
- 能力与 Claude Code 一致
|
|
69
|
+
- 底层完全基于 Claude Code
|
|
70
|
+
- 功能完整
|
|
71
|
+
|
|
72
|
+
</td>
|
|
73
|
+
</tr>
|
|
74
|
+
</table>
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 📦 安装
|
|
16
79
|
|
|
17
80
|
```bash
|
|
18
81
|
npm install -g @yxai/code
|
|
19
82
|
```
|
|
20
83
|
|
|
21
|
-
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🎮 使用
|
|
22
87
|
|
|
23
|
-
|
|
88
|
+
安装后,直接运行命令启动:
|
|
24
89
|
|
|
25
90
|
```bash
|
|
26
|
-
|
|
91
|
+
yxai
|
|
27
92
|
```
|
|
28
93
|
|
|
29
94
|
程序会自动:
|
|
30
|
-
1. 启动服务器(默认端口
|
|
31
|
-
2. 打开浏览器访问 http://localhost:
|
|
95
|
+
1. 启动服务器(默认端口 6060)
|
|
96
|
+
2. 打开浏览器访问 http://localhost:6060
|
|
32
97
|
|
|
33
98
|
### 命令行选项
|
|
34
99
|
|
|
35
100
|
```bash
|
|
36
101
|
# 显示帮助信息
|
|
37
|
-
|
|
102
|
+
yxai --help
|
|
38
103
|
|
|
39
104
|
# 显示版本号
|
|
40
|
-
|
|
105
|
+
yxai --version
|
|
41
106
|
|
|
42
107
|
# 指定端口号
|
|
43
|
-
|
|
108
|
+
yxai --port 6060
|
|
44
109
|
```
|
|
45
110
|
|
|
46
111
|
### 环境变量
|
|
47
112
|
|
|
48
113
|
```bash
|
|
49
114
|
# 使用环境变量指定端口
|
|
50
|
-
PORT=8080
|
|
115
|
+
PORT=8080 yxai
|
|
51
116
|
```
|
|
52
117
|
|
|
53
|
-
|
|
118
|
+
---
|
|
54
119
|
|
|
55
|
-
|
|
120
|
+
## 💻 系统要求
|
|
56
121
|
|
|
57
|
-
|
|
122
|
+
| 要求 | 版本 |
|
|
123
|
+
|------|------|
|
|
124
|
+
| Node.js | >= 22.0.0 |
|
|
58
125
|
|
|
59
|
-
|
|
60
|
-
# 克隆仓库
|
|
61
|
-
git clone https://gitee.com/ccnetcore/yxcode.git
|
|
62
|
-
cd yxcode
|
|
126
|
+
---
|
|
63
127
|
|
|
64
|
-
|
|
65
|
-
npm install
|
|
128
|
+
## 📄 许可证
|
|
66
129
|
|
|
67
|
-
|
|
68
|
-
npm link
|
|
69
|
-
yxaiCode
|
|
130
|
+
本项目采用 [MIT 许可证](LICENSE) 开源。
|
|
70
131
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 👥 关于我们
|
|
135
|
+
|
|
136
|
+
本项目由 **意心Ai团队 + Claude + Claude Code** Vibecoding 自研
|
|
137
|
+
|
|
138
|
+
- 🌐 官网:[https://yxai.chat](https://yxai.chat)
|
|
139
|
+
- 💬 联系我们:可通过意心Ai官网添加我们联系方式
|
|
140
|
+
- 🐛 问题反馈:如果是工具问题可提交 issue,意心Ai龙虾将会 24 小时审核并完成你的 issue~
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
<div align="center">
|
|
74
145
|
|
|
75
|
-
|
|
146
|
+
Made with ❤️ by YXAI Team
|
|
76
147
|
|
|
77
|
-
|
|
148
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yxai/code",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "意心Code -
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "意心Code - 无门槛的ClaudeCode可视化轻量工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
8
|
+
"yxai": "server.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node server.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "https://
|
|
29
|
+
"url": "https://github.com/ccnetcore/yxaicode.git"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=18.0.0"
|
|
Binary file
|
package/public/index.html
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>意心Code - yxcode</title>
|
|
7
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
8
|
+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
|
7
9
|
<link rel="stylesheet" href="/vendor/github-dark.min.css">
|
|
8
10
|
<script src="/vendor/marked.min.js"></script>
|
|
9
11
|
<script src="/vendor/highlight.min.js"></script>
|
|
@@ -1376,7 +1378,7 @@ button:active::before {
|
|
|
1376
1378
|
inset: 0;
|
|
1377
1379
|
background: rgba(0, 0, 0, 0.75);
|
|
1378
1380
|
backdrop-filter: blur(8px);
|
|
1379
|
-
z-index:
|
|
1381
|
+
z-index: 2000;
|
|
1380
1382
|
display: flex;
|
|
1381
1383
|
align-items: center;
|
|
1382
1384
|
justify-content: center;
|
|
@@ -1678,7 +1680,7 @@ button:active::before {
|
|
|
1678
1680
|
inset: 0;
|
|
1679
1681
|
background: rgba(0, 0, 0, 0.8);
|
|
1680
1682
|
backdrop-filter: blur(8px);
|
|
1681
|
-
z-index:
|
|
1683
|
+
z-index: 2000;
|
|
1682
1684
|
display: flex;
|
|
1683
1685
|
align-items: center;
|
|
1684
1686
|
justify-content: center;
|
|
@@ -1743,7 +1745,7 @@ button:active::before {
|
|
|
1743
1745
|
inset: 0;
|
|
1744
1746
|
background: rgba(0, 0, 0, 0.75);
|
|
1745
1747
|
backdrop-filter: blur(8px);
|
|
1746
|
-
z-index:
|
|
1748
|
+
z-index: 2000;
|
|
1747
1749
|
display: flex;
|
|
1748
1750
|
align-items: center;
|
|
1749
1751
|
justify-content: center;
|
|
@@ -1998,7 +2000,7 @@ button:active::before {
|
|
|
1998
2000
|
<header id="header">
|
|
1999
2001
|
<div class="header-left">
|
|
2000
2002
|
<button id="sidebarToggle" class="btn-icon" title="会话列表">☰</button>
|
|
2001
|
-
<span class="logo">意心Code</span><span class="version">
|
|
2003
|
+
<span class="logo">意心Code</span><span class="version">v0.0.2</span>
|
|
2002
2004
|
</div>
|
|
2003
2005
|
<div class="header-center">
|
|
2004
2006
|
<div class="model-select-wrapper">
|
package/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* 意心Code (yxcode) - Claude Code 可视化交互界面
|
|
4
4
|
*
|
|
@@ -27,20 +27,20 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
27
27
|
意心Code (yxcode) - Claude Code 可视化交互界面
|
|
28
28
|
|
|
29
29
|
用法:
|
|
30
|
-
|
|
30
|
+
yxai [选项]
|
|
31
31
|
|
|
32
32
|
选项:
|
|
33
33
|
-h, --help 显示帮助信息
|
|
34
34
|
-v, --version 显示版本号
|
|
35
|
-
-p, --port 指定端口号 (默认:
|
|
35
|
+
-p, --port 指定端口号 (默认: 6060)
|
|
36
36
|
|
|
37
37
|
环境变量:
|
|
38
38
|
PORT 自定义端口号
|
|
39
39
|
|
|
40
40
|
示例:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
PORT=8080
|
|
41
|
+
yxai
|
|
42
|
+
yxai --port 8080
|
|
43
|
+
PORT=8080 yxai
|
|
44
44
|
`);
|
|
45
45
|
process.exit(0);
|
|
46
46
|
}
|
|
@@ -52,7 +52,7 @@ if (args.includes('--version') || args.includes('-v')) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// --- Config ---
|
|
55
|
-
let PORT = parseInt(process.env.PORT, 10) ||
|
|
55
|
+
let PORT = parseInt(process.env.PORT, 10) || 6060;
|
|
56
56
|
const portIndex = args.findIndex(arg => arg === '--port' || arg === '-p');
|
|
57
57
|
if (portIndex !== -1 && args[portIndex + 1]) {
|
|
58
58
|
PORT = parseInt(args[portIndex + 1], 10);
|
|
@@ -545,31 +545,46 @@ wss.on('connection', (ws) => {
|
|
|
545
545
|
ws.on('close', () => console.log('[WS] client disconnected'));
|
|
546
546
|
});
|
|
547
547
|
|
|
548
|
-
server
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
548
|
+
// Try to start server, auto-increment port if in use
|
|
549
|
+
const MAX_PORT_ATTEMPTS = 100;
|
|
550
|
+
let currentPort = PORT;
|
|
551
|
+
let portAttempts = 0;
|
|
552
|
+
|
|
553
|
+
function startServer(port) {
|
|
554
|
+
server.listen(port, () => {
|
|
555
|
+
PORT = port;
|
|
556
|
+
const url = `http://localhost:${port}`;
|
|
557
|
+
console.log(`\n 意心Code (yxcode) 已启动`);
|
|
558
|
+
console.log(` ${url}\n`);
|
|
559
|
+
|
|
560
|
+
// Auto-open browser
|
|
561
|
+
const open = (url) => {
|
|
562
|
+
const cmd = process.platform === 'win32' ? `start ${url}`
|
|
563
|
+
: process.platform === 'darwin' ? `open ${url}`
|
|
564
|
+
: `xdg-open ${url}`;
|
|
565
|
+
exec(cmd);
|
|
566
|
+
};
|
|
560
567
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
});
|
|
568
|
+
// Open browser after a short delay
|
|
569
|
+
setTimeout(() => open(url), 1000);
|
|
570
|
+
});
|
|
571
|
+
}
|
|
564
572
|
|
|
565
|
-
// Handle port in use error
|
|
566
573
|
server.on('error', (err) => {
|
|
567
574
|
if (err.code === 'EADDRINUSE') {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
575
|
+
portAttempts++;
|
|
576
|
+
if (portAttempts < MAX_PORT_ATTEMPTS) {
|
|
577
|
+
const nextPort = currentPort + portAttempts;
|
|
578
|
+
console.log(` 端口 ${currentPort + portAttempts - 1} 已被占用,尝试端口 ${nextPort}...`);
|
|
579
|
+
startServer(nextPort);
|
|
580
|
+
} else {
|
|
581
|
+
console.error(`\n 错误: 无法找到可用端口 (已尝试 ${MAX_PORT_ATTEMPTS} 次)\n`);
|
|
582
|
+
process.exit(1);
|
|
583
|
+
}
|
|
571
584
|
} else {
|
|
572
585
|
console.error(`\n 服务器错误: ${err.message}\n`);
|
|
573
586
|
process.exit(1);
|
|
574
587
|
}
|
|
575
588
|
});
|
|
589
|
+
|
|
590
|
+
startServer(currentPort);
|