termdeck-cli 2.0.4 โ†’ 2.0.6

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 CHANGED
@@ -1,30 +1,13 @@
1
1
  <div align="center">
2
2
 
3
- # ๐Ÿ–ฅ๏ธ termdeck
3
+ # ๐Ÿ–ฅ๏ธ termdeck โ€” Terminal Project Control Dashboard
4
4
 
5
- **A beautiful, terminal-based project dashboard to manage your local dev environments, services, and AI coding agents.**
5
+ **A beautiful, multi-pane TUI dashboard for managing your local development projects.**
6
6
 
7
- [![npm version](https://img.shields.io/npm/v/termdeck.svg)](https://www.npmjs.com/package/termdeck)
8
- [![license](https://img.shields.io/npm/l/termdeck.svg)](https://github.com/barigalasunil/termdeck/blob/main/LICENSE)
7
+ Auto-discovery ยท dev-server management ยท AI coding agents ยท real-time monitoring โ€” all in one terminal.
9
8
 
10
- ```
11
- +----------------------------------------------------------------------+
12
- | termdeck 14 projects ยท ~/dev/projects โ— 2 dev servers running |
13
- +------------------------+---------------------------------------------+
14
- | projects | selected project |
15
- | โ— api [live] | alpha โ— live |
16
- | โ— alpha [live] | ~/dev/projects/alpha main ยท 8a2f1 (2d ago)|
17
- | โ—‹ blog [exp] | marketing site |
18
- | โ—‹ lab [scrap] | โ— dev server running (pid 8123) โ†’ localhost |
19
- | | cpu 3.2% ยท mem 214MB |
20
- +------------------------+---------------------------------------------+
21
- | dev [r] status [s] search [/] ... |
22
- +------------------------+---------------------------------------------+
23
- | dev server logs |
24
- | 12:04:11 alpha [termdeck] $npm run dev |
25
- | 12:04:12 alpha โžœ Local: http://localhost:5173 |
26
- +----------------------------------------------------------------------+
27
- ```
9
+ [![npm version](https://img.shields.io/npm/v/termdeck-cli.svg)](https://www.npmjs.com/package/termdeck-cli)
10
+ [![license](https://img.shields.io/npm/l/termdeck-cli.svg)](https://github.com/barigalasunil/termdeck/blob/main/LICENSE)
28
11
 
29
12
  </div>
30
13
 
@@ -32,216 +15,178 @@
32
15
 
33
16
  ## โœจ Features
34
17
 
35
- - ๐ŸŽฏ **Centralized Dashboard** โ€” See every project, its status (live, exp, pend, scrap), git state (branch, last commit), current process stats, and dev server state in one place.
36
- - โšก **In-Terminal Dev Servers** โ€” Run `npm run dev` and stream the logs inside the dashboard. Auto-opens the browser. **Crash recovery** restarts a dead server up to 3 times.
37
- - ๐Ÿš€ **One-Click External Tools** โ€” Launch your editor or an AI coding agent (claude, codex, opencode, freebuff, kilocode) in a new terminal window, with agent logs tailed back into the dashboard.
38
- - ๐Ÿ”Ž **Live Search & Filtering** โ€” Type `/` to search projects by name; press `1`โ€“`5` to filter by status chip.
39
- - ๏ธ **Mouse & Keyboard Support** โ€” Fully navigable with mouse clicks, Tab/Shift+Tab focus cycling, and keyboard shortcuts.
40
- - ๐Ÿ’พ **Persistent, Self-Healing Config** โ€” Interactive first-run setup saves `~/.termdeck-config.json`; the `--scan` wizard merges new projects without losing your custom agent configs.
18
+ - ๐ŸŽฏ **Auto-Discovery** โ€” Every launch quietly re-scans your root directory and adds any new folder that contains a `.git` directory or `package.json`, as a pending project. No manual bookkeeping.
19
+ - ๐Ÿงฉ **3-Pane Layout** โ€” Projects list on the left; Details + Actions (git state, port, status, agent buttons) top-right; and a live Output log pane bottom-right. Hand-positioned with zero gaps.
20
+ - โšก **Dev Server Management** โ€” Run the project's dev command (`npm` / `pnpm` / `yarn run dev`) right inside the TUI, stream its logs, auto-open the browser, and **auto-restart** a crashed server up to 3 times.
21
+ - ๐Ÿค– **AI Agent Integration** โ€” Launch 5 coding agents in a fresh terminal window โ€” Claude Code, Codex, OpenCode, Freebuff and Kilocode โ€” with their output tailed back into the Output pane.
22
+ - ๐Ÿ“Š **Real-Time Monitoring** โ€” Live PID, CPU % and memory for the selected project's running process.
23
+ - ๐ŸŒฟ **Git Integration** โ€” Shows the current branch, last commit hash, and dirty state (`+X, -Y`).
24
+ - ๐Ÿท๏ธ **Status Management** โ€” Organize projects as **live**, **exp** (experimental), **pend**, or **scrap**.
25
+ - ๐Ÿ”„ **Auto-Update** โ€” A background npm check (capped at ~2s) installs the latest version on launch. Disable with `--no-update`.
26
+ - ๐Ÿ”Ž **Smart Filtering** โ€” Filter by status tabs (`1`โ€“`5`) or a regex search (`/`) over project names.
27
+ - ๐Ÿ•’ **12-Hour Timestamps** โ€” Every timestamp and log line uses AM/PM with dates, e.g. `Sep 21, 2026 3:30:59 PM`.
28
+ - ๐Ÿ’พ **Self-Healing Config** โ€” `~/.termdeck-config.json` is auto-saved and merged on re-scan, preserving your custom per-project overrides.
41
29
 
42
30
  ---
43
31
 
44
32
  ## ๐Ÿ“ฆ Installation
45
33
 
46
- ### Global Install (Recommended)
47
-
48
- ```bash
49
- npm install -g termdeck
50
- ```
51
-
52
- This installs the `termdeck` command anywhere.
53
-
54
- ### One-Off Run
55
-
56
34
  ```bash
57
- npx termdeck
35
+ npm install -g termdeck-cli
58
36
  ```
59
37
 
60
- > **Note:** Requires Node.js 16+ and a real terminal (macOS/Linux Terminal, Windows Terminal, iTerm, etc.). No Docker, no daemon, no background service.
38
+ > **Note:** the package is published as `termdeck-cli`, but the command you run is simply **`termdeck`**. Requires Node.js 16+ and a real terminal (Windows Terminal, iTerm, macOS/Linux Terminal, etc.).
61
39
 
62
- ### Auto-Updates
40
+ ---
63
41
 
64
- On every dashboard launch termdeck silently checks the npm registry for a newer version. When one exists it installs `termdeck@latest` in the background โ€” no confirmation, no restart. Offline, slow or unreachable registries are ignored: you simply keep running the installed version.
42
+ ## ๐Ÿš€ Quick Start
65
43
 
66
- Disable the check on an individual run with:
44
+ Just run:
67
45
 
68
46
  ```bash
69
- termdeck --no-update
47
+ termdeck
70
48
  ```
71
49
 
72
- ### Manual Upgrade
50
+ On first launch termdeck starts an interactive setup wizard:
73
51
 
74
- ```bash
75
- npm update -g termdeck
76
- # or, to force the very latest release:
77
- npm install -g termdeck@latest
78
- ```
52
+ 1. **Pick your projects directory** โ€” it scans that folder for any subfolder containing `.git` or `package.json`.
53
+ 2. **Multi-select the folders** that are real projects (<kbd>Space</kbd> to toggle, <kbd>Enter</kbd> to confirm).
54
+ 3. **Set the status** for each project โ€” `live`, `exp`, `pend`, or `scrap` (default `exp`).
79
55
 
80
- ### Check the Installed Version
81
-
82
- ```bash
83
- termdeck --version
84
- # or inspect the global install directly
85
- npm list -g termdeck
86
- ```
56
+ The package manager (`npm` / `pnpm` / `yarn`) is **auto-detected** from the lockfiles and the default dev port is **auto-assigned** to `3000` โ€” so status is the only thing you need to set. Every later launch skips straight to the dashboard.
87
57
 
88
58
  ---
89
59
 
90
- ## ๐Ÿ—‘๏ธ Uninstall
91
-
92
- To completely remove termdeck from your system:
60
+ ## โŒจ๏ธ Usage
93
61
 
94
62
  ```bash
95
- npm uninstall -g termdeck
63
+ termdeck # Launch dashboard
64
+ termdeck --scan # Run interactive project scanner (merge new projects)
65
+ termdeck --demo # Launch with 14 bundled sample projects
66
+ termdeck --no-update # Disable auto-update for this session
67
+ termdeck --reset # Delete config and start fresh
96
68
  ```
97
69
 
98
- This removes the global package and the `termdeck` command.
99
- Your project configuration at `~/.termdeck-config.json` is preserved.
100
- To delete the config file as well:
101
-
102
- ```bash
103
- # macOS/Linux
104
- rm ~/.termdeck-config.json
70
+ ### Other flags
105
71
 
106
- # Windows PowerShell
107
- Remove-Item ~\.termdeck-config.json
108
- ```
72
+ | Flag | Description |
73
+ | --- | --- |
74
+ | `--setup` | Re-run the setup wizard manually |
75
+ | `--list` | Print configured projects as a table and exit (no TUI) |
76
+ | `--no-auto-restart` | Disable dev-server crash recovery for this session |
77
+ | `--no-open` | Do not auto-open the browser when a dev server starts |
109
78
 
110
79
  ---
111
80
 
112
- ## ๐Ÿš€ First Run & Configuration
113
-
114
- On first launch termdeck detects that no `~/.termdeck-config.json` exists and runs an interactive setup wizard:
115
-
116
- 1. **Which directory holds your projects?** โ€” Pick from suggestions (common folders like `~/Projects`, `~/dev`, plus every drive letter on Windows) or type a path.
117
- 2. **Which folders are projects?** โ€” termdeck scans the directory and shows only folders that contain a `.git` directory or a `package.json` manifest. Multi-select with <kbd>Space</kbd>, confirm with <kbd>Enter</kbd>.
118
- 3. **Per-project details** โ€” For each project you pick, termdeck asks its status (`live`, `exp`, `pend` or `scrap`, default `exp`), the dev-server port (default `3000`) and the package manager (`npm`, `pnpm` or `yarn` โ€” auto-detected from `pnpm-lock.yaml` / `yarn.lock`).
81
+ ## โŒจ๏ธ Keyboard Shortcuts
119
82
 
120
- Every later launch skips straight to the dashboard.
121
-
122
- > **Tip:** You can manually edit `~/.termdeck-config.json` if needed. Press <kbd>r</kbd> in the dashboard to reload.
83
+ | Key | Action |
84
+ | --- | --- |
85
+ | <kbd>โ†‘</kbd> / <kbd>โ†“</kbd> (or <kbd>j</kbd> / <kbd>k</kbd>) | Navigate projects |
86
+ | <kbd>Tab</kbd> / <kbd>Shift</kbd>+<kbd>Tab</kbd> | Switch focus between panes (Projects โ†’ Actions โ†’ Output) |
87
+ | <kbd>Enter</kbd> / <kbd>Space</kbd> | Activate the focused button |
88
+ | <kbd>r</kbd> (or <kbd>d</kbd>) | Run the dev server |
89
+ | <kbd>e</kbd> | Open the project in VS Code |
90
+ | <kbd>c</kbd> | Launch Claude Code |
91
+ | <kbd>x</kbd> | Launch Codex |
92
+ | <kbd>o</kbd> | Launch OpenCode |
93
+ | <kbd>f</kbd> | Launch Freebuff |
94
+ | <kbd>k</kbd> | Launch Kilocode |
95
+ | <kbd>s</kbd> | Change project status |
96
+ | <kbd>/</kbd> | Focus search bar (regex) |
97
+ | <kbd>1</kbd>โ€“<kbd>5</kbd> | Filter by status tab: all / live / exp / pend / scrap |
98
+ | <kbd>Shift</kbd>+<kbd>X</kbd> | Stop the dev server |
99
+ | <kbd>PgUp</kbd> / <kbd>PgDn</kbd>, mouse wheel | Scroll live output (<kbd>g</kbd> to follow the tail again) |
100
+ | <kbd>q</kbd> | Quit (stops every dev server it started) |
123
101
 
124
102
  ---
125
103
 
126
- ## โŒจ๏ธ Usage & Controls
104
+ ## ๐Ÿค– AI Agents
127
105
 
128
- ### CLI Flags
106
+ Each agent opens in a new terminal window inside the selected project's folder:
129
107
 
130
- | Command | What it does |
131
- | --- | --- |
132
- | `termdeck` | Launch the dashboard using the existing config (first run starts the wizard). |
133
- | `termdeck --demo` | Launch with 14 sample projects (great for trying it out). |
134
- | `termdeck --scan` | Re-run the interactive scanner: adds/updates projects in the config, merging with existing entries and preserving custom agent configs. |
135
- | `termdeck --no-auto-restart` | Disable dev-server crash recovery for this session only. |
136
- | `termdeck --reset` | Delete the config file and force a fresh first-run setup on the next launch. |
137
- | `termdeck --no-update` | Disable the background auto-updater. |
138
- | `termdeck --setup` | Re-run the setup wizard manually. |
139
- | `termdeck --list` | Print the configured projects as a table and exit (no TUI). |
140
- | `termdeck --no-open` | Do not auto-open the browser when a dev server starts. |
141
-
142
- ### Keyboard Shortcuts
143
-
144
- | Key | Action |
108
+ | Hotkey | Agent |
145
109
  | --- | --- |
146
- | <kbd>โ†‘</kbd> / <kbd>โ†“</kbd> or <kbd>j</kbd> / <kbd>k</kbd> | Navigate projects |
147
- | <kbd>Tab</kbd> / <kbd>Shift</kbd>+<kbd>Tab</kbd> | Cycle focus: project list โ†’ actions โ†’ output |
148
- | <kbd>Enter</kbd> or <kbd>Space</kbd> | Activate the focused button |
149
- | <kbd>r</kbd> / <kbd>d</kbd> | Run `npm run dev` for the selected project |
150
- | <kbd>e</kbd> | Open the project in your editor in a new terminal |
151
- | <kbd>c</kbd> | Open Claude in a new terminal |
152
- | <kbd>x</kbd> | Open Codex in a new terminal |
153
- | <kbd>o</kbd> | Open opencode in a new terminal |
154
- | <kbd>f</kbd> | Open freebuff in a new terminal |
155
- | <kbd>k</kbd> | Open kilocode in a new terminal |
156
- | <kbd>s</kbd> | Cycle the selected project's status |
157
- | <kbd>/</kbd> | Search projects by name (Enter commits, Esc cancels) |
158
- | <kbd>1</kbd>โ€“<kbd>5</kbd> | Filter by status chip: all / live / exp / pend / scrap |
159
- | <kbd>Shift</kbd>+<kbd>X</kbd> | Stop the selected project's dev server |
160
- | <kbd>PgUp</kbd>/<kbd>PgDn</kbd>, mouse wheel | Scroll the dev server logs (<kbd>g</kbd> to follow the tail again) |
161
- | <kbd>q</kbd> | Quit (stops every dev server it started) |
110
+ | <kbd>c</kbd> | Claude Code |
111
+ | <kbd>x</kbd> | Codex |
112
+ | <kbd>o</kbd> | OpenCode |
113
+ | <kbd>f</kbd> | Freebuff |
114
+ | <kbd>k</kbd> | Kilocode |
162
115
 
163
- > **Mouse Support:** All buttons and list items are fully clickable. Use the mouse wheel to scroll logs.
116
+ You can override any agent's command per project via the `agents` map in your config.
164
117
 
165
118
  ---
166
119
 
167
- ## โ“ FAQ
168
-
169
- **How do I disable auto-updates?**
170
- Pass `--no-update` when you launch the dashboard: `termdeck --no-update`. The npm registry is then never contacted and nothing is printed.
120
+ ## ๐Ÿ“ธ Screenshots
171
121
 
172
- **A dev server keeps restarting โ€” how do I stop that?**
173
- termdeck restarts a crashed dev server up to 3 times, then gives up and logs the failure. If you would rather not have any crash recovery for a session, launch with `termdeck --no-auto-restart`.
122
+ <!-- TODO: Add screenshot of the dashboard -->
174
123
 
175
- **Does my config get clobbered when I re-scan?**
176
- No. `termdeck --scan` (or the setup wizard on a machine that already has a config) merges: projects you didn't touch stay exactly as they are, projects you re-select get their new status/port/package manager, and hand-written per-project overrides such as custom agent commands are kept.
124
+ The UI is a **dark theme with green accents** (a green line-bordered masthead and green "live" indicators) laid out in a **3-pane layout showing projects, details, and live logs**.
177
125
 
178
126
  ---
179
127
 
180
- ## ๐Ÿ› ๏ธ Development & Contributing
128
+ ## โš™๏ธ Configuration
181
129
 
182
- ### Local Testing
130
+ termdeck stores everything in:
183
131
 
184
- ```bash
185
- git clone https://github.com/barigalasunil/termdeck.git
186
- cd termdeck
187
- npm install
188
- npm link # symlink into global node_modules
189
- termdeck # runs from anywhere with your edits live
190
132
  ```
191
-
192
- ### Running Tests
193
-
194
- ```bash
195
- npm test # unit + end-to-end dev server tests (64/64 passing โœ…)
196
- npm run smoke # headless TUI smoke test
133
+ ~/.termdeck-config.json
197
134
  ```
198
135
 
199
- The smoke test drives a headless blessed screen: it verifies the dashboard renders, the dev-server CTA starts a real fixture server and streams its logs into the log pane, and that stopping the server cleans up the child process.
136
+ - **Auto-saves** project paths, statuses, ports, and package managers.
137
+ - **Auto-discovers** new projects on every launch โ€” just create the folder in your root directory.
138
+ - Merges on re-scan: projects you did not touch stay exactly as they are, and hand-written overrides (custom agent/editor commands, etc.) are preserved.
139
+ - Override the location with the `TERMDECK_CONFIG` environment variable (handy for testing).
200
140
 
201
- ### Testing Auto-Updates
141
+ ---
202
142
 
203
- The updater reads its registry endpoint from `TERMDECK_REGISTRY_URL`, so you can point it at a local mock. In one terminal, serve a fake registry that always claims a newer version:
143
+ ## โ“ FAQ
204
144
 
205
- ```bash
206
- node -e "require('http').createServer((q,s)=>{s.setHeader('content-type','application/json');s.end(JSON.stringify({version:'9.9.9'}))}).listen(4873)"
207
- ```
145
+ **How do I add new projects?**
146
+ termdeck auto-discovers new folders on every launch. Just create the folder in your root directory.
208
147
 
209
- Then run termdeck with the mock enabled:
148
+ **How do I disable auto-updates?**
149
+ Use `termdeck --no-update`, or rely on the fact that the updater checks at most once per launch and silently skips offline/slow registries.
210
150
 
211
- ```bash
212
- # macOS/Linux
213
- TERMDECK_REGISTRY_URL=http://127.0.0.1:4873/termdeck/latest termdeck
151
+ **Can I change the root directory?**
152
+ Yes โ€” delete `~/.termdeck-config.json` and run `termdeck` to re-run the setup wizard.
214
153
 
215
- # Windows PowerShell
216
- $env:TERMDECK_REGISTRY_URL="http://127.0.0.1:4873/termdeck/latest"; termdeck
217
- ```
154
+ **A dev server keeps restarting โ€” how do I stop that?**
155
+ A crashed server is auto-restarted up to 3 times, then termdeck gives up and logs the failure. Launch with `termdeck --no-auto-restart` to disable crash recovery for a session.
218
156
 
219
- > The install always targets `@latest` on the **real** npm registry. Set the mock to your current version (e.g. `{"version":"2.0.0"}`) to exercise the "already up to date, no install" path, or use `--no-update` to skip the check entirely.
157
+ ---
220
158
 
221
- ### Releasing a Version
159
+ ## ๐Ÿ› ๏ธ Development
222
160
 
223
161
  ```bash
224
- npm version patch # 2.0.0 -> 2.0.1 (bug fixes)
225
- npm version minor # adds backwards-compatible features
226
- npm version major # breaking changes
227
- npm publish
162
+ git clone https://github.com/barigalasunil/termdeck.git
163
+ cd termdeck
164
+ npm install
165
+ npm link
166
+ termdeck
167
+ npm test # run the unit + integration test suite (70 tests)
168
+ npm run smoke # run the headless TUI integration test
228
169
  ```
229
170
 
230
- Publishing a higher version is what triggers the auto-update for everyone already running termdeck.
171
+ The smoke test drives a headless blessed screen: it verifies the dashboard renders, that the dev-server action starts a real fixture server and streams its logs into the Output pane, and that stopping the server cleans up the child process.
231
172
 
232
- ### Unlink When Done
173
+ ---
174
+
175
+ ## ๐Ÿ—‘๏ธ Uninstall
233
176
 
234
177
  ```bash
235
- npm unlink -g termdeck
178
+ npm uninstall -g termdeck-cli
236
179
  ```
237
180
 
238
- > **Tip:** Use `TERMDECK_CONFIG=./scratch-config.json termdeck` to test without touching your real config.
181
+ Your config at `~/.termdeck-config.json` is preserved; delete it manually if you want a clean slate.
239
182
 
240
183
  ---
241
184
 
242
185
  ## ๐Ÿ“„ License
243
186
 
244
- MIT
187
+ MIT License.
188
+
189
+ **Author:** Sunil ([@barigalasunil](https://github.com/barigalasunil)) ยท **GitHub:** <https://github.com/barigalasunil/termdeck>
245
190
 
246
191
  ---
247
192
 
@@ -249,6 +194,6 @@ MIT
249
194
 
250
195
  **Built with โค๏ธ by [Sunil](https://github.com/barigalasunil)**
251
196
 
252
- [GitHub](https://github.com/barigalasunil/termdeck) ยท [npm](https://www.npmjs.com/package/termdeck)
197
+ [GitHub](https://github.com/barigalasunil/termdeck) ยท [npm](https://www.npmjs.com/package/termdeck-cli)
253
198
 
254
- </div>
199
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termdeck-cli",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Terminal project control: a multi-pane TUI to manage your local dev projects โ€” dev servers, git state, process stats, and AI coding agents.",
5
5
  "keywords": [
6
6
  "cli",
@@ -203,8 +203,14 @@ function isTailing(project, agentName) {
203
203
  return tailing.has(tailKey(project, agentName));
204
204
  }
205
205
 
206
+ /** Number of agent log tails currently being streamed. */
207
+ function activeTails() {
208
+ return tailing.size;
209
+ }
210
+
206
211
  module.exports = {
207
212
  AGENT_COMMANDS,
213
+ activeTails,
208
214
  logDir,
209
215
  logFileName,
210
216
  logFilePath,