glad-web 1.0.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/LICENSE +21 -0
- package/README.md +182 -0
- package/README.zh-CN.md +182 -0
- package/assets/logo.svg +40 -0
- package/bin/cli.js +65 -0
- package/lib/ai-tools/demo/enhanced-demo.js +625 -0
- package/lib/ai-tools/demo/index.js +24 -0
- package/lib/ai-tools/demo/responses.js +88 -0
- package/lib/ai-tools/detector.js +76 -0
- package/lib/ai-tools/registry.js +300 -0
- package/lib/commands/config.js +78 -0
- package/lib/commands/tools.js +128 -0
- package/lib/commands/web.js +454 -0
- package/lib/config/constants.js +17 -0
- package/lib/config/manager.js +71 -0
- package/lib/git/service.js +79 -0
- package/lib/schedule/job-runner.js +162 -0
- package/lib/schedule/job-store.js +150 -0
- package/lib/schedule/key-sequences.js +49 -0
- package/lib/schedule/scheduler-service.js +39 -0
- package/lib/session/buffer.js +102 -0
- package/lib/session/pty-manager.js +241 -0
- package/lib/session/rendered-history.js +225 -0
- package/lib/session/session-manager.js +382 -0
- package/lib/session/text-history.js +274 -0
- package/lib/utils/logger.js +74 -0
- package/lib/utils/pid.js +67 -0
- package/lib/utils/validation.js +53 -0
- package/lib/web/gitgraph.js +273 -0
- package/lib/web/index.html +1470 -0
- package/lib/workspace/service.js +76 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 Termly Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./assets/logo.svg" alt="Glad Logo" width="150" height="150" />
|
|
3
|
+
<h1>Glad</h1>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
Glad is a local-first Web interface for terminal-based AI coding tools.
|
|
7
|
+
|
|
8
|
+
It lets you run interactive CLI tools such as **Claude Code**, **Aider**, **GitHub Copilot CLI**, and **Gemini CLI** on your machine, then access them through a clean browser UI from desktop or mobile devices on your local network.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
### Demo Video
|
|
13
|
+
|
|
14
|
+
Watch how Glad brings terminal AI tools to your mobile device seamlessly:
|
|
15
|
+
|
|
16
|
+
<video src="assets/Demo.mp4" controls width="100%"></video>
|
|
17
|
+
|
|
18
|
+
> [!NOTE]
|
|
19
|
+
> Glad is derived from [termly-cli](https://github.com/termly-dev/termly-cli), but the current project is intentionally focused on a simpler model: local execution, local network access, and a lightweight Web UI for terminal-native AI tools.
|
|
20
|
+
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
Glad's core working principle:
|
|
26
|
+
1. Glad runs on your server or local machine where Claude, Codex, Aider, and other CLI tools are installed.
|
|
27
|
+
2. Once started, Glad is accessible on your local machine and LAN via port 3000.
|
|
28
|
+
3. If you use Tailscale or ZeroTier for intranet penetration, you can control it remotely from anywhere.
|
|
29
|
+
4. All terminal tasks run locally within the Glad daemon, so your mobile device disconnecting won't affect task execution.
|
|
30
|
+
|
|
31
|
+
## Design Philosophy & Highlights
|
|
32
|
+
|
|
33
|
+
Glad was created to enable **vibe coding** on mobile devices. By bringing various CLIs to the web browser, login and authorization are completely aligned with the official tools, ensuring you can fully utilize your paid monthly subscriptions anywhere.
|
|
34
|
+
|
|
35
|
+
Our design philosophy is **Easy to use, Stable, and Restrained**. Glad focuses strictly on the essentials:
|
|
36
|
+
- **Session management:** Run multiple sessions from a single dashboard with per-session working directories.
|
|
37
|
+
- **High-fidelity terminal interaction:** A mobile-friendly terminal experience with touch shortcuts.
|
|
38
|
+
- **Extreme performance history viewing:** Fast and responsive text history.
|
|
39
|
+
- **Simple but effective change checking:** Integrated Git changes preview.
|
|
40
|
+
- **Resilient execution:** Client (mobile) disconnections will not interrupt running tasks on the host machine.
|
|
41
|
+
- **Simplicity:** One-command Web UI with built-in detection for many popular AI CLIs.
|
|
42
|
+
- **Standalone binaries:** Linux, macOS, and Windows standalone packaging available.
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
### Run from source
|
|
47
|
+
|
|
48
|
+
Requirements:
|
|
49
|
+
|
|
50
|
+
- Node.js `>=18`
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
git clone git@gitee.com:next2012/glad.git
|
|
54
|
+
cd glad
|
|
55
|
+
npm install
|
|
56
|
+
node bin/cli.js
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Run as a binary
|
|
60
|
+
|
|
61
|
+
**Linux:**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
chmod +x glad-linux-amd64
|
|
65
|
+
./glad-linux-amd64
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Windows:**
|
|
69
|
+
|
|
70
|
+
Simply double-click `glad-windows-amd64.exe` to run, or execute it in the Command Prompt:
|
|
71
|
+
|
|
72
|
+
```cmd
|
|
73
|
+
glad-windows-amd64.exe
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**macOS Intel:**
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
chmod +x glad-macos-x64
|
|
80
|
+
./glad-macos-x64
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**macOS Apple Silicon:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
chmod +x glad-macos-arm64
|
|
87
|
+
./glad-macos-arm64
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
Glad starts a local Web server on port `3000` by default.
|
|
93
|
+
|
|
94
|
+
1. Open `http://localhost:3000`.
|
|
95
|
+
2. Click `+ New`.
|
|
96
|
+
3. Optionally choose a working directory.
|
|
97
|
+
4. Pick an installed AI tool.
|
|
98
|
+
5. Start the session from the browser UI.
|
|
99
|
+
|
|
100
|
+
Useful commands:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
glad
|
|
104
|
+
glad /path/to/project
|
|
105
|
+
glad . --port 8080
|
|
106
|
+
glad tools list
|
|
107
|
+
glad tools detect
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Supported Tools
|
|
111
|
+
|
|
112
|
+
Glad currently auto-detects the 20 terminal AI tools defined in the code registry. The names below are the registry `displayName` values used by Glad:
|
|
113
|
+
|
|
114
|
+
| Tool | Detected command |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| Claude | `claude` |
|
|
117
|
+
| Aider | `aider` |
|
|
118
|
+
| Codex | `codex` |
|
|
119
|
+
| Copilot | `copilot` |
|
|
120
|
+
| Cody | `cody chat` |
|
|
121
|
+
| Gemini | `gemini` |
|
|
122
|
+
| Continue | `cn` |
|
|
123
|
+
| Cursor | `cursor-agent` |
|
|
124
|
+
| ChatGPT | `chatgpt` |
|
|
125
|
+
| ShellGPT | `sgpt --repl temp` |
|
|
126
|
+
| Mentat | `mentat` |
|
|
127
|
+
| Grok | `grok` |
|
|
128
|
+
| Ollama | `ollama run codellama` |
|
|
129
|
+
| OpenHands | `openhands` |
|
|
130
|
+
| OpenCode | `opencode` |
|
|
131
|
+
| Blackbox AI | `blackboxai` |
|
|
132
|
+
| Amazon Q | `q` |
|
|
133
|
+
| Pi | `pi` |
|
|
134
|
+
| Kilo | `kilo` |
|
|
135
|
+
| Qoder | `qodercli` |
|
|
136
|
+
|
|
137
|
+
Glad also includes a built-in `demo` tool for testing, but demo mode is not included in auto-detection.
|
|
138
|
+
|
|
139
|
+
## Packaging
|
|
140
|
+
|
|
141
|
+
Build a Linux standalone binary with:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm run build:linux
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Build a Windows standalone binary with:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm run build:windows
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Build a macOS Intel standalone binary on an Intel macOS runner with:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm run build:macos:x64
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Build a macOS Apple Silicon standalone binary on an Apple Silicon macOS runner with:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm run build:macos:arm64
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
After building, `glad-linux-amd64`, `glad-windows-amd64.exe`, `glad-macos-x64`, and `glad-macos-arm64` files will be generated respectively. The GitHub release workflow builds macOS Intel on `macos-15-intel` and macOS Apple Silicon on `macos-14`.
|
|
166
|
+
|
|
167
|
+
## Security Model
|
|
168
|
+
|
|
169
|
+
Glad is designed for trusted local or private-network use.
|
|
170
|
+
|
|
171
|
+
- the server runs on your machine
|
|
172
|
+
- terminal I/O stays local to that machine
|
|
173
|
+
- the browser UI talks directly to the local Glad process
|
|
174
|
+
|
|
175
|
+
Do not expose Glad directly to the public internet without adding your own access controls.
|
|
176
|
+
|
|
177
|
+
See [SECURITY.md](./SECURITY.md) for details.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT. Glad is maintained by [next2012](https://gitee.com/next2012/glad).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./assets/logo.svg" alt="Glad Logo" width="150" height="150" />
|
|
3
|
+
<h1>Glad</h1>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
Glad 是一个面向终端 AI 编码工具的本地优先 Web 界面。
|
|
7
|
+
|
|
8
|
+
它让你可以在自己的机器上运行 **Claude Code**、**Aider**、**GitHub Copilot CLI**、**Gemini CLI** 等交互式命令行工具,并通过一个适合桌面和移动端访问的浏览器界面来使用它们。
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
### 演示视频
|
|
13
|
+
|
|
14
|
+
看看 Glad 如何将终端 AI 工具无缝带到你的移动设备上:
|
|
15
|
+
|
|
16
|
+
<video src="assets/Demo.mp4" controls width="100%"></video>
|
|
17
|
+
|
|
18
|
+
> [!NOTE]
|
|
19
|
+
> Glad 基于 [termly-cli](https://github.com/termly-dev/termly-cli) 演化而来,但当前项目已经明确收敛为更简单的模型:本地执行、局域网访问、以及围绕终端 AI 工具的轻量 Web UI。
|
|
20
|
+
|
|
21
|
+
## 工作原理
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
Glad 的核心工作原理:
|
|
26
|
+
1. Glad 运行在你装好 Claude、Codex、Aider 等终端工具的服务器上。
|
|
27
|
+
2. 启动 Glad 后,在本机和局域网可通过 3000 端口访问。
|
|
28
|
+
3. 如果使用 Tailscale 或者 ZeroTier 做了内网穿透,就可以进行远程操控。
|
|
29
|
+
4. 所有终端任务在本地的 Glad 守护进程中运行,不怕手机断网影响程序执行。
|
|
30
|
+
|
|
31
|
+
## 开发目的与设计哲学
|
|
32
|
+
|
|
33
|
+
Glad 的初衷是开发一款完全运行在本地的、足够简单的,且登录和授权完全对齐官方的工具,可以把各种 CLI “搬”到网页端。这样你就可以在移动设备上随时进行 **vibe coding**,不用担心包月订阅闲置,也无需担心客户端手机断联会导致电脑端的任务停止。
|
|
34
|
+
|
|
35
|
+
我们的设计哲学是:**易用、稳定、克制**。只提供最核心且体验优秀的功能:
|
|
36
|
+
- **Session 管理**:在一个面板中管理多个会话,每个会话可单独指定工作目录。
|
|
37
|
+
- **高还原度的 terminal 交互**:专为手机优化的终端体验与快捷按键。
|
|
38
|
+
- **极致性能的历史查看**:快速流畅的终端历史记录浏览。
|
|
39
|
+
- **简单但足够好用的改动检查**:内置 Git 改动预览功能。
|
|
40
|
+
- **断线保护**:服务端任务不受移动端网络断开影响。
|
|
41
|
+
- **开箱即用**:一条命令启动 Web UI,自动检测多种主流 AI CLI。
|
|
42
|
+
- **独立二进制**:支持打包 Linux、macOS 和 Windows 独立可执行文件。
|
|
43
|
+
|
|
44
|
+
## 快速开始
|
|
45
|
+
|
|
46
|
+
### 从源码运行
|
|
47
|
+
|
|
48
|
+
要求:
|
|
49
|
+
|
|
50
|
+
- Node.js `>=18`
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
git clone git@gitee.com:next2012/glad.git
|
|
54
|
+
cd glad
|
|
55
|
+
npm install
|
|
56
|
+
node bin/cli.js
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 以二进制运行
|
|
60
|
+
|
|
61
|
+
**Linux:**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
chmod +x glad-linux-amd64
|
|
65
|
+
./glad-linux-amd64
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Windows:**
|
|
69
|
+
|
|
70
|
+
直接双击 `glad-windows-amd64.exe` 即可运行,或者在命令提示符中执行:
|
|
71
|
+
|
|
72
|
+
```cmd
|
|
73
|
+
glad-windows-amd64.exe
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**macOS Intel:**
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
chmod +x glad-macos-x64
|
|
80
|
+
./glad-macos-x64
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**macOS Apple Silicon:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
chmod +x glad-macos-arm64
|
|
87
|
+
./glad-macos-arm64
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 使用方式
|
|
91
|
+
|
|
92
|
+
Glad 默认在本机 `3000` 端口启动 Web 服务。
|
|
93
|
+
|
|
94
|
+
1. 打开 `http://localhost:3000`
|
|
95
|
+
2. 点击 `+ New`
|
|
96
|
+
3. 按需填写工作目录
|
|
97
|
+
4. 选择一个已安装的 AI 工具
|
|
98
|
+
5. 在浏览器里启动并使用会话
|
|
99
|
+
|
|
100
|
+
常用命令:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
glad
|
|
104
|
+
glad /path/to/project
|
|
105
|
+
glad . --port 8080
|
|
106
|
+
glad tools list
|
|
107
|
+
glad tools detect
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 支持的工具
|
|
111
|
+
|
|
112
|
+
Glad 当前会自动检测代码注册表中定义的 20 个终端 AI 工具。下面的名称严格使用 Glad 注册表里的 `displayName`:
|
|
113
|
+
|
|
114
|
+
| 工具 | 检测命令 |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| Claude | `claude` |
|
|
117
|
+
| Aider | `aider` |
|
|
118
|
+
| Codex | `codex` |
|
|
119
|
+
| Copilot | `copilot` |
|
|
120
|
+
| Cody | `cody chat` |
|
|
121
|
+
| Gemini | `gemini` |
|
|
122
|
+
| Continue | `cn` |
|
|
123
|
+
| Cursor | `cursor-agent` |
|
|
124
|
+
| ChatGPT | `chatgpt` |
|
|
125
|
+
| ShellGPT | `sgpt --repl temp` |
|
|
126
|
+
| Mentat | `mentat` |
|
|
127
|
+
| Grok | `grok` |
|
|
128
|
+
| Ollama | `ollama run codellama` |
|
|
129
|
+
| OpenHands | `openhands` |
|
|
130
|
+
| OpenCode | `opencode` |
|
|
131
|
+
| Blackbox AI | `blackboxai` |
|
|
132
|
+
| Amazon Q | `q` |
|
|
133
|
+
| Pi | `pi` |
|
|
134
|
+
| Kilo | `kilo` |
|
|
135
|
+
| Qoder | `qodercli` |
|
|
136
|
+
|
|
137
|
+
Glad 还内置了用于测试的 `demo` 工具,但 demo 模式不计入自动检测列表。
|
|
138
|
+
|
|
139
|
+
## 打包
|
|
140
|
+
|
|
141
|
+
构建 Linux 独立二进制:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm run build:linux
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
构建 Windows 独立二进制:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm run build:windows
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
在 Intel macOS runner 上构建 macOS Intel 独立二进制:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm run build:macos:x64
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
在 Apple Silicon macOS runner 上构建 macOS Apple Silicon 独立二进制:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm run build:macos:arm64
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
构建后会分别生成 `glad-linux-amd64`、`glad-windows-amd64.exe`、`glad-macos-x64` 和 `glad-macos-arm64` 文件。GitHub release workflow 会在 `macos-15-intel` 构建 macOS Intel 版本,并在 `macos-14` 构建 macOS Apple Silicon 版本。
|
|
166
|
+
|
|
167
|
+
## 安全模型
|
|
168
|
+
|
|
169
|
+
Glad 面向受信任的本机或局域网环境使用。
|
|
170
|
+
|
|
171
|
+
- 服务进程运行在你的机器上
|
|
172
|
+
- 终端 I/O 保留在本机
|
|
173
|
+
- 浏览器 UI 直接与本地 Glad 进程通信
|
|
174
|
+
|
|
175
|
+
如果没有额外访问控制,不建议直接暴露到公网。
|
|
176
|
+
|
|
177
|
+
更多说明见 [SECURITY.md](./SECURITY.md)。
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## 开源协议
|
|
181
|
+
|
|
182
|
+
本项目使用 MIT 协议,由 [next2012](https://gitee.com/next2012/glad) 维护。
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#151522" />
|
|
5
|
+
<stop offset="100%" stop-color="#2D2B55" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="phoneGrad" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
8
|
+
<stop offset="0%" stop-color="#FF3366" />
|
|
9
|
+
<stop offset="50%" stop-color="#FF9933" />
|
|
10
|
+
<stop offset="100%" stop-color="#33CCFF" />
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
|
|
14
|
+
<!-- Background App Icon Shape -->
|
|
15
|
+
<rect x="24" y="24" width="464" height="464" rx="104" fill="url(#bgGrad)" />
|
|
16
|
+
|
|
17
|
+
<!-- Mobile Device Outline -->
|
|
18
|
+
<rect x="126" y="66" width="260" height="380" rx="36" fill="#1A1A2E" stroke="url(#phoneGrad)" stroke-width="12" />
|
|
19
|
+
|
|
20
|
+
<!-- Mobile screen top bar (notch/speaker) -->
|
|
21
|
+
<line x1="226" y1="96" x2="286" y2="96" stroke="url(#phoneGrad)" stroke-width="8" stroke-linecap="round" />
|
|
22
|
+
|
|
23
|
+
<!-- Left Eye: Terminal Prompt ">" -->
|
|
24
|
+
<polyline points="180,185 210,205 180,225" fill="none" stroke="#33CCFF" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
|
|
25
|
+
|
|
26
|
+
<!-- Right Eye: AI Sparkle -->
|
|
27
|
+
<path d="M 322 175 Q 322 205 352 205 Q 322 205 322 235 Q 322 205 292 205 Q 322 205 322 175 Z" fill="#FFD700" />
|
|
28
|
+
|
|
29
|
+
<!-- Glad Smile -->
|
|
30
|
+
<path d="M 175 265 Q 256 315 337 265" fill="none" stroke="#FF3366" stroke-width="16" stroke-linecap="round" />
|
|
31
|
+
|
|
32
|
+
<!-- Vibe Coding Waves (Audio bars) -->
|
|
33
|
+
<g stroke-linecap="round" stroke-width="10">
|
|
34
|
+
<line x1="196" y1="375" x2="196" y2="400" stroke="#FF9933" />
|
|
35
|
+
<line x1="226" y1="355" x2="226" y2="400" stroke="#FF3366" />
|
|
36
|
+
<line x1="256" y1="340" x2="256" y2="400" stroke="#33CCFF" />
|
|
37
|
+
<line x1="286" y1="360" x2="286" y2="400" stroke="#FFD700" />
|
|
38
|
+
<line x1="316" y1="380" x2="316" y2="400" stroke="#FF9933" />
|
|
39
|
+
</g>
|
|
40
|
+
</svg>
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { Command } = require('commander');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const packageJson = require('../package.json');
|
|
6
|
+
|
|
7
|
+
// Import commands
|
|
8
|
+
const webCommand = require('../lib/commands/web');
|
|
9
|
+
const toolsCommand = require('../lib/commands/tools');
|
|
10
|
+
const configCommand = require('../lib/commands/config');
|
|
11
|
+
|
|
12
|
+
const program = new Command();
|
|
13
|
+
|
|
14
|
+
// Configure program
|
|
15
|
+
program
|
|
16
|
+
.name('glad')
|
|
17
|
+
.description('Transform your AI terminal tools into a beautiful Web interface')
|
|
18
|
+
.version(packageJson.version, '-v, --version', 'Show version');
|
|
19
|
+
|
|
20
|
+
// Default Web command
|
|
21
|
+
program
|
|
22
|
+
.command('web [directory]', { isDefault: true })
|
|
23
|
+
.description('Start the local web server to access AI tools')
|
|
24
|
+
.option('-p, --port <number>', 'Port to run the server on', '3000')
|
|
25
|
+
.action(async (directory, options) => {
|
|
26
|
+
await webCommand({ ...options, directory });
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Tools command
|
|
30
|
+
program
|
|
31
|
+
.command('tools <action> [tool-name]')
|
|
32
|
+
.description('Manage AI tools (actions: list, detect, info)')
|
|
33
|
+
.action(async (action, toolName) => {
|
|
34
|
+
await toolsCommand(action, toolName);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Config command
|
|
38
|
+
program
|
|
39
|
+
.command('config [action] [key] [value]')
|
|
40
|
+
.description('Manage configuration (actions: get, set)')
|
|
41
|
+
.action(async (action, key, value) => {
|
|
42
|
+
await configCommand(action, key, value);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Help command customization
|
|
46
|
+
program.on('--help', () => {
|
|
47
|
+
console.log('');
|
|
48
|
+
console.log('Quick Start:');
|
|
49
|
+
console.log(' $ glad # Start web server in current folder');
|
|
50
|
+
console.log(' $ glad /path/to/project # Start in specific folder');
|
|
51
|
+
console.log(' $ glad . --port 8080 # Custom port in current folder');
|
|
52
|
+
console.log('');
|
|
53
|
+
console.log('Manage Tools:');
|
|
54
|
+
console.log(' $ glad tools list # List all supported tools');
|
|
55
|
+
console.log(' $ glad tools detect # Check installed tools');
|
|
56
|
+
console.log('');
|
|
57
|
+
console.log('Supported AI Tools:');
|
|
58
|
+
console.log(' • Claude Code, Aider, GitHub Copilot, Gemini CLI, and more...');
|
|
59
|
+
console.log('');
|
|
60
|
+
console.log('Source: https://gitee.com/next2012/glad');
|
|
61
|
+
console.log('');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Parse arguments
|
|
65
|
+
program.parse(process.argv);
|