@ian2018cs/agenthub 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.
Files changed (136) hide show
  1. package/LICENSE +675 -0
  2. package/README.md +330 -0
  3. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  4. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  5. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  6. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  7. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  8. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  9. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  10. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  11. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  12. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  13. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  14. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  15. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  16. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  17. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  18. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  19. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  20. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  21. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  22. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  23. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  24. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  25. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  26. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  27. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  28. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  29. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  30. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  31. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  32. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  33. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  34. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  35. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  36. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  37. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  38. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  39. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  40. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  41. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  42. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  43. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  44. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  45. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  46. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  47. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  48. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  49. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  50. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  51. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  52. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  53. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  54. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  55. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  56. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  57. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  58. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  59. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  60. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  61. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  62. package/dist/assets/index-B4ru3EJb.css +32 -0
  63. package/dist/assets/index-DDFuyrpY.js +154 -0
  64. package/dist/assets/vendor-codemirror-C_VWDoZS.js +39 -0
  65. package/dist/assets/vendor-icons-CJV4dnDL.js +326 -0
  66. package/dist/assets/vendor-katex-DK8hFnhL.js +261 -0
  67. package/dist/assets/vendor-markdown-VwNYkg_0.js +35 -0
  68. package/dist/assets/vendor-react-BeVl62c0.js +59 -0
  69. package/dist/assets/vendor-syntax-CdGaPJRS.js +16 -0
  70. package/dist/assets/vendor-utils-00TdZexr.js +1 -0
  71. package/dist/assets/vendor-xterm-CvdiG4-n.js +66 -0
  72. package/dist/clear-cache.html +85 -0
  73. package/dist/convert-icons.md +53 -0
  74. package/dist/favicon.png +0 -0
  75. package/dist/favicon.svg +9 -0
  76. package/dist/generate-icons.js +49 -0
  77. package/dist/icons/claude-ai-icon.svg +1 -0
  78. package/dist/icons/codex-white.svg +3 -0
  79. package/dist/icons/codex.svg +3 -0
  80. package/dist/icons/cursor-white.svg +12 -0
  81. package/dist/icons/cursor.svg +1 -0
  82. package/dist/icons/generate-icons.md +19 -0
  83. package/dist/icons/icon-128x128.png +0 -0
  84. package/dist/icons/icon-128x128.svg +12 -0
  85. package/dist/icons/icon-144x144.png +0 -0
  86. package/dist/icons/icon-144x144.svg +12 -0
  87. package/dist/icons/icon-152x152.png +0 -0
  88. package/dist/icons/icon-152x152.svg +12 -0
  89. package/dist/icons/icon-192x192.png +0 -0
  90. package/dist/icons/icon-192x192.svg +12 -0
  91. package/dist/icons/icon-384x384.png +0 -0
  92. package/dist/icons/icon-384x384.svg +12 -0
  93. package/dist/icons/icon-512x512.png +0 -0
  94. package/dist/icons/icon-512x512.svg +12 -0
  95. package/dist/icons/icon-72x72.png +0 -0
  96. package/dist/icons/icon-72x72.svg +12 -0
  97. package/dist/icons/icon-96x96.png +0 -0
  98. package/dist/icons/icon-96x96.svg +12 -0
  99. package/dist/icons/icon-template.svg +12 -0
  100. package/dist/index.html +57 -0
  101. package/dist/logo-128.png +0 -0
  102. package/dist/logo-256.png +0 -0
  103. package/dist/logo-32.png +0 -0
  104. package/dist/logo-512.png +0 -0
  105. package/dist/logo-64.png +0 -0
  106. package/dist/logo.svg +17 -0
  107. package/dist/manifest.json +61 -0
  108. package/dist/screenshots/cli-selection.png +0 -0
  109. package/dist/screenshots/desktop-main.png +0 -0
  110. package/dist/screenshots/mobile-chat.png +0 -0
  111. package/dist/screenshots/tools-modal.png +0 -0
  112. package/dist/sw.js +49 -0
  113. package/package.json +113 -0
  114. package/server/claude-sdk.js +791 -0
  115. package/server/cli.js +330 -0
  116. package/server/database/auth.db +0 -0
  117. package/server/database/db.js +523 -0
  118. package/server/database/init.sql +23 -0
  119. package/server/index.js +1678 -0
  120. package/server/load-env.js +27 -0
  121. package/server/middleware/auth.js +118 -0
  122. package/server/projects.js +899 -0
  123. package/server/routes/admin.js +89 -0
  124. package/server/routes/auth.js +144 -0
  125. package/server/routes/commands.js +570 -0
  126. package/server/routes/mcp-utils.js +37 -0
  127. package/server/routes/mcp.js +593 -0
  128. package/server/routes/projects.js +216 -0
  129. package/server/routes/skills.js +891 -0
  130. package/server/routes/usage.js +206 -0
  131. package/server/services/pricing.js +196 -0
  132. package/server/services/usage-scanner.js +283 -0
  133. package/server/services/user-directories.js +123 -0
  134. package/server/utils/commandParser.js +303 -0
  135. package/server/utils/mcp-detector.js +73 -0
  136. package/shared/modelConstants.js +23 -0
package/README.md ADDED
@@ -0,0 +1,330 @@
1
+ <div align="center">
2
+ <img src="public/logo.svg" alt="AgentHub" width="64" height="64">
3
+ <h1>AgentHub</h1>
4
+ </div>
5
+
6
+ A desktop and mobile Web UI for AI Agents. You can use it locally or remotely to manage your AI agent sessions and interact with them from everywhere (mobile or desktop). This gives you a proper interface that works everywhere.
7
+
8
+ ## Screenshots
9
+
10
+ <div align="center">
11
+
12
+ <table>
13
+ <tr>
14
+ <td align="center">
15
+ <h3>Desktop View</h3>
16
+ <img src="public/screenshots/desktop-main.png" alt="Desktop Interface" width="400">
17
+ <br>
18
+ <em>Main interface showing project overview and chat</em>
19
+ </td>
20
+ <td align="center">
21
+ <h3>Mobile Experience</h3>
22
+ <img src="public/screenshots/mobile-chat.png" alt="Mobile Interface" width="250">
23
+ <br>
24
+ <em>Responsive mobile design with touch navigation</em>
25
+ </td>
26
+ </tr>
27
+ </table>
28
+
29
+
30
+
31
+ </div>
32
+
33
+ ## Features
34
+
35
+ - **Responsive Design** - Works seamlessly across desktop, tablet, and mobile
36
+ - **Interactive Chat Interface** - Built-in chat interface for seamless communication with AI agents
37
+ - **Integrated Shell Terminal** - Direct access to AI agents through built-in shell functionality
38
+ - **File Explorer** - Interactive file tree with syntax highlighting and live editing
39
+ - **Session Management** - Resume conversations, manage multiple sessions, and track history
40
+ - **MCP Server Support** - Add your own MCP servers through the UI
41
+ - **Model Compatibility** - Works with various AI models
42
+
43
+
44
+ ## Quick Start
45
+
46
+ ### Prerequisites
47
+
48
+ - [Node.js](https://nodejs.org/) v20 or higher
49
+ - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and configured
50
+
51
+ ### One-click Operation (Recommended)
52
+
53
+ No installation required, direct operation:
54
+
55
+ ```bash
56
+ npx agenthub
57
+ ```
58
+
59
+ The server will start and be accessible at `http://localhost:3001` (or your configured PORT).
60
+
61
+ **To restart**: Simply run the same `npx` command again after stopping the server
62
+ ### Global Installation (For Regular Use)
63
+
64
+ For frequent use, install globally once:
65
+
66
+ ```bash
67
+ npm install -g agenthub
68
+ ```
69
+
70
+ Then start with a simple command:
71
+
72
+ ```bash
73
+ agenthub
74
+ ```
75
+
76
+
77
+ **To restart**: Stop with Ctrl+C and run `claude-code-ui` again.
78
+
79
+ **To update**:
80
+ ```bash
81
+ agenthub update
82
+ ```
83
+
84
+ ### CLI Usage
85
+
86
+ After global installation, you have access to `agenthub` command:
87
+
88
+ | Command / Option | Short | Description |
89
+ |------------------|-------|-------------|
90
+ | `agenthub` | | Start the server (default) |
91
+ | `agenthub start` | | Start the server explicitly |
92
+ | `agenthub status` | | Show configuration and data locations |
93
+ | `agenthub update` | | Update to the latest version |
94
+ | `agenthub help` | | Show help information |
95
+ | `agenthub version` | | Show version information |
96
+ | `--port <port>` | `-p` | Set server port (default: 3001) |
97
+ | `--database-path <path>` | | Set custom database location |
98
+
99
+ **Examples:**
100
+ ```bash
101
+ agenthub # Start with defaults
102
+ agenthub -p 8080 # Start on custom port
103
+ agenthub status # Show current configuration
104
+ ```
105
+
106
+ ### Run as Background Service (Recommended for Production)
107
+
108
+ For production use, run AgentHub as a background service using PM2 (Process Manager 2):
109
+
110
+ #### Install PM2
111
+
112
+ ```bash
113
+ npm install -g pm2
114
+ ```
115
+
116
+ #### Start as Background Service
117
+
118
+ ```bash
119
+ # Start the server in background
120
+ pm2 start agenthub --name "agenthub"
121
+
122
+ # Or using the shorter alias
123
+ pm2 start agenthub --name "agenthub"
124
+
125
+ # Start on a custom port
126
+ pm2 start agenthub --name "agenthub" -- --port 8080
127
+ ```
128
+
129
+
130
+ #### Auto-Start on System Boot
131
+
132
+ To make AgentHub start automatically when your system boots:
133
+
134
+ ```bash
135
+ # Generate startup script for your platform
136
+ pm2 startup
137
+
138
+ # Save current process list
139
+ pm2 save
140
+ ```
141
+
142
+
143
+ ### Local Development Installation
144
+
145
+ 1. **Clone the repository:**
146
+ ```bash
147
+ git clone https://github.com/IAn2018cs/claudecodeui.git
148
+ cd claudecodeui
149
+ ```
150
+
151
+ 2. **Install dependencies:**
152
+ ```bash
153
+ npm install
154
+ ```
155
+
156
+ 3. **Configure environment:**
157
+ ```bash
158
+ cp .env.example .env
159
+ # Edit .env with your preferred settings
160
+ ```
161
+
162
+ 4. **Start the application:**
163
+ ```bash
164
+ # Development mode (with hot reload)
165
+ npm run dev
166
+
167
+ ```
168
+ The application will start at the port you specified in your .env
169
+
170
+ 5. **Open your browser:**
171
+ - Development: `http://localhost:3001`
172
+
173
+ ## Security & Tools Configuration
174
+
175
+ **🔒 Important Notice**: All agent tools are **disabled by default**. This prevents potentially harmful operations from running automatically.
176
+
177
+ ### Enabling Tools
178
+
179
+ To use full functionality, you'll need to manually enable tools:
180
+
181
+ 1. **Open Tools Settings** - Click the gear icon in the sidebar
182
+ 3. **Enable Selectively** - Turn on only the tools you need
183
+ 4. **Apply Settings** - Your preferences are saved locally
184
+
185
+ <div align="center">
186
+
187
+ ![Tools Settings Modal](public/screenshots/tools-modal.png)
188
+ *Tools Settings interface - enable only what you need*
189
+
190
+ </div>
191
+
192
+ **Recommended approach**: Start with basic tools enabled and add more as needed. You can always adjust these settings later.
193
+
194
+ ## Usage Guide
195
+
196
+ ### Core Features
197
+
198
+ #### Project Management
199
+ It automatically discovers agent sessions and groups them together into projects
200
+ session counts
201
+ - **Project Actions** - Rename, delete, and organize projects
202
+ - **Smart Navigation** - Quick access to recent projects and sessions
203
+ - **MCP support** - Add your own MCP servers through the UI
204
+
205
+ #### Chat Interface
206
+ - **Use responsive chat or CLI** - You can either use the adapted chat interface or use the shell button to connect to CLI.
207
+ - **Real-time Communication** - Stream responses from AI agents with WebSocket connection
208
+ - **Session Management** - Resume previous conversations or start fresh sessions
209
+ - **Message History** - Complete conversation history with timestamps and metadata
210
+ - **Multi-format Support** - Text, code blocks, and file references
211
+
212
+ #### File Explorer & Editor
213
+ - **Interactive File Tree** - Browse project structure with expand/collapse navigation
214
+ - **Live File Editing** - Read, modify, and save files directly in the interface
215
+ - **Syntax Highlighting** - Support for multiple programming languages
216
+ - **File Operations** - Create, rename, delete files and directories
217
+
218
+ #### Session Management
219
+ - **Session Persistence** - All conversations automatically saved
220
+ - **Session Organization** - Group sessions by project and timestamp
221
+ - **Session Actions** - Rename, delete, and export conversation history
222
+ - **Cross-device Sync** - Access sessions from any device
223
+
224
+ ### Mobile App
225
+ - **Responsive Design** - Optimized for all screen sizes
226
+ - **Touch-friendly Interface** - Swipe gestures and touch navigation
227
+ - **Mobile Navigation** - Bottom tab bar for easy thumb navigation
228
+ - **Adaptive Layout** - Collapsible sidebar and smart content prioritization
229
+ - **Add shortcut to Home Screen** - Add a shortcut to your home screen and the app will behave like a PWA
230
+
231
+ ## Architecture
232
+
233
+ ### System Overview
234
+
235
+ ```
236
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
237
+ │ Frontend │ │ Backend │ │ Agent │
238
+ │ (React/Vite) │◄──►│ (Express/WS) │◄──►│ Integration │
239
+ │ │ │ │ │ │
240
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
241
+ ```
242
+
243
+ ### Backend (Node.js + Express)
244
+ - **Express Server** - RESTful API with static file serving
245
+ - **WebSocket Server** - Communication for chats and project refresh
246
+ - **Agent Integration** - Process spawning and management
247
+ - **File System API** - Exposing file browser for projects
248
+
249
+ ### Frontend (React + Vite)
250
+ - **React 18** - Modern component architecture with hooks
251
+ - **CodeMirror** - Advanced code editor with syntax highlighting
252
+
253
+
254
+
255
+
256
+
257
+ ### Contributing
258
+
259
+ We welcome contributions! Please follow these guidelines:
260
+
261
+ #### Getting Started
262
+ 1. **Fork** the repository
263
+ 2. **Clone** your fork: `git clone <your-fork-url>`
264
+ 3. **Install** dependencies: `npm install`
265
+ 4. **Create** a feature branch: `git checkout -b feature/amazing-feature`
266
+
267
+ #### Development Process
268
+ 1. **Make your changes** following the existing code style
269
+ 2. **Test thoroughly** - ensure all features work correctly
270
+ 3. **Run quality checks**: `npm run lint && npm run format`
271
+ 4. **Commit** with descriptive messages following [Conventional Commits](https://conventionalcommits.org/)
272
+ 5. **Push** to your branch: `git push origin feature/amazing-feature`
273
+ 6. **Submit** a Pull Request with:
274
+ - Clear description of changes
275
+ - Screenshots for UI changes
276
+ - Test results if applicable
277
+
278
+ #### What to Contribute
279
+ - **Bug fixes** - Help us improve stability
280
+ - **New features** - Enhance functionality (discuss in issues first)
281
+ - **Documentation** - Improve guides and API docs
282
+ - **UI/UX improvements** - Better user experience
283
+ - **Performance optimizations** - Make it faster
284
+
285
+ ## Troubleshooting
286
+
287
+ ### Common Issues & Solutions
288
+
289
+
290
+ #### "No projects found"
291
+ **Problem**: The UI shows no projects or empty project list
292
+ **Solutions**:
293
+ - Ensure you have initialized at least one project
294
+ - Verify `~/.claude/projects/` directory exists and has proper permissions
295
+
296
+ #### File Explorer Issues
297
+ **Problem**: Files not loading, permission errors, empty directories
298
+ **Solutions**:
299
+ - Check project directory permissions (`ls -la` in terminal)
300
+ - Verify the project path exists and is accessible
301
+ - Review server console logs for detailed error messages
302
+ - Ensure you're not trying to access system directories outside project scope
303
+
304
+
305
+ ## License
306
+
307
+ GNU General Public License v3.0 - see [LICENSE](LICENSE) file for details.
308
+
309
+ This project is open source and free to use, modify, and distribute under the GPL v3 license.
310
+
311
+ ## Acknowledgments
312
+
313
+ ### Built With
314
+ - **[React](https://react.dev/)** - User interface library
315
+ - **[Vite](https://vitejs.dev/)** - Fast build tool and dev server
316
+ - **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework
317
+ - **[CodeMirror](https://codemirror.net/)** - Advanced code editor
318
+
319
+ ## Support & Community
320
+
321
+ ### Stay Updated
322
+ - **Star** this repository to show support
323
+ - **Watch** for updates and new releases
324
+ - **Follow** the project for announcements
325
+
326
+ ---
327
+
328
+ <div align="center">
329
+ <strong>Made with care for the AI community.</strong>
330
+ </div>