glad-web 1.0.46 → 2.0.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.
Files changed (74) hide show
  1. package/README.md +4 -192
  2. package/THIRD_PARTY_NOTICES.md +27 -0
  3. package/bin/glad.cjs +56 -0
  4. package/package.json +19 -61
  5. package/README.zh-CN.md +0 -198
  6. package/assets/logo.svg +0 -43
  7. package/bin/cli.js +0 -65
  8. package/lib/ai-tools/demo/enhanced-demo.js +0 -625
  9. package/lib/ai-tools/demo/index.js +0 -24
  10. package/lib/ai-tools/demo/responses.js +0 -88
  11. package/lib/ai-tools/detector.js +0 -76
  12. package/lib/ai-tools/registry.js +0 -300
  13. package/lib/claude/cli-usage.js +0 -95
  14. package/lib/claude/config.js +0 -82
  15. package/lib/claude/structured-session.js +0 -884
  16. package/lib/claude/transcript-repository.js +0 -216
  17. package/lib/codex/image-store.js +0 -174
  18. package/lib/codex/structured-session.js +0 -1590
  19. package/lib/commands/config.js +0 -78
  20. package/lib/commands/tools.js +0 -128
  21. package/lib/commands/web.js +0 -605
  22. package/lib/config/constants.js +0 -17
  23. package/lib/config/manager.js +0 -108
  24. package/lib/git/service.js +0 -83
  25. package/lib/notifications/message-formatter.js +0 -94
  26. package/lib/notifications/notification-service.js +0 -143
  27. package/lib/notifications/serverchan-client.js +0 -58
  28. package/lib/notifications/serverchan-settings-store.js +0 -115
  29. package/lib/schedule/job-runner.js +0 -162
  30. package/lib/schedule/job-store.js +0 -167
  31. package/lib/schedule/key-sequences.js +0 -49
  32. package/lib/schedule/scheduler-service.js +0 -39
  33. package/lib/server/routes/notifications.js +0 -52
  34. package/lib/server/routes/providers.js +0 -114
  35. package/lib/server/routes/schedules.js +0 -54
  36. package/lib/server/routes/skillhub.js +0 -104
  37. package/lib/server/routes/usage.js +0 -23
  38. package/lib/server/routes/workspace.js +0 -77
  39. package/lib/session/buffer.js +0 -102
  40. package/lib/session/file-attachment-store.js +0 -168
  41. package/lib/session/pty-manager.js +0 -255
  42. package/lib/session/rendered-history.js +0 -225
  43. package/lib/session/session-manager.js +0 -1032
  44. package/lib/session/text-history.js +0 -274
  45. package/lib/skillhub/client.js +0 -121
  46. package/lib/skillhub/settings-store.js +0 -168
  47. package/lib/skillhub/skill-installer.js +0 -320
  48. package/lib/usage/ccusage-runner.js +0 -128
  49. package/lib/usage/source-catalog.js +0 -26
  50. package/lib/usage/usage-service.js +0 -226
  51. package/lib/utils/logger.js +0 -74
  52. package/lib/utils/pid.js +0 -67
  53. package/lib/utils/validation.js +0 -53
  54. package/lib/web/bootstrap.js +0 -34
  55. package/lib/web/claude.js +0 -1150
  56. package/lib/web/codex.js +0 -1045
  57. package/lib/web/composer.js +0 -493
  58. package/lib/web/core.js +0 -385
  59. package/lib/web/git.js +0 -535
  60. package/lib/web/gitgraph.js +0 -293
  61. package/lib/web/index.html +0 -547
  62. package/lib/web/layout.js +0 -69
  63. package/lib/web/notifications.js +0 -164
  64. package/lib/web/schedules.js +0 -245
  65. package/lib/web/session.js +0 -361
  66. package/lib/web/shell.js +0 -74
  67. package/lib/web/skillhub.js +0 -197
  68. package/lib/web/styles.css +0 -932
  69. package/lib/web/terminal-scroll.js +0 -81
  70. package/lib/web/theme.js +0 -60
  71. package/lib/web/timed-inputs.js +0 -216
  72. package/lib/web/usage.js +0 -323
  73. package/lib/workspace/service.js +0 -77
  74. package/scripts/check-syntax.js +0 -26
package/README.md CHANGED
@@ -1,198 +1,10 @@
1
- <div align="center">
2
- <img src="./assets/logo.svg" alt="Glad Logo" width="150" height="150" />
3
- <h1>Glad</h1>
4
- </div>
1
+ # Glad
5
2
 
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 **Codex** on your machine, then access them through a clean browser UI from desktop or mobile devices on your local network.
9
-
10
- ![Glad AI mobile interface](./assets/demo.jpg)
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
- ![Glad Architecture](./assets/architecture.svg)
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
- - **Responsive workspace:** Use a resizable session sidebar on wide screens and focused lobby/chat pages on mobile, with light and dark themes.
38
- - **File attachments:** Upload images or arbitrary local files from the composer; Glad stores them privately for the active session and cleans them up automatically.
39
- - **Local usage dashboard:** Select a week or month, compare per-model and daily token totals, and inspect model-stacked token and cost charts through the bundled read-only `ccusage` engine. Costs use `ccusage` estimates and are shown only for GPT models used by Codex.
40
- - **High-fidelity terminal interaction:** A mobile-friendly terminal experience with touch shortcuts.
41
- - **Extreme performance history viewing:** Fast and responsive text history.
42
- - **Simple but effective change checking:** Integrated Git changes preview.
43
- - **Resilient execution:** Client (mobile) disconnections will not interrupt running tasks on the host machine.
44
- - **Simplicity:** One-command Web UI with built-in detection for many popular AI CLIs.
45
- - **Standalone binaries:** Linux, macOS, and Windows standalone packaging available.
46
-
47
- ## Quick Start
48
-
49
- ### Install with npm
50
-
51
- Requirements:
52
-
53
- - Node.js `>=18`
3
+ This package installs the native Glad launcher for the current operating system.
54
4
 
55
5
  ```bash
56
6
  npm install -g glad-web
57
- glad
58
- ```
59
-
60
- After installation, the package name is `glad-web` and the command is `glad`.
61
-
62
- ### Run from source
63
-
64
- Requirements:
65
-
66
- - Node.js `>=18`
67
-
68
- ```bash
69
- git clone https://github.com/Anonymous/Glad.git
70
- cd glad
71
- npm install
72
- node bin/cli.js
73
- ```
74
-
75
- ### Run as a binary
76
-
77
- **Linux:**
78
-
79
- ```bash
80
- chmod +x glad-linux-amd64
81
- ./glad-linux-amd64
82
- ```
83
-
84
- **Windows:**
85
-
86
- Simply double-click `glad-windows-amd64.exe` to run, or execute it in the Command Prompt:
87
-
88
- ```cmd
89
- glad-windows-amd64.exe
90
- ```
91
-
92
- **macOS Intel:**
93
-
94
- ```bash
95
- chmod +x glad-macos-x64
96
- ./glad-macos-x64
97
- ```
98
-
99
- **macOS Apple Silicon:**
100
-
101
- ```bash
102
- chmod +x glad-macos-arm64
103
- ./glad-macos-arm64
104
- ```
105
-
106
- ## Usage
107
-
108
- Glad starts a local Web server on port `3000` by default.
109
-
110
- 1. Open `http://localhost:3000`.
111
- 2. Click `+ New`.
112
- 3. Optionally choose a working directory.
113
- 4. Pick an installed AI tool.
114
- 5. Start the session from the browser UI.
115
-
116
- Useful commands:
117
-
118
- ```bash
119
- glad
120
- glad /path/to/project
121
- glad . --port 8080
122
- glad tools list
123
- glad tools detect
124
- ```
125
-
126
- ## Supported Tools
127
-
128
- 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:
129
-
130
- | Tool | Detected command |
131
- | --- | --- |
132
- | Claude | `claude` |
133
- | Aider | `aider` |
134
- | Codex | `codex` |
135
- | Copilot | `copilot` |
136
- | Cody | `cody chat` |
137
- | Antigravity | `agy` |
138
- | Continue | `cn` |
139
- | Cursor | `cursor-agent` |
140
- | ChatGPT | `chatgpt` |
141
- | ShellGPT | `sgpt --repl temp` |
142
- | Mentat | `mentat` |
143
- | Grok | `grok` |
144
- | Ollama | `ollama run codellama` |
145
- | OpenHands | `openhands` |
146
- | OpenCode | `opencode` |
147
- | Blackbox AI | `blackboxai` |
148
- | Amazon Q | `q` |
149
- | Pi | `pi` |
150
- | Kilo | `kilo` |
151
- | Qoder | `qodercli` |
152
-
153
- Glad also includes a built-in `demo` tool for testing, but demo mode is not included in auto-detection.
154
-
155
- ## Packaging
156
-
157
- Build a Linux standalone binary with:
158
-
159
- ```bash
160
- npm run build:linux
161
- ```
162
-
163
- Build a Windows standalone binary with:
164
-
165
- ```bash
166
- npm run build:windows
167
- ```
168
-
169
- Build a macOS Intel standalone binary on an Intel macOS runner with:
170
-
171
- ```bash
172
- npm run build:macos:x64
7
+ glad . --port 3001
173
8
  ```
174
9
 
175
- Build a macOS Apple Silicon standalone binary on an Apple Silicon macOS runner with:
176
-
177
- ```bash
178
- npm run build:macos:arm64
179
- ```
180
-
181
- 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`.
182
-
183
- ## Security Model
184
-
185
- Glad is designed for trusted local or private-network use.
186
-
187
- - the server runs on your machine
188
- - terminal I/O stays local to that machine
189
- - the browser UI talks directly to the local Glad process
190
-
191
- Do not expose Glad directly to the public internet without adding your own access controls.
192
-
193
- See [SECURITY.md](./SECURITY.md) for details.
194
-
195
-
196
- ## License
197
-
198
- MIT. Glad is maintained by [anonymous](https://github.com/Anonymous/Glad).
10
+ Glad requires the official `codex` and/or `claude` CLI to be installed and authenticated locally.
@@ -0,0 +1,27 @@
1
+ # Third-party notices
2
+
3
+ Glad embeds or links the following third-party components in its native binary.
4
+
5
+ ## coder/websocket
6
+
7
+ Copyright (c) 2025 Coder
8
+
9
+ Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
+
13
+ ## xterm.js and addon-fit
14
+
15
+ Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
16
+
17
+ Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com)
18
+
19
+ Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/)
20
+
21
+ Copyright (c) 2019, The xterm.js authors (addon-fit)
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/bin/glad.cjs ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const { spawn } = require('node:child_process');
6
+
7
+ const targets = {
8
+ 'linux-x64': ['glad-web-linux-x64', 'bin/glad'],
9
+ 'linux-arm64': ['glad-web-linux-arm64', 'bin/glad'],
10
+ 'darwin-x64': ['glad-web-darwin-x64', 'bin/glad'],
11
+ 'darwin-arm64': ['glad-web-darwin-arm64', 'bin/glad'],
12
+ 'win32-x64': ['glad-web-windows-x64', 'bin/glad.exe']
13
+ };
14
+
15
+ const key = `${process.platform}-${process.arch}`;
16
+ const target = targets[key];
17
+ if (!target) {
18
+ console.error(`Glad does not provide a binary for ${key}.`);
19
+ process.exit(1);
20
+ }
21
+
22
+ let executable;
23
+ try {
24
+ executable = require.resolve(`${target[0]}/${target[1]}`);
25
+ } catch (_) {
26
+ console.error([
27
+ `Glad's ${key} binary was not installed.`,
28
+ 'Reinstall without --omit=optional:',
29
+ ' npm install -g glad-web'
30
+ ].join('\n'));
31
+ process.exit(1);
32
+ }
33
+
34
+ const child = spawn(executable, process.argv.slice(2), {
35
+ stdio: 'inherit',
36
+ windowsHide: false
37
+ });
38
+
39
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
40
+ process.on(signal, () => {
41
+ try { child.kill(signal); } catch (_) { /* process already stopped */ }
42
+ });
43
+ }
44
+
45
+ child.once('error', error => {
46
+ console.error(`Unable to start Glad: ${error.message}`);
47
+ process.exit(1);
48
+ });
49
+
50
+ child.once('exit', (code, signal) => {
51
+ if (signal) {
52
+ process.kill(process.pid, signal);
53
+ return;
54
+ }
55
+ process.exit(code == null ? 1 : code);
56
+ });
package/package.json CHANGED
@@ -1,71 +1,29 @@
1
1
  {
2
2
  "name": "glad-web",
3
- "version": "1.0.46",
4
- "description": "Glad transforms terminal-based AI coding tools into a polished, mobile-friendly local Web interface.",
3
+ "version": "2.0.1",
4
+ "description": "A local-first Web interface for Codex and Claude",
5
+ "license": "MIT",
5
6
  "bin": {
6
- "glad": "bin/cli.js"
7
- },
8
- "scripts": {
9
- "start": "node bin/cli.js",
10
- "test:e2e": "playwright test",
11
- "build:linux": "npx caxa -i . -e \".git\" \".github\" \"assets/Demo.mp4\" \"assets/demo.gif\" \"assets/demo.jpg\" \"assets/wechat.jpg\" \"glad-*\" \"*.tgz\" -m \"Extracting Glad...\" --output \"glad-linux-amd64\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/cli.js\"",
12
- "build:macos:x64": "npx caxa -i . -e \".git\" \".github\" \"assets/Demo.mp4\" \"assets/demo.gif\" \"assets/demo.jpg\" \"assets/wechat.jpg\" \"glad-*\" \"*.tgz\" -m \"Extracting Glad...\" --output \"glad-macos-x64\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/cli.js\"",
13
- "build:macos:arm64": "npx caxa -i . -e \".git\" \".github\" \"assets/Demo.mp4\" \"assets/demo.gif\" \"assets/demo.jpg\" \"assets/wechat.jpg\" \"glad-*\" \"*.tgz\" -m \"Extracting Glad...\" --output \"glad-macos-arm64\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/cli.js\"",
14
- "build:windows": "npx caxa -i . -e \".git\" \".github\" \"assets/Demo.mp4\" \"assets/demo.gif\" \"assets/demo.jpg\" \"assets/wechat.jpg\" \"glad-*\" \"*.tgz\" -m \"Extracting Glad...\" --output \"glad-windows-amd64.exe\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/bin/cli.js\"",
15
- "test": "node --test lib/**/*.test.js",
16
- "check": "node scripts/check-syntax.js"
7
+ "glad": "bin/glad.cjs"
17
8
  },
18
- "keywords": [
19
- "terminal",
20
- "remote",
21
- "ai",
22
- "coding",
23
- "assistant",
24
- "claude",
25
- "aider",
26
- "copilot",
27
- "web-ui"
9
+ "files": [
10
+ "bin/glad.cjs",
11
+ "README.md",
12
+ "LICENSE",
13
+ "THIRD_PARTY_NOTICES.md"
28
14
  ],
29
- "author": "Glad Team",
30
- "license": "MIT",
31
- "homepage": "https://github.com/Anonymous/Glad",
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/Anonymous/Glad.git"
35
- },
36
- "bugs": {
37
- "url": "https://github.com/Anonymous/Glad/issues"
38
- },
39
15
  "engines": {
40
- "node": ">=18.0.0"
16
+ "node": ">=18"
41
17
  },
42
- "files": [
43
- "bin/",
44
- "lib/",
45
- "scripts/",
46
- "!lib/**/*.test.js",
47
- "assets/logo.svg",
48
- "README.md"
49
- ],
50
- "dependencies": {
51
- "@anthropic-ai/claude-agent-sdk": "^0.3.201",
52
- "@xterm/addon-fit": "^0.10.0",
53
- "@xterm/headless": "^6.0.0",
54
- "@xterm/xterm": "^5.5.0",
55
- "ccusage": "20.0.20",
56
- "chalk": "^4.1.2",
57
- "commander": "^11.0.0",
58
- "conf": "^10.2.0",
59
- "express": "^5.2.1",
60
- "node-pty": "npm:@lydell/node-pty@^1.1.0",
61
- "uuid": "^11.1.1",
62
- "ws": "^8.19.0",
63
- "yaml": "^2.8.1",
64
- "yauzl": "^3.2.0"
18
+ "optionalDependencies": {
19
+ "glad-web-linux-x64": "2.0.1",
20
+ "glad-web-linux-arm64": "2.0.1",
21
+ "glad-web-darwin-x64": "2.0.1",
22
+ "glad-web-darwin-arm64": "2.0.1",
23
+ "glad-web-windows-x64": "2.0.1"
65
24
  },
66
- "devDependencies": {
67
- "@playwright/test": "^1.61.1",
68
- "caxa": "^3.0.1",
69
- "yazl": "^3.3.1"
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/Next2012/Glad.git"
70
28
  }
71
29
  }
package/README.zh-CN.md DELETED
@@ -1,198 +0,0 @@
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**、**Codex** 等交互式命令行工具,并通过一个适合桌面和移动端访问的浏览器界面来使用它们。
9
-
10
- ![Glad AI 移动端界面](./assets/demo.jpg)
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
- ![Glad 架构图](./assets/architecture.svg)
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
- - **响应式工作区**:宽屏提供可调宽度的会话侧边栏,手机使用大厅与对话双页面,并支持亮色、暗色主题。
38
- - **文件附件**:可从输入区上传图片或普通文件;附件仅保存于当前会话的私有临时目录,并会自动清理。
39
- - **本地用量看板**:通过内置的只读 `ccusage` 引擎选择某周或某月,查看按模型汇总及每日 token,并用按模型堆叠的柱状图比较 token 和费用;费用完全采用 `ccusage` 估算,且只对 Codex 使用的 GPT 模型显示。
40
- - **高还原度的 terminal 交互**:专为手机优化的终端体验与快捷按键。
41
- - **极致性能的历史查看**:快速流畅的终端历史记录浏览。
42
- - **简单但足够好用的改动检查**:内置 Git 改动预览功能。
43
- - **断线保护**:服务端任务不受移动端网络断开影响。
44
- - **开箱即用**:一条命令启动 Web UI,自动检测多种主流 AI CLI。
45
- - **独立二进制**:支持打包 Linux、macOS 和 Windows 独立可执行文件。
46
-
47
- ## 快速开始
48
-
49
- ### 通过 npm 安装
50
-
51
- 要求:
52
-
53
- - Node.js `>=18`
54
-
55
- ```bash
56
- npm install -g glad-web
57
- glad
58
- ```
59
-
60
- 安装时的 npm 包名是 `glad-web`,安装后的命令是 `glad`。
61
-
62
- ### 从源码运行
63
-
64
- 要求:
65
-
66
- - Node.js `>=18`
67
-
68
- ```bash
69
- git clone https://github.com/Anonymous/Glad.git
70
- cd glad
71
- npm install
72
- node bin/cli.js
73
- ```
74
-
75
- ### 以二进制运行
76
-
77
- **Linux:**
78
-
79
- ```bash
80
- chmod +x glad-linux-amd64
81
- ./glad-linux-amd64
82
- ```
83
-
84
- **Windows:**
85
-
86
- 直接双击 `glad-windows-amd64.exe` 即可运行,或者在命令提示符中执行:
87
-
88
- ```cmd
89
- glad-windows-amd64.exe
90
- ```
91
-
92
- **macOS Intel:**
93
-
94
- ```bash
95
- chmod +x glad-macos-x64
96
- ./glad-macos-x64
97
- ```
98
-
99
- **macOS Apple Silicon:**
100
-
101
- ```bash
102
- chmod +x glad-macos-arm64
103
- ./glad-macos-arm64
104
- ```
105
-
106
- ## 使用方式
107
-
108
- Glad 默认在本机 `3000` 端口启动 Web 服务。
109
-
110
- 1. 打开 `http://localhost:3000`
111
- 2. 点击 `+ New`
112
- 3. 按需填写工作目录
113
- 4. 选择一个已安装的 AI 工具
114
- 5. 在浏览器里启动并使用会话
115
-
116
- 常用命令:
117
-
118
- ```bash
119
- glad
120
- glad /path/to/project
121
- glad . --port 8080
122
- glad tools list
123
- glad tools detect
124
- ```
125
-
126
- ## 支持的工具
127
-
128
- Glad 当前会自动检测代码注册表中定义的 20 个终端 AI 工具。下面的名称严格使用 Glad 注册表里的 `displayName`:
129
-
130
- | 工具 | 检测命令 |
131
- | --- | --- |
132
- | Claude | `claude` |
133
- | Aider | `aider` |
134
- | Codex | `codex` |
135
- | Copilot | `copilot` |
136
- | Cody | `cody chat` |
137
- | Antigravity | `agy` |
138
- | Continue | `cn` |
139
- | Cursor | `cursor-agent` |
140
- | ChatGPT | `chatgpt` |
141
- | ShellGPT | `sgpt --repl temp` |
142
- | Mentat | `mentat` |
143
- | Grok | `grok` |
144
- | Ollama | `ollama run codellama` |
145
- | OpenHands | `openhands` |
146
- | OpenCode | `opencode` |
147
- | Blackbox AI | `blackboxai` |
148
- | Amazon Q | `q` |
149
- | Pi | `pi` |
150
- | Kilo | `kilo` |
151
- | Qoder | `qodercli` |
152
-
153
- Glad 还内置了用于测试的 `demo` 工具,但 demo 模式不计入自动检测列表。
154
-
155
- ## 打包
156
-
157
- 构建 Linux 独立二进制:
158
-
159
- ```bash
160
- npm run build:linux
161
- ```
162
-
163
- 构建 Windows 独立二进制:
164
-
165
- ```bash
166
- npm run build:windows
167
- ```
168
-
169
- 在 Intel macOS runner 上构建 macOS Intel 独立二进制:
170
-
171
- ```bash
172
- npm run build:macos:x64
173
- ```
174
-
175
- 在 Apple Silicon macOS runner 上构建 macOS Apple Silicon 独立二进制:
176
-
177
- ```bash
178
- npm run build:macos:arm64
179
- ```
180
-
181
- 构建后会分别生成 `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 版本。
182
-
183
- ## 安全模型
184
-
185
- Glad 面向受信任的本机或局域网环境使用。
186
-
187
- - 服务进程运行在你的机器上
188
- - 终端 I/O 保留在本机
189
- - 浏览器 UI 直接与本地 Glad 进程通信
190
-
191
- 如果没有额外访问控制,不建议直接暴露到公网。
192
-
193
- 更多说明见 [SECURITY.md](./SECURITY.md)。
194
-
195
-
196
- ## 开源协议
197
-
198
- 本项目使用 MIT 协议,由 [anonymous](https://github.com/Anonymous/Glad) 维护。
package/assets/logo.svg DELETED
@@ -1,43 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
2
- <defs>
3
- <!-- Normcore / Cold Slate Background Gradient -->
4
- <linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
5
- <stop offset="0%" stop-color="#1E2024" />
6
- <stop offset="50%" stop-color="#111215" />
7
- <stop offset="100%" stop-color="#050505" />
8
- </linearGradient>
9
-
10
- <!-- Sunset Coral Gradient (Warm, energetic smile/tongue) -->
11
- <linearGradient id="faceGrad" gradientUnits="userSpaceOnUse" x1="125" y1="230" x2="387" y2="310">
12
- <stop offset="0%" stop-color="#FF9E79" />
13
- <stop offset="60%" stop-color="#FF6F61" />
14
- <stop offset="100%" stop-color="#D84315" />
15
- </linearGradient>
16
- </defs>
17
-
18
- <!-- Background App Icon Shape (Cold basalt gradient, fills the icon canvas) -->
19
- <rect width="512" height="512" fill="url(#bgGrad)" />
20
-
21
- <!-- CLI Face (Expanded to fill the icon area, no phone container) -->
22
- <!-- Left Eye: Terminal I-Beam Cursor (Bold & Centered) -->
23
- <path d="M 145 101 H 175 M 160 101 V 151 M 145 151 H 175" fill="none" stroke="#007aff" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" />
24
-
25
- <!-- Right Eye: Project's Send Button Triangle/Paper Plane (Bold & Centered) -->
26
- <g transform="translate(352, 126) scale(2.4) translate(-12, -12)">
27
- <line x1="22" y1="2" x2="11" y2="13" stroke="#007aff" stroke-width="5.0" stroke-linecap="round" stroke-linejoin="round" />
28
- <polygon points="22 2 15 22 11 13 2 9 22 2" fill="none" stroke="#007aff" stroke-width="5.0" stroke-linecap="round" stroke-linejoin="round" />
29
- </g>
30
-
31
- <!-- Centered tongue-out mouth -->
32
- <path d="M 125 230 H 387" fill="none" stroke="url(#faceGrad)" stroke-width="15" stroke-linecap="round" />
33
- <path d="M 218 230 C 220 250 220 273 226 289 C 232 305 242 313 256 313 C 270 313 280 305 286 289 C 292 273 292 250 294 230" fill="none" stroke="url(#faceGrad)" stroke-width="15" stroke-linecap="round" stroke-linejoin="round" />
34
- <path d="M 256 290 V 308" fill="none" stroke="url(#faceGrad)" stroke-width="6" stroke-linecap="round" />
35
-
36
- <!-- Git Diff Lines (Expanded & Centered, no filter, 50% opacity for clear mobile legibility) -->
37
- <!-- Add (+) Line: Faded Green -->
38
- <line x1="130" y1="361" x2="382" y2="361" stroke="#2EA44F" stroke-width="14" stroke-linecap="round" opacity="0.5" />
39
- <!-- Delete (-) Line: Faded Red -->
40
- <line x1="130" y1="386" x2="300" y2="386" stroke="#CF222E" stroke-width="14" stroke-linecap="round" opacity="0.5" />
41
- <!-- Add (+) Line: Faded Green -->
42
- <line x1="130" y1="411" x2="350" y2="411" stroke="#2EA44F" stroke-width="14" stroke-linecap="round" opacity="0.5" />
43
- </svg>
package/bin/cli.js DELETED
@@ -1,65 +0,0 @@
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/anonymous/glad');
61
- console.log('');
62
- });
63
-
64
- // Parse arguments
65
- program.parse(process.argv);