thinkncollab-shell 0.0.6 → 0.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/Readme.md +322 -179
- package/bin/thinknsh.js +3 -3
- package/package.json +1 -1
- package/src/commands/auth/whoami.js +44 -39
- package/src/commands/index.js +7 -0
- package/src/commands/tasks/complete.js +1 -1
- package/src/commands/tasks/task-status.js +61 -0
- package/src/commands/tasks/tasks.js +165 -56
- package/src/core/api-client.js +64 -28
- package/src/core/project-config.js +1 -1
- package/src/core/shell.js +68 -49
- package/src/core/websocket.js +1 -1
package/Readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ThinkNCollab Shell (`thinknsh`)
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A real-time collaborative terminal shell with WebSocket integration, built on top of the ThinkNCollab platform. Run commands, join rooms, chat with teammates, manage tasks, share terminals — all from your CLI.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,34 +10,38 @@ A powerful collaborative shell with WebSocket integration for real-time team col
|
|
|
10
10
|
- [Installation](#installation)
|
|
11
11
|
- [Quick Start](#quick-start)
|
|
12
12
|
- [Configuration](#configuration)
|
|
13
|
+
- [Environment Variables](#environment-variables)
|
|
13
14
|
- [CLI Flags](#cli-flags)
|
|
14
15
|
- [Interactive Shell](#interactive-shell)
|
|
15
16
|
- [Commands Reference](#commands-reference)
|
|
16
17
|
- [Auth Commands](#auth-commands)
|
|
17
|
-
- [Team Commands](#team-commands)
|
|
18
18
|
- [Room Commands](#room-commands)
|
|
19
19
|
- [Message Commands](#message-commands)
|
|
20
|
+
- [Task Commands](#task-commands)
|
|
21
|
+
- [Terminal Share Commands](#terminal-share-commands)
|
|
22
|
+
- [Notification Commands](#notification-commands)
|
|
20
23
|
- [Shell Commands](#shell-commands)
|
|
21
|
-
- [
|
|
24
|
+
- [`.tncproject` Auto-Boot](#tncproject-auto-boot)
|
|
25
|
+
- [Notification Window](#notification-window)
|
|
22
26
|
- [Built-in Shell Features](#built-in-shell-features)
|
|
27
|
+
- [Single-Command Mode](#single-command-mode)
|
|
23
28
|
- [Examples](#examples)
|
|
24
|
-
- [Environment Variables](#environment-variables)
|
|
25
29
|
|
|
26
30
|
---
|
|
27
31
|
|
|
28
32
|
## Features
|
|
29
33
|
|
|
30
|
-
- 🚀 **Custom Shell** — Full-featured interactive
|
|
31
|
-
- 🔌 **WebSocket Integration** — Real-time
|
|
32
|
-
- 👥 **Room Collaboration** — Join rooms and
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
- 📜 **History** —
|
|
40
|
-
- 🎨 **Colored Output** —
|
|
34
|
+
- 🚀 **Custom Shell** — Full-featured interactive REPL with persistent history
|
|
35
|
+
- 🔌 **WebSocket Integration** — Real-time bidirectional sync with ThinkNCollab servers
|
|
36
|
+
- 👥 **Room Collaboration** — Join rooms, chat, and see who's online in real time
|
|
37
|
+
- 📋 **Task Management** — Accept, start, complete, and reject tasks from the CLI
|
|
38
|
+
- 📺 **Terminal Sharing** — Share your live terminal session with teammates (read + write access)
|
|
39
|
+
- 🔔 **Notification Window** — Background TCP-based popup window for live events
|
|
40
|
+
- 🔑 **`.tncproject` Auto-Boot** — Drop a config file in your project root to auto-login and join a room on shell start
|
|
41
|
+
- 🛡️ **Shell Token Auth** — Secure HMAC-SHA256 token validation for shell connections
|
|
42
|
+
- 📁 **File System** — Built-in `ls`, `cd`, `pwd`, plus passthrough to your system shell
|
|
43
|
+
- 📜 **History** — Persisted command history at `~/.thinknsh_history`
|
|
44
|
+
- 🎨 **Colored Output** — chalk-powered terminal output
|
|
41
45
|
|
|
42
46
|
---
|
|
43
47
|
|
|
@@ -51,7 +55,7 @@ npm install -g thinkncollab-shell
|
|
|
51
55
|
npm install thinkncollab-shell
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
After global install
|
|
58
|
+
After a global install the `thinknsh` binary is available everywhere on your system.
|
|
55
59
|
|
|
56
60
|
---
|
|
57
61
|
|
|
@@ -61,16 +65,16 @@ After global install, the `thinknsh` binary is available everywhere on your syst
|
|
|
61
65
|
# 1. Start the interactive shell
|
|
62
66
|
thinknsh
|
|
63
67
|
|
|
64
|
-
# 2. Log in
|
|
68
|
+
# 2. Log in
|
|
65
69
|
thinknsh> login
|
|
66
70
|
|
|
67
71
|
# 3. Join a room
|
|
68
|
-
thinknsh> join
|
|
72
|
+
thinknsh> join <room-id>
|
|
69
73
|
|
|
70
74
|
# 4. Send a message
|
|
71
75
|
thinknsh> say Hello team!
|
|
72
76
|
|
|
73
|
-
# 5. Check
|
|
77
|
+
# 5. Check session status
|
|
74
78
|
thinknsh> status
|
|
75
79
|
```
|
|
76
80
|
|
|
@@ -78,7 +82,7 @@ thinknsh> status
|
|
|
78
82
|
|
|
79
83
|
## Configuration
|
|
80
84
|
|
|
81
|
-
By default `thinknsh` connects to `https://thinkncollab.com`.
|
|
85
|
+
By default `thinknsh` connects to `https://thinkncollab.com`. Override the server in any session using environment variables:
|
|
82
86
|
|
|
83
87
|
```bash
|
|
84
88
|
export THINKNCOLLAB_SERVER=https://thinkncollab.com
|
|
@@ -87,22 +91,45 @@ export THINKNCOLLAB_WS_URL=https://thinkncollab.com
|
|
|
87
91
|
thinknsh
|
|
88
92
|
```
|
|
89
93
|
|
|
90
|
-
Or inline for a single
|
|
94
|
+
Or inline for a single run:
|
|
91
95
|
|
|
92
96
|
```bash
|
|
93
97
|
THINKNCOLLAB_SERVER=https://thinkncollab.com thinknsh
|
|
94
98
|
```
|
|
95
99
|
|
|
100
|
+
Session credentials are saved to `~/.thinkncollab/session.json` and are automatically restored on the next launch — you only need to `login` once.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Environment Variables
|
|
105
|
+
|
|
106
|
+
| Variable | Default | Description |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `THINKNCOLLAB_SERVER` | `https://thinkncollab.com` | Base URL for both REST and WebSocket |
|
|
109
|
+
| `THINKNCOLLAB_API_URL` | `https://thinkncollab.com` | REST API base URL (overrides SERVER for API calls) |
|
|
110
|
+
| `THINKNCOLLAB_WS_URL` | `https://thinkncollab.com` | WebSocket server URL |
|
|
111
|
+
| `THINKNCOLLAB_AUTO_CONNECT` | `false` | Set to `true` to auto-connect WebSocket on shell start |
|
|
112
|
+
| `THINKNSH_NOTIFY_PORT` | auto-assigned | TCP port for the notification window (set automatically) |
|
|
113
|
+
|
|
114
|
+
In production all three URL variables typically point to the same host:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
export THINKNCOLLAB_SERVER=https://thinkncollab.com
|
|
118
|
+
export THINKNCOLLAB_API_URL=https://thinkncollab.com
|
|
119
|
+
export THINKNCOLLAB_WS_URL=https://thinkncollab.com
|
|
120
|
+
export THINKNCOLLAB_AUTO_CONNECT=true
|
|
121
|
+
```
|
|
122
|
+
|
|
96
123
|
---
|
|
97
124
|
|
|
98
125
|
## CLI Flags
|
|
99
126
|
|
|
100
|
-
These flags are used **before** entering the interactive shell
|
|
127
|
+
These flags are used **before** entering the interactive shell.
|
|
101
128
|
|
|
102
129
|
| Flag | Alias | Description |
|
|
103
|
-
|
|
104
|
-
| `--help` | `-h` | Show help
|
|
105
|
-
| `--version` | `-v` | Print
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `--help` | `-h` | Show help and exit |
|
|
132
|
+
| `--version` | `-v` | Print installed version and exit |
|
|
106
133
|
|
|
107
134
|
```bash
|
|
108
135
|
thinknsh --help
|
|
@@ -113,22 +140,30 @@ thinknsh --version
|
|
|
113
140
|
|
|
114
141
|
## Interactive Shell
|
|
115
142
|
|
|
116
|
-
Running `thinknsh` with no arguments starts the
|
|
143
|
+
Running `thinknsh` with no arguments starts the interactive shell. A notification window opens automatically in a new terminal (on macOS, Windows, and most Linux DEs).
|
|
117
144
|
|
|
118
145
|
```
|
|
119
146
|
$ thinknsh
|
|
120
147
|
|
|
121
|
-
████████╗██╗ ██╗██╗███╗ ██╗██╗ ██╗███╗ ██╗
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
148
|
+
████████╗██╗ ██╗██╗███╗ ██╗██╗ ██╗███╗ ██╗ ...
|
|
149
|
+
╔══════════════════════════════════════════════════════╗
|
|
150
|
+
║ ThinkNCollab Shell v0.0.5 ║
|
|
151
|
+
║ Type 'help' for commands ║
|
|
152
|
+
╚══════════════════════════════════════════════════════╝
|
|
153
|
+
|
|
154
|
+
Notification server ready on port 7379
|
|
155
|
+
Notification window opening...
|
|
127
156
|
|
|
128
|
-
thinknsh
|
|
157
|
+
username@thinknsh:~ $
|
|
129
158
|
```
|
|
130
159
|
|
|
131
|
-
|
|
160
|
+
The prompt shows your current room and connection state:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
[room-abc123] ● username@thinknsh:~/projects $
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Type `help` at any time to list all available commands.
|
|
132
167
|
|
|
133
168
|
---
|
|
134
169
|
|
|
@@ -137,117 +172,190 @@ Type `help` inside the shell to list all available commands at any time.
|
|
|
137
172
|
### Auth Commands
|
|
138
173
|
|
|
139
174
|
#### `login`
|
|
140
|
-
Authenticate with your ThinkNCollab account.
|
|
175
|
+
Authenticate interactively with your ThinkNCollab account. Credentials are saved and restored automatically on subsequent launches.
|
|
141
176
|
|
|
142
|
-
```
|
|
177
|
+
```
|
|
143
178
|
thinknsh> login
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
179
|
+
Email : you@example.com
|
|
180
|
+
Password: ********
|
|
181
|
+
✅ Logged in as You
|
|
147
182
|
```
|
|
148
183
|
|
|
149
184
|
#### `logout`
|
|
150
|
-
End
|
|
185
|
+
End the current session and clear saved credentials.
|
|
151
186
|
|
|
152
|
-
```
|
|
187
|
+
```
|
|
153
188
|
thinknsh> logout
|
|
154
|
-
|
|
189
|
+
✅ Logged out successfully
|
|
155
190
|
```
|
|
156
191
|
|
|
157
192
|
#### `whoami`
|
|
158
|
-
Display
|
|
193
|
+
Display the currently authenticated user.
|
|
159
194
|
|
|
160
|
-
```
|
|
195
|
+
```
|
|
161
196
|
thinknsh> whoami
|
|
162
|
-
|
|
163
|
-
# 🏢 Team: ThinkNCollab Core
|
|
197
|
+
👤 Logged in as: Raman Singh (raman@thinkncollab.com)
|
|
164
198
|
```
|
|
165
199
|
|
|
166
200
|
---
|
|
167
201
|
|
|
168
|
-
###
|
|
202
|
+
### Room Commands
|
|
169
203
|
|
|
170
|
-
#### `
|
|
171
|
-
|
|
204
|
+
#### `join <room-id>`
|
|
205
|
+
Join a collaboration room. Establishes a WebSocket connection, loads the last 30 messages, and starts streaming live events.
|
|
172
206
|
|
|
173
|
-
```
|
|
174
|
-
thinknsh>
|
|
175
|
-
|
|
176
|
-
# 📋 Plan: Pro
|
|
177
|
-
# 👥 Members: 8
|
|
207
|
+
```
|
|
208
|
+
thinknsh> join room-abc123
|
|
209
|
+
✅ Joined: My Project Room
|
|
178
210
|
```
|
|
179
211
|
|
|
180
|
-
#### `
|
|
181
|
-
|
|
212
|
+
#### `leave`
|
|
213
|
+
Leave the current room and disconnect from its event stream.
|
|
182
214
|
|
|
183
|
-
```
|
|
184
|
-
thinknsh>
|
|
185
|
-
# 👥 Team Members:
|
|
186
|
-
# 🟢 Raman Singh (you)
|
|
187
|
-
# 🟢 Omkar Yadav
|
|
188
|
-
# 🔴 Radhika Chauhan (offline)
|
|
189
|
-
# 🟡 -------------- (away)
|
|
215
|
+
```
|
|
216
|
+
thinknsh> leave
|
|
190
217
|
```
|
|
191
218
|
|
|
192
|
-
#### `
|
|
193
|
-
|
|
219
|
+
#### `rooms`
|
|
220
|
+
List all rooms you have access to.
|
|
194
221
|
|
|
195
|
-
```
|
|
196
|
-
thinknsh>
|
|
197
|
-
|
|
222
|
+
```
|
|
223
|
+
thinknsh> rooms
|
|
224
|
+
[1] frontend-team (ID: room-abc123) 👥 4 members
|
|
225
|
+
[2] backend-infra (ID: room-def456) 👥 2 members
|
|
198
226
|
```
|
|
199
227
|
|
|
200
228
|
---
|
|
201
229
|
|
|
202
|
-
###
|
|
230
|
+
### Message Commands
|
|
203
231
|
|
|
204
|
-
#### `
|
|
205
|
-
|
|
232
|
+
#### `say <message>` / `msg <message>`
|
|
233
|
+
Send a message to the room you are currently in. No quotes needed for multi-word messages.
|
|
206
234
|
|
|
207
|
-
```
|
|
208
|
-
thinknsh>
|
|
209
|
-
# 🚪 Joined room: room-abc123
|
|
210
|
-
# 👥 Members online: 3
|
|
211
|
-
# 📜 Recent activity loaded
|
|
235
|
+
```
|
|
236
|
+
thinknsh> say PR is up for review — branch feature/auth-fix
|
|
212
237
|
```
|
|
213
238
|
|
|
214
|
-
|
|
239
|
+
---
|
|
215
240
|
|
|
216
|
-
|
|
217
|
-
|
|
241
|
+
### Task Commands
|
|
242
|
+
|
|
243
|
+
These commands require you to be logged in and in a room. They emit real-time events to all room members and update the [Shell Users presence page](https://thinkncollab.com) instantly.
|
|
244
|
+
|
|
245
|
+
#### `task list`
|
|
246
|
+
Show tasks assigned to you in the current room.
|
|
218
247
|
|
|
219
|
-
```
|
|
220
|
-
thinknsh>
|
|
221
|
-
|
|
248
|
+
```
|
|
249
|
+
thinknsh> task list
|
|
250
|
+
[1] Fix login redirect bug — high · pending
|
|
251
|
+
[2] Write API documentation — medium · in-progress
|
|
252
|
+
[3] Review onboarding flow — low · pending
|
|
222
253
|
```
|
|
223
254
|
|
|
224
|
-
#### `
|
|
225
|
-
|
|
255
|
+
#### `task accept <task-id>`
|
|
256
|
+
Mark a task as accepted. Emits a `task:accepted` event to the room — teammates see it live on the board.
|
|
226
257
|
|
|
227
|
-
```
|
|
228
|
-
thinknsh>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
258
|
+
```
|
|
259
|
+
thinknsh> task accept 64f1a2b3c4d5e6f7a8b9c0d1
|
|
260
|
+
✅ Task accepted: Fix login redirect bug
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### `task start <task-id>`
|
|
264
|
+
Mark a task as in-progress and broadcast a `task:started` event. Your active task appears on the Shell Users presence page for all teammates to see.
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
thinknsh> task start 64f1a2b3c4d5e6f7a8b9c0d1
|
|
268
|
+
▶ Started: Fix login redirect bug
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### `task complete <task-id>`
|
|
272
|
+
Mark a task as completed. Emits `task:completed` — the card on the board animates green for all viewers and your active task slot clears on the presence page.
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
thinknsh> task complete 64f1a2b3c4d5e6f7a8b9c0d1
|
|
276
|
+
✓ Completed: Fix login redirect bug
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### `task reject <task-id>`
|
|
280
|
+
Reject a task assignment. Emits `task:rejected` to the room.
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
thinknsh> task reject 64f1a2b3c4d5e6f7a8b9c0d1
|
|
284
|
+
✕ Rejected: Fix login redirect bug
|
|
233
285
|
```
|
|
234
286
|
|
|
235
287
|
---
|
|
236
288
|
|
|
237
|
-
###
|
|
289
|
+
### Terminal Share Commands
|
|
238
290
|
|
|
239
|
-
|
|
240
|
-
|
|
291
|
+
Terminal sharing lets you stream your live shell session to teammates. Viewers watch in real time; you can optionally grant write access to specific users.
|
|
292
|
+
|
|
293
|
+
#### `share start`
|
|
294
|
+
Start sharing your terminal in the current room. A session ID is created and room members are notified.
|
|
241
295
|
|
|
242
|
-
```
|
|
243
|
-
thinknsh>
|
|
244
|
-
|
|
296
|
+
```
|
|
297
|
+
thinknsh> share start
|
|
298
|
+
📺 Terminal share started
|
|
299
|
+
Session : ts-7x9k2m
|
|
300
|
+
Room : frontend-team
|
|
245
301
|
```
|
|
246
302
|
|
|
247
|
-
|
|
303
|
+
#### `share stop`
|
|
304
|
+
End the current sharing session. All viewers are disconnected.
|
|
248
305
|
|
|
249
|
-
```
|
|
250
|
-
thinknsh>
|
|
306
|
+
```
|
|
307
|
+
thinknsh> share stop
|
|
308
|
+
📺 Terminal share ended
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### `share grant <user-id>`
|
|
312
|
+
Grant write access to a viewer. They can now send input to your shell.
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
thinknsh> share grant 64f1a2b3c4d5e6f7a8b9c0d1
|
|
316
|
+
✍️ Write access granted
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
#### `share revoke <user-id>`
|
|
320
|
+
Revoke write access from a user (they remain a read-only viewer).
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
thinknsh> share revoke 64f1a2b3c4d5e6f7a8b9c0d1
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### `share kick <user-id>`
|
|
327
|
+
Remove a viewer from the session entirely.
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
thinknsh> share kick 64f1a2b3c4d5e6f7a8b9c0d1
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
#### `share status`
|
|
334
|
+
List current viewers and which ones have write access.
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
thinknsh> share status
|
|
338
|
+
Viewers : 2
|
|
339
|
+
👁 Priya Sharma (read-only)
|
|
340
|
+
✍ Alex Kumar (write)
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### Notification Commands
|
|
346
|
+
|
|
347
|
+
#### `notify <message>`
|
|
348
|
+
Send a push notification to all other members in the current room. The message appears in their notification feed instantly.
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
thinknsh> notify Staging deploy complete — please re-test
|
|
352
|
+
📢 Notification sent to 3 member(s)
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Supports optional type and title:
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
thinknsh> notify type=task_progress title="Build Done" All tests passing
|
|
251
359
|
```
|
|
252
360
|
|
|
253
361
|
---
|
|
@@ -255,148 +363,183 @@ thinknsh> say Pushing the hotfix now, give me 5 minutes
|
|
|
255
363
|
### Shell Commands
|
|
256
364
|
|
|
257
365
|
#### `status`
|
|
258
|
-
Show a full overview of your
|
|
366
|
+
Show a full overview of your session.
|
|
259
367
|
|
|
260
|
-
```
|
|
368
|
+
```
|
|
261
369
|
thinknsh> status
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
# Server : https://app.thinkncollab.com
|
|
268
|
-
# WebSocket : ✅ Connected
|
|
269
|
-
# Active Room: frontend-team (room-abc123)
|
|
270
|
-
# Version : 1.2.0
|
|
271
|
-
# ──────────────────────────────────────
|
|
370
|
+
WebSocket : ✓ Connected
|
|
371
|
+
Socket ID : abc123...
|
|
372
|
+
Room : frontend-team
|
|
373
|
+
Auth : ✓ Logged in
|
|
374
|
+
User : Raman Singh
|
|
272
375
|
```
|
|
273
376
|
|
|
274
377
|
#### `help`
|
|
275
|
-
List all registered commands grouped by category
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
thinknsh> help
|
|
279
|
-
```
|
|
378
|
+
List all registered commands grouped by category.
|
|
280
379
|
|
|
281
380
|
#### `clear`
|
|
282
381
|
Clear the terminal screen.
|
|
283
382
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
```
|
|
383
|
+
#### `cd <path>`
|
|
384
|
+
Change the working directory. Supports `~`, `..`, absolute and relative paths.
|
|
287
385
|
|
|
288
|
-
#### `
|
|
289
|
-
|
|
386
|
+
#### `ls [-a]`
|
|
387
|
+
List files in the current directory. Pass `-a` to include hidden files.
|
|
290
388
|
|
|
291
|
-
|
|
292
|
-
|
|
389
|
+
#### `pwd`
|
|
390
|
+
Print the current working directory.
|
|
391
|
+
|
|
392
|
+
#### `history`
|
|
393
|
+
Show the full command history for this session.
|
|
394
|
+
|
|
395
|
+
#### `set [key value]`
|
|
396
|
+
Set a shell variable. Run with no arguments to list all variables.
|
|
397
|
+
|
|
398
|
+
```
|
|
399
|
+
thinknsh> set ROOM room-abc123
|
|
400
|
+
thinknsh> join $ROOM
|
|
293
401
|
```
|
|
294
402
|
|
|
403
|
+
#### `unset <key>`
|
|
404
|
+
Delete a shell variable.
|
|
405
|
+
|
|
406
|
+
#### `connect` / `disconnect`
|
|
407
|
+
Manually connect or disconnect the WebSocket.
|
|
408
|
+
|
|
409
|
+
#### `exit` / `quit`
|
|
410
|
+
Exit the shell gracefully (saves history, closes TCP notification server, disconnects WebSocket).
|
|
411
|
+
|
|
295
412
|
---
|
|
296
413
|
|
|
297
|
-
##
|
|
414
|
+
## `.tncproject` Auto-Boot
|
|
298
415
|
|
|
299
|
-
|
|
416
|
+
Place a `.tncproject` file in your project root to auto-login and auto-join a room when `thinknsh` starts in that directory — no manual `login` or `join` needed.
|
|
300
417
|
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
thinknsh whoami
|
|
304
|
-
thinknsh join room-abc123
|
|
305
|
-
thinknsh say "Deployment complete ✅"
|
|
306
|
-
thinknsh rooms
|
|
418
|
+
```
|
|
419
|
+
.tncproject
|
|
307
420
|
```
|
|
308
421
|
|
|
309
|
-
|
|
422
|
+
On startup the shell sends the encrypted config to the server, receives a shell token, saves the session, connects WebSocket, and joins the project room automatically:
|
|
310
423
|
|
|
311
|
-
```bash
|
|
312
|
-
thinknsh say Build passed. Deploying to staging now.
|
|
313
|
-
thinknsh invite contractor@example.com
|
|
314
424
|
```
|
|
425
|
+
📄 tncproject found
|
|
426
|
+
Room : room-abc123
|
|
427
|
+
File : /home/user/myproject/.tncproject
|
|
428
|
+
|
|
429
|
+
✅ Raman Singh → room "My Project Room"
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
If `.tncproject` auth fails, the shell falls back to manual login.
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Notification Window
|
|
437
|
+
|
|
438
|
+
When `thinknsh` starts it launches a background TCP notification server on an auto-assigned port (default start: `7379`) and opens a second terminal window to display live events — messages, task updates, user joins/leaves — without interrupting your main shell prompt.
|
|
439
|
+
|
|
440
|
+
On **VS Code** (Windows) the notification window cannot be auto-spawned. The shell prints the command to run it manually:
|
|
441
|
+
|
|
442
|
+
```
|
|
443
|
+
VS Code detected — open a new terminal tab and run:
|
|
444
|
+
$env:THINKNSH_NOTIFY_PORT=7379; node "path/to/notification-window.js"
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
On **macOS** it opens in a new Terminal.app window. On **Linux** it tries `gnome-terminal`, `xterm`, and `konsole` in order.
|
|
315
448
|
|
|
316
449
|
---
|
|
317
450
|
|
|
318
451
|
## Built-in Shell Features
|
|
319
452
|
|
|
320
|
-
###
|
|
321
|
-
|
|
453
|
+
### Persistent History
|
|
454
|
+
Command history is saved to `~/.thinknsh_history` (up to 1000 entries) and restored on every launch. Use **Up/Down arrows** to navigate.
|
|
322
455
|
|
|
323
|
-
###
|
|
324
|
-
|
|
456
|
+
### Session Persistence
|
|
457
|
+
After `login`, your session token is saved to `~/.thinkncollab/session.json`. The next time you start `thinknsh` you are already authenticated — no password prompt.
|
|
325
458
|
|
|
459
|
+
### Shell Variables
|
|
326
460
|
```bash
|
|
327
|
-
thinknsh>
|
|
328
|
-
thinknsh>
|
|
461
|
+
thinknsh> set ROOM room-abc123
|
|
462
|
+
thinknsh> join $ROOM
|
|
329
463
|
```
|
|
330
464
|
|
|
331
|
-
###
|
|
332
|
-
|
|
465
|
+
### Aliases
|
|
466
|
+
Built-in aliases: `ll` → `ls -la`, `..` → `cd ..`, `~` → `cd ~`.
|
|
467
|
+
|
|
468
|
+
### System Shell Passthrough
|
|
469
|
+
Any command that is not a `thinknsh` built-in runs directly in your system shell (`bash` / `cmd.exe`):
|
|
333
470
|
|
|
334
471
|
```bash
|
|
335
|
-
thinknsh>
|
|
336
|
-
thinknsh>
|
|
472
|
+
thinknsh> git status
|
|
473
|
+
thinknsh> npm install
|
|
474
|
+
thinknsh> python manage.py migrate
|
|
337
475
|
```
|
|
338
476
|
|
|
339
|
-
|
|
340
|
-
Press `Tab` to autocomplete commands and room names.
|
|
477
|
+
> **Note:** On Windows, `open`, `which`, `grep`, `touch`, and `cat` are blocked (not available in cmd.exe) — use Windows equivalents or WSL.
|
|
341
478
|
|
|
342
|
-
###
|
|
343
|
-
|
|
479
|
+
### Quote Parsing
|
|
480
|
+
Single and double quotes are supported for arguments with spaces:
|
|
344
481
|
|
|
345
482
|
```bash
|
|
346
|
-
thinknsh
|
|
483
|
+
thinknsh> say "Deployment done — all green ✅"
|
|
484
|
+
thinknsh> notify "title=Release v2.1" Pushed to prod
|
|
347
485
|
```
|
|
348
486
|
|
|
349
487
|
---
|
|
350
488
|
|
|
351
|
-
##
|
|
489
|
+
## Single-Command Mode
|
|
490
|
+
|
|
491
|
+
Run any command as a one-liner without entering the interactive shell:
|
|
352
492
|
|
|
353
493
|
```bash
|
|
354
|
-
|
|
494
|
+
thinknsh status
|
|
355
495
|
thinknsh whoami
|
|
356
|
-
|
|
357
|
-
# See all your rooms, then join one
|
|
358
496
|
thinknsh rooms
|
|
359
497
|
thinknsh join room-abc123
|
|
498
|
+
thinknsh say "Deployment complete ✅"
|
|
499
|
+
thinknsh task list
|
|
500
|
+
thinknsh notify "All tests passing"
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Chain with `&&` for scripting:
|
|
360
504
|
|
|
361
|
-
|
|
362
|
-
thinknsh
|
|
505
|
+
```bash
|
|
506
|
+
thinknsh login && thinknsh join room-abc123 && thinknsh say "I'm online"
|
|
507
|
+
```
|
|
363
508
|
|
|
364
|
-
|
|
365
|
-
thinknsh invite dev@company.com
|
|
509
|
+
---
|
|
366
510
|
|
|
511
|
+
## Examples
|
|
512
|
+
|
|
513
|
+
```bash
|
|
367
514
|
# Full interactive session
|
|
368
515
|
thinknsh
|
|
369
516
|
thinknsh> login
|
|
370
517
|
thinknsh> rooms
|
|
371
|
-
thinknsh> join
|
|
518
|
+
thinknsh> join room-abc123
|
|
372
519
|
thinknsh> say Good morning everyone 🚀
|
|
373
|
-
thinknsh>
|
|
520
|
+
thinknsh> task list
|
|
521
|
+
thinknsh> task accept 64f1a...
|
|
522
|
+
thinknsh> task start 64f1a...
|
|
523
|
+
thinknsh> task complete 64f1a...
|
|
524
|
+
thinknsh> share start
|
|
525
|
+
thinknsh> share grant 64f2b...
|
|
526
|
+
thinknsh> share stop
|
|
527
|
+
thinknsh> notify "Daily standup in 5 mins"
|
|
374
528
|
thinknsh> status
|
|
375
529
|
thinknsh> exit
|
|
376
|
-
```
|
|
377
530
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
531
|
+
# .tncproject auto-boot (no login needed)
|
|
532
|
+
cd ~/myproject # contains .tncproject
|
|
533
|
+
thinknsh # auto-logs in + auto-joins room
|
|
381
534
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
| `THINKNCOLLAB_WS_URL` | `https://thinkncollab.com` | WebSocket server URL |
|
|
387
|
-
| `THINKNCOLLAB_AUTO_CONNECT` | `false` | Set to `true` to auto-connect WebSocket on shell start |
|
|
388
|
-
|
|
389
|
-
In production, all three URL variables typically point to the same host:
|
|
390
|
-
|
|
391
|
-
```bash
|
|
392
|
-
export THINKNCOLLAB_SERVER=https://app.thinkncollab.com
|
|
393
|
-
export THINKNCOLLAB_API_URL=https://app.thinkncollab.com
|
|
394
|
-
export THINKNCOLLAB_WS_URL=https://app.thinkncollab.com
|
|
395
|
-
export THINKNCOLLAB_AUTO_CONNECT=true
|
|
535
|
+
# Quick one-liners from CI / scripts
|
|
536
|
+
thinknsh say "Build #142 passed ✅"
|
|
537
|
+
thinknsh notify "Hotfix deployed to production"
|
|
538
|
+
thinknsh task complete $TASK_ID
|
|
396
539
|
```
|
|
397
540
|
|
|
398
541
|
---
|
|
399
542
|
|
|
400
543
|
## License
|
|
401
544
|
|
|
402
|
-
|
|
545
|
+
© ThinkNCollab
|