ai-kanban-terminal 0.2.0 → 0.4.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 +64 -0
- package/package.json +1 -2
- package/server.js +29 -3
package/README.md
CHANGED
|
@@ -20,6 +20,19 @@ Once published to npm:
|
|
|
20
20
|
npx ai-kanban-terminal
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
The server will start and display:
|
|
24
|
+
```
|
|
25
|
+
✓ ai-kanban-terminal is ready!
|
|
26
|
+
|
|
27
|
+
Open your browser and navigate to:
|
|
28
|
+
|
|
29
|
+
http://localhost:3000
|
|
30
|
+
|
|
31
|
+
Press Ctrl+C to stop the server
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then open your browser to `http://localhost:3000` to access the terminal.
|
|
35
|
+
|
|
23
36
|
Or from GitHub directly:
|
|
24
37
|
|
|
25
38
|
```bash
|
|
@@ -93,6 +106,57 @@ Once the application starts, you'll see a terminal interface in your browser. Yo
|
|
|
93
106
|
- **xterm.js**: Terminal emulator in the browser
|
|
94
107
|
- **@xterm/addon-fit**: Automatic terminal resizing
|
|
95
108
|
|
|
109
|
+
## Troubleshooting
|
|
110
|
+
|
|
111
|
+
### Nothing happens when running `npx ai-kanban-terminal`
|
|
112
|
+
|
|
113
|
+
If the command completes but nothing happens:
|
|
114
|
+
|
|
115
|
+
1. **Check if the server started**: Look for the success message:
|
|
116
|
+
```
|
|
117
|
+
✓ ai-kanban-terminal is ready!
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
2. **Manually open your browser**: Navigate to `http://localhost:3000`
|
|
121
|
+
|
|
122
|
+
3. **Check if port is in use**: If you see "Port 3000 is already in use", try a different port:
|
|
123
|
+
```bash
|
|
124
|
+
PORT=3001 npx ai-kanban-terminal
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
4. **Enable verbose logging**: Check npm installation logs:
|
|
128
|
+
```bash
|
|
129
|
+
npm install -g ai-kanban-terminal --verbose
|
|
130
|
+
ai-kanban-terminal
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Server fails to start
|
|
134
|
+
|
|
135
|
+
If you see an error about missing `dist` directory:
|
|
136
|
+
|
|
137
|
+
1. The package may not have been built correctly during publishing
|
|
138
|
+
2. Please report this issue at: https://github.com/kght6123/ai-kanban-terminal/issues
|
|
139
|
+
|
|
140
|
+
### Terminal not displaying in browser
|
|
141
|
+
|
|
142
|
+
1. Ensure JavaScript is enabled in your browser
|
|
143
|
+
2. Check browser console for errors (F12 → Console tab)
|
|
144
|
+
3. Verify that `http://localhost:3000` is accessible
|
|
145
|
+
|
|
146
|
+
### Other issues
|
|
147
|
+
|
|
148
|
+
For detailed logging when running via npx:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Set DEBUG environment variable for more logs
|
|
152
|
+
DEBUG=* npx ai-kanban-terminal
|
|
153
|
+
|
|
154
|
+
# Or check Node.js logs
|
|
155
|
+
NODE_DEBUG=* npx ai-kanban-terminal
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
If issues persist, please open an issue at: https://github.com/kght6123/ai-kanban-terminal/issues
|
|
159
|
+
|
|
96
160
|
## Scripts
|
|
97
161
|
|
|
98
162
|
- `npm run dev` - Start Vite development server on port 5173 (frontend only)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-kanban-terminal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Browser-based terminal with bidirectional shell using Vite, Express, node-pty, xterm.js, and Socket.IO",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"dev": "vite",
|
|
12
12
|
"build": "vite build",
|
|
13
13
|
"start": "NODE_ENV=production node server.js",
|
|
14
|
-
"postinstall": "npm run build",
|
|
15
14
|
"prepublishOnly": "npm run build",
|
|
16
15
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
17
16
|
},
|
package/server.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const express = require('express');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
5
6
|
const { createServer } = require('http');
|
|
6
7
|
const { Server } = require('socket.io');
|
|
7
8
|
const pty = require('node-pty');
|
|
@@ -24,6 +25,16 @@ const io = new Server(httpServer, {
|
|
|
24
25
|
|
|
25
26
|
// Serve static files from dist directory
|
|
26
27
|
const distPath = path.join(__dirname, 'dist');
|
|
28
|
+
|
|
29
|
+
// Check if dist directory exists
|
|
30
|
+
if (!fs.existsSync(distPath)) {
|
|
31
|
+
console.error('Error: dist directory not found at:', distPath);
|
|
32
|
+
console.error('This package may not have been built correctly.');
|
|
33
|
+
console.error('If you installed via npx, please report this issue at:');
|
|
34
|
+
console.error('https://github.com/kght6123/ai-kanban-terminal/issues');
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
expressApp.use(express.static(distPath));
|
|
28
39
|
|
|
29
40
|
// Store terminal instances per socket
|
|
@@ -37,7 +48,13 @@ io.on('connection', (socket) => {
|
|
|
37
48
|
|
|
38
49
|
try {
|
|
39
50
|
// Determine shell based on OS
|
|
40
|
-
|
|
51
|
+
let shell;
|
|
52
|
+
if (os.platform() === 'win32') {
|
|
53
|
+
shell = process.env.COMSPEC || 'cmd.exe';
|
|
54
|
+
} else {
|
|
55
|
+
// Use SHELL environment variable (user's default shell) or fallback to common shells
|
|
56
|
+
shell = process.env.SHELL || '/bin/sh';
|
|
57
|
+
}
|
|
41
58
|
|
|
42
59
|
// Create pseudo-terminal
|
|
43
60
|
// NOTE: Uses HOME directory as working directory for development.
|
|
@@ -111,8 +128,17 @@ expressApp.get('*', (req, res) => {
|
|
|
111
128
|
});
|
|
112
129
|
|
|
113
130
|
httpServer.listen(port, () => {
|
|
114
|
-
console.log(
|
|
131
|
+
console.log(`\n✓ ai-kanban-terminal is ready!`);
|
|
132
|
+
console.log(`\n Open your browser and navigate to:\n`);
|
|
133
|
+
console.log(` \x1b[1m\x1b[36mhttp://${hostname}:${port}\x1b[0m\n`);
|
|
134
|
+
console.log(` Press Ctrl+C to stop the server\n`);
|
|
115
135
|
}).on('error', (err) => {
|
|
116
|
-
|
|
136
|
+
if (err.code === 'EADDRINUSE') {
|
|
137
|
+
console.error(`\nError: Port ${port} is already in use.`);
|
|
138
|
+
console.error(`Please try a different port by setting the PORT environment variable:`);
|
|
139
|
+
console.error(` PORT=3001 npx ai-kanban-terminal\n`);
|
|
140
|
+
} else {
|
|
141
|
+
console.error('Server failed to start:', err);
|
|
142
|
+
}
|
|
117
143
|
process.exit(1);
|
|
118
144
|
});
|