projax 1.3.17 → 1.3.18

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,6 +1,22 @@
1
- # projax CLI
2
-
3
- Command-line interface for projax - a project management dashboard for tracking local development projects.
1
+ # projax
2
+
3
+ A cross-platform project management dashboard for tracking local development projects. Features a powerful CLI tool, interactive Terminal UI (TUI), Desktop app (Electron-based), REST API, and built-in tools for test detection, port management, and script execution.
4
+
5
+ ## Features
6
+
7
+ - **Project Management**: Track multiple local projects from different directories with custom names
8
+ - **Test Detection**: Automatically detects test files (Jest, Vitest, Mocha)
9
+ - **Port Conflict Detection & Remediation**: Automatically detects and resolves port conflicts when running scripts
10
+ - **Background Script Execution**: Run scripts in the background with minimal logging
11
+ - **Intelligent Script Selection**: Automatically selects the right script (dev/start) when running projects
12
+ - **Port Scanning & Indexing**: Automatically extracts and indexes ports from project config files
13
+ - **CLI Interface**: Full-featured command-line tool for project management
14
+ - **Web Interface**: Beautiful Desktop UI (Electron-based) for visual project management
15
+ - **JSON Database**: Lightweight JSON-based database stores all project metadata
16
+ - **REST API**: Express-based API server for centralized data access
17
+ - **Cross-Platform Support**: Works on macOS, Linux, and Windows
18
+ - **Multi-Project Type Support**: Node.js, Python, Rust, Go, and Makefile projects
19
+ - **Future Jenkins Integration**: Database schema ready for Jenkins job tracking
4
20
 
5
21
  ## Installation
6
22
 
@@ -8,86 +24,282 @@ Command-line interface for projax - a project management dashboard for tracking
8
24
  npm install -g projax
9
25
  ```
10
26
 
11
- ## Commands
27
+ After installation, the `prx` command will be available globally.
28
+
29
+ ### Database Setup
30
+
31
+ The database is automatically created on first use. No manual setup required.
32
+
33
+ **Location:**
34
+ - **macOS/Linux**: `~/.projax/data.json`
35
+ - **Windows**: `%USERPROFILE%\.projax\data.json`
36
+
37
+ The directory structure is created automatically when you first run any `prx` command.
38
+
39
+ **Migration from SQLite (v1.2):**
40
+ If you're upgrading from version 1.2 or earlier, your SQLite database will be automatically migrated to JSON format on first run. The original SQLite file will be backed up to `~/.projax/dashboard.db.backup`.
41
+
42
+ ### API Server
43
+
44
+ The API server is automatically started when you launch the Desktop web interface (`prx web`). It can also be started manually:
45
+
46
+ ```bash
47
+ # Start API server
48
+ prx api --start
49
+
50
+ # Check API status
51
+ prx api
52
+
53
+ # View API info in CLI welcome screen
54
+ prx --help
55
+ ```
56
+
57
+ **API Port:**
58
+ The API server automatically finds an available port in the range 3001-3010. The selected port is displayed in:
59
+ - CLI welcome screen
60
+ - Desktop app status bar
61
+ - `prx api` command output
62
+
63
+ **API Endpoints:**
64
+ See [packages/api/README.md](packages/api/README.md) for complete API documentation.
12
65
 
13
- ### `prx add [path]`
66
+ ## Usage
67
+
68
+ ### CLI Commands
69
+
70
+ #### `prx add [path]`
14
71
 
15
72
  Add a project to the dashboard. If no path is provided, you'll be prompted to enter one.
16
73
 
74
+ **Options:**
75
+ - `-n, --name <name>`: Set a custom name for the project (defaults to directory name)
76
+
77
+ **Examples:**
17
78
  ```bash
79
+ # Add with custom name
80
+ prx add /path/to/project --name "My Awesome Project"
81
+
82
+ # Add with short flag
83
+ prx add /path/to/project -n "Frontend App"
84
+
85
+ # Interactive mode (will prompt for path and name)
86
+ prx add
87
+
88
+ # Add with path only (will prompt for name with directory name as default)
18
89
  prx add /path/to/project
19
- prx add # Interactive mode
20
90
  ```
21
91
 
22
- ### `prx list`
92
+ When adding a project, you'll be prompted to:
93
+ 1. Enter a custom name (if not provided via `--name`)
94
+ 2. Optionally scan for test files
95
+ 3. Automatically scan for ports in configuration files
96
+
97
+ #### `prx list`
98
+
99
+ List all tracked projects in a formatted table. Projects are sorted by ID.
23
100
 
24
- List all tracked projects.
101
+ **Options:**
102
+ - `-v, --verbose`: Show detailed information (legacy format)
103
+ - `--ports`: Show detailed port information per script
25
104
 
105
+ **Examples:**
26
106
  ```bash
107
+ # Default table view with ports
27
108
  prx list
28
- prx list --verbose # Show detailed information
109
+
110
+ # Detailed port information
111
+ prx list --ports
112
+
113
+ # Legacy verbose format
114
+ prx list --verbose
115
+ ```
116
+
117
+ The default table view displays:
118
+ - **ID**: Project ID
119
+ - **Name**: Project name (custom or directory name)
120
+ - **Path**: Project directory path (truncated if long)
121
+ - **Ports**: Detected ports (comma-separated) or "N/A"
122
+ - **Tests**: Number of test files found
123
+ - **Last Scanned**: Timestamp of last test scan
124
+
125
+ #### `prx scan [project]`
126
+
127
+ Scan projects for test files and ports. If no project is specified, all projects are scanned.
128
+
129
+ **Examples:**
130
+ ```bash
131
+ # Scan all projects
132
+ prx scan
133
+
134
+ # Scan specific project by ID
135
+ prx scan 1
136
+
137
+ # Scan specific project by name
138
+ prx scan "My Project"
29
139
  ```
30
140
 
31
- ### `prx scan [project]`
141
+ This command:
142
+ - Scans for test files (Jest, Vitest, Mocha)
143
+ - Scans for ports in configuration files
144
+ - Updates the database with findings
145
+
146
+ #### `prx rn <project> <newName>` / `prx rename <project> <newName>`
32
147
 
33
- Scan projects for test files. If no project is specified, all projects are scanned.
148
+ Rename a project. The directory path remains unchanged; only the display name is updated.
34
149
 
150
+ **Examples:**
35
151
  ```bash
36
- prx scan # Scan all projects
37
- prx scan 1 # Scan project with ID 1
38
- prx scan my-project # Scan project named "my-project"
152
+ # Rename by ID
153
+ prx rn 1 "My New Project Name"
154
+
155
+ # Rename by current name
156
+ prx rn "Old Name" "New Name"
157
+
158
+ # Using full command name
159
+ prx rename 2 "Frontend App"
39
160
  ```
40
161
 
41
- ### `prx remove <project>`
162
+ #### `prx remove <project>`
42
163
 
43
164
  Remove a project from the dashboard.
44
165
 
166
+ **Options:**
167
+ - `-f, --force`: Skip confirmation prompt
168
+
169
+ **Examples:**
45
170
  ```bash
171
+ # Remove with confirmation
46
172
  prx remove 1
47
- prx remove my-project
48
- prx remove my-project --force # Skip confirmation
173
+ prx remove "My Project"
174
+
175
+ # Remove without confirmation
176
+ prx remove 1 --force
177
+ prx remove "My Project" -f
49
178
  ```
50
179
 
51
- ### `prx pwd [project]`
180
+ #### `prx scripts [project]`
52
181
 
53
- Get the path to a project directory (outputs just the path).
182
+ List all available scripts for a project. If no project is specified, you'll be prompted to select one.
54
183
 
184
+ **Examples:**
55
185
  ```bash
56
- cd $(prx pwd 1) # Change to project with ID 1
57
- cd $(prx pwd my-project) # Change to project named "my-project"
58
- prx pwd # Interactive selection
186
+ # Interactive selection
187
+ prx scripts
188
+
189
+ # List scripts for specific project
190
+ prx scripts 1
191
+ prx scripts "My Project"
59
192
  ```
60
193
 
61
- ### `prx cd [project]`
194
+ Shows:
195
+ - Script name
196
+ - Command that will be executed
197
+ - Runner type (npm, yarn, pnpm, python, poetry, cargo, go, make)
198
+
199
+ #### `prx pwd [project]`
62
200
 
63
- Change to a project directory. Outputs a shell command to change directory.
201
+ Get the path to a project directory. Outputs only the path for use with command substitution.
64
202
 
203
+ **Examples:**
65
204
  ```bash
66
- eval "$(prx cd 1)" # Change to project with ID 1
67
- eval "$(prx cd my-project)" # Change to project named "my-project"
68
- prx cd # Interactive selection
205
+ # Get path by ID
206
+ prx pwd 1
207
+
208
+ # Get path by name
209
+ prx pwd "My Project"
210
+
211
+ # Use with command substitution
212
+ cd $(prx pwd 1)
213
+
214
+ # Interactive selection
215
+ prx pwd
69
216
  ```
70
217
 
71
- **Tip:** For even easier navigation, add this to your shell config (`~/.zshrc` or `~/.bashrc`):
218
+ #### `prx cd [project]`
72
219
 
220
+ Change to a project directory. Outputs a shell command that changes directory.
221
+
222
+ **Examples:**
223
+ ```bash
224
+ # Change directory by ID
225
+ eval "$(prx cd 1)"
226
+
227
+ # Change directory by name
228
+ eval "$(prx cd projax)"
229
+
230
+ # Interactive selection
231
+ eval "$(prx cd)"
232
+
233
+ # Create a shell function for convenience
234
+ prxcd() { eval "$(prx cd $@)"; }
235
+ # Then use: prxcd 1
236
+ ```
237
+
238
+ **Shell Integration Tip:** Add this to your `~/.zshrc` or `~/.bashrc`:
73
239
  ```bash
74
240
  prxcd() {
75
241
  eval "$(prx cd $@)"
76
242
  }
77
243
  ```
78
244
 
79
- Then you can simply use: `prxcd 1` or `prxcd my-project`
245
+ Then simply use: `prxcd 1` or `prxcd projax`
246
+
247
+ #### `prx <project> [script] [args...]`
80
248
 
81
- ### `prx run <project> <script>`
249
+ Run a script from a project. Supports intelligent script selection and multiple execution modes.
82
250
 
83
- Run a script from a project.
251
+ **Intelligent Script Selection:**
252
+ When no script is specified, `prx` automatically selects:
253
+ 1. If project has "start" but no "dev" → runs "start"
254
+ 2. If project has "dev" but no "start" → runs "dev"
255
+ 3. Otherwise → shows interactive script selection menu
256
+
257
+ **Options:**
258
+ - `-M, --background, -b, --daemon`: Run script in background mode (minimal logging)
259
+ - `--force, -F`: Auto-resolve port conflicts without prompting
260
+
261
+ **Examples:**
262
+ ```bash
263
+ # Intelligent selection (auto-selects dev or start)
264
+ prx 1
265
+ prx "My Project"
266
+
267
+ # Run specific script
268
+ prx 1 dev
269
+ prx 2 build
270
+ prx "My Project" test --watch
271
+
272
+ # Run in background
273
+ prx 1 dev -M
274
+ prx 2 start --background
275
+ prx "My Project" dev -b
276
+
277
+ # Auto-resolve port conflicts
278
+ prx 1 dev --force
279
+ prx 2 start -F
280
+
281
+ # Combine flags
282
+ prx 1 dev -M --force
283
+ ```
284
+
285
+ **Supported Project Types:**
286
+ - **Node.js**: Runs scripts from `package.json` (npm, yarn, pnpm)
287
+ - **Python**: Runs scripts from `pyproject.toml` (supports Poetry)
288
+ - **Rust**: Runs common `cargo` commands (build, run, test, etc.)
289
+ - **Go**: Runs common `go` commands or Makefile targets
290
+ - **Makefile**: Runs Makefile targets
291
+
292
+ #### `prx run <project> <script>`
293
+
294
+ Run a script from a project with explicit command syntax.
84
295
 
85
296
  **Options:**
86
297
  - `-b, --background`: Run script in background mode
87
298
  - `-f, --force`: Auto-resolve port conflicts
88
299
 
300
+ **Examples:**
89
301
  ```bash
90
- # Run in foreground
302
+ # Run a script in foreground
91
303
  prx run 1 dev
92
304
  prx run projax build
93
305
 
@@ -95,114 +307,577 @@ prx run projax build
95
307
  prx run 1 dev --background
96
308
  prx run projax dev -b
97
309
 
98
- # With force flag
99
- prx run 1 dev -f -b
310
+ # Auto-resolve port conflicts
311
+ prx run 1 dev --force
312
+ prx run 1 dev -b -f
100
313
  ```
101
314
 
102
- ### `prx ps`
315
+ #### `prx ps`
103
316
 
104
317
  List all running background processes.
105
318
 
319
+ **Examples:**
106
320
  ```bash
107
321
  prx ps
322
+
323
+ # Output shows:
324
+ # Running processes (3):
325
+ #
326
+ # PID 12345: projax (dev) - 5m 30s
327
+ # Command: npm run dev
328
+ # Logs: /Users/username/.projax/logs/process-1234567890-dev.log
329
+ # URLs: http://localhost:3000
108
330
  ```
109
331
 
110
- ### `prx stop <pid>`
332
+ #### `prx stop <pid>`
111
333
 
112
- Stop a running background process by PID.
334
+ Stop a running background process.
113
335
 
336
+ **Examples:**
114
337
  ```bash
338
+ # Stop process by PID
115
339
  prx stop 12345
340
+
341
+ # Find PIDs with ps command
342
+ prx ps
343
+ ```
344
+
345
+ #### `prx prxi` / `prx i`
346
+
347
+ Launch the interactive terminal UI - a full-screen terminal interface for managing projects.
348
+
349
+ **Features:**
350
+ - Navigate projects with arrow keys or vim bindings (j/k)
351
+ - View project details, tests, ports, and running scripts
352
+ - Scan projects for tests and ports
353
+ - Stop running scripts
354
+ - Full-height columns with independent scrolling
355
+
356
+ **Keyboard Shortcuts:**
357
+ - `↑/k` - Move up in project list
358
+ - `↓/j` - Move down in project list
359
+ - `Tab/←/→` - Switch between project list and details
360
+ - `s` - Scan selected project
361
+ - `p` - Scan ports for selected project
362
+ - `r` - Show available scripts
363
+ - `x` - Stop all scripts for selected project
364
+ - `?` - Show help
365
+ - `q/Esc` - Quit
366
+
367
+ **Examples:**
368
+ ```bash
369
+ prx i # Short alias
370
+ prx prxi # Full command
116
371
  ```
117
372
 
118
- ### `prx prxi` / `prx i`
373
+ #### `prx scan-ports [project]`
119
374
 
120
- Launch the interactive terminal UI.
375
+ Manually scan projects for port information. Ports are automatically extracted from:
376
+ - `vite.config.js/ts` - Vite server port
377
+ - `next.config.js/ts` - Next.js dev server port
378
+ - `webpack.config.js` - Webpack devServer port
379
+ - `angular.json` - Angular serve port
380
+ - `nuxt.config.js/ts` - Nuxt server port
381
+ - `package.json` - Scripts with `--port`, `-p`, or `PORT=` patterns
382
+ - `.env` files - `PORT`, `VITE_PORT`, `NEXT_PORT`, etc.
121
383
 
384
+ **Examples:**
122
385
  ```bash
123
- prx i # Short alias
124
- prx prxi # Full command
386
+ # Scan all projects
387
+ prx scan-ports
388
+
389
+ # Scan specific project
390
+ prx scan-ports 1
391
+ prx scan-ports "My Project"
125
392
  ```
126
393
 
127
- **Keyboard shortcuts:**
128
- - `↑/k` - Navigate up
129
- - `↓/j` - Navigate down
130
- - `Tab/←/→` - Switch panels
131
- - `s` - Scan project
132
- - `p` - Scan ports
133
- - `r` - Show scripts
134
- - `x` - Stop all project scripts
135
- - `?` - Help
136
- - `q/Esc` - Quit
394
+ #### `prx web`
137
395
 
138
- ### `prx <project> <script> [args...]`
396
+ Start the Desktop web interface. The API server is automatically started when launching the web interface.
139
397
 
140
- Run a script from a project's configuration file. Supports multiple project types:
398
+ **Options:**
399
+ - `--dev`: Start in development mode (with hot reload)
141
400
 
142
- - **Node.js**: Runs scripts from `package.json` using `npm run`
143
- - **Python**: Runs scripts from `pyproject.toml` (supports Poetry)
144
- - **Rust**: Runs common `cargo` commands (build, run, test, etc.)
145
- - **Go**: Runs common `go` commands or Makefile targets
146
- - **Makefile**: Runs Makefile targets
401
+ **Examples:**
402
+ ```bash
403
+ # Production mode
404
+ prx web
405
+
406
+ # Development mode
407
+ prx web --dev
408
+ ```
409
+
410
+ #### `prx api`
411
+
412
+ Show API server information and manage the API server.
413
+
414
+ **Options:**
415
+ - `-s, --start`: Start the API server
416
+ - `-k, --kill`: Stop the API server (not yet implemented)
147
417
 
418
+ **Examples:**
148
419
  ```bash
149
- prx 1 dev # Run "dev" script from project ID 1
150
- prx my-project build # Run "build" script from "my-project"
151
- prx 2 test --watch # Run "test" script with --watch flag
152
- prx api-server start --port 3000 # Run "start" script with arguments
420
+ # Show API status
421
+ prx api
422
+
423
+ # Start API server manually
424
+ prx api --start
153
425
  ```
154
426
 
155
- ### `prx scripts [project]`
427
+ The API server status is also shown in:
428
+ - CLI welcome screen (when running any command)
429
+ - Desktop app status bar (bottom of window)
430
+
431
+
432
+ ### Advanced Features
433
+
434
+ #### Intelligent Script Selection
435
+
436
+ When you run `prx <project>` without specifying a script, the CLI intelligently selects the appropriate script:
437
+
438
+ 1. **If project has "start" but no "dev"** → automatically runs "start"
439
+ 2. **If project has "dev" but no "start"** → automatically runs "dev"
440
+ 3. **If both exist or neither exists** → shows interactive menu to select from all available scripts
441
+
442
+ This makes it easy to quickly start projects without remembering script names.
443
+
444
+ #### Background Script Execution
445
+
446
+ Run scripts in the background with minimal logging. The script output is redirected to log files, allowing you to continue using your terminal.
447
+
448
+ **Background Mode Flags:**
449
+ - `-M` (shortest)
450
+ - `--background`
451
+ - `-b`
452
+ - `--daemon`
453
+
454
+ **Features:**
455
+ - Script runs detached from your terminal
456
+ - Output saved to log files in `~/.projax/logs/`
457
+ - Process tracked with PID
458
+ - You can continue using your terminal immediately
156
459
 
157
- List all available scripts for a project.
460
+ **Example:**
461
+ ```bash
462
+ # Start dev server in background
463
+ prx 1 dev -M
464
+
465
+ # Output shows:
466
+ # ✓ Started "My Project" (dev) in background [PID: 12345]
467
+ # Logs: /Users/username/.projax/logs/process-1234567890-dev.log
468
+ # Command: npm run dev
469
+ ```
158
470
 
471
+ **Viewing Logs:**
159
472
  ```bash
160
- prx scripts # Interactive project selection
161
- prx scripts 1 # List scripts for project ID 1
162
- prx scripts my-project # List scripts for "my-project"
473
+ # Logs are stored in:
474
+ ~/.projax/logs/process-<timestamp>-<script>.log
475
+
476
+ # View recent log
477
+ tail -f ~/.projax/logs/process-*.log
163
478
  ```
164
479
 
165
- ### `prx web`
480
+ #### Port Conflict Detection & Remediation
481
+
482
+ The CLI automatically detects and helps resolve port conflicts when running scripts.
483
+
484
+ **How It Works:**
166
485
 
167
- Start the Electron web interface.
486
+ 1. **Proactive Detection**: Before running a script, checks if known ports are in use
487
+ 2. **Reactive Detection**: If a script fails with a port error, extracts the port number from the error message
488
+ 3. **Process Identification**: Finds the process using the port (cross-platform)
489
+ 4. **Remediation Options**:
490
+ - **Interactive**: Prompts to kill the process and retry
491
+ - **Auto-resolve**: Use `--force` or `-F` flag to automatically kill and retry
168
492
 
493
+ **Port Detection Sources:**
494
+ - Automatically extracted from config files during scanning
495
+ - Detected from error messages when scripts fail
496
+ - Stored in database for quick reference
497
+
498
+ **Examples:**
169
499
  ```bash
170
- prx web
500
+ # Port conflict detected - interactive prompt
501
+ prx 1 dev
502
+ # ⚠️ Port 3000 is already in use by process 12345 (node)
503
+ # Kill process 12345 (node) and continue? (y/N)
504
+
505
+ # Auto-resolve port conflicts
506
+ prx 1 dev --force
507
+ # Port 3000 is already in use by process 12345 (node)
508
+ # Killing process 12345 on port 3000...
509
+ # ✓ Process killed. Retrying...
171
510
  ```
172
511
 
173
- ## Examples
512
+ **Supported Error Patterns:**
513
+ - `EADDRINUSE: address already in use :::3000`
514
+ - `Port 3000 is already in use`
515
+ - `Error: listen EADDRINUSE: address already in use 0.0.0.0:3000`
516
+ - And many more common port error formats
517
+
518
+ #### Port Scanning & Indexing
519
+
520
+ The CLI automatically scans and indexes ports from project configuration files.
521
+
522
+ **Automatic Scanning:**
523
+ - Runs when adding a project (`prx add`)
524
+ - Runs when scanning for tests (`prx scan`)
525
+ - Runs in background when listing projects (`prx list`) if ports are stale (>24 hours)
526
+
527
+ **Supported Config Files:**
528
+ - **Vite**: `vite.config.js/ts` - `server.port`
529
+ - **Next.js**: `next.config.js/ts` - dev server port
530
+ - **Webpack**: `webpack.config.js` - `devServer.port`
531
+ - **Angular**: `angular.json` - `serve.options.port`
532
+ - **Nuxt**: `nuxt.config.js/ts` - `server.port`
533
+ - **Package.json**: Scripts with `--port`, `-p`, `PORT=` patterns
534
+ - **Environment Files**: `.env`, `.env.local`, `.env.development` - `PORT`, `VITE_PORT`, `NEXT_PORT`, etc.
535
+
536
+ **Port Information Display:**
537
+ - Shown in `prx list` table view
538
+ - Detailed view with `prx list --ports`
539
+ - Grouped by script name when applicable
540
+
541
+ ### Web Interface
542
+
543
+ The Desktop web interface provides a visual way to manage your projects:
544
+
545
+ 1. **Add Projects**: Use the file system picker to select project directories
546
+ 2. **View Projects**: See all tracked projects in the sidebar
547
+ 3. **Test Information**: View detected test files and frameworks per project
548
+ 4. **Scan Projects**: Trigger test scans directly from the UI
549
+
550
+ ## Troubleshooting
551
+
552
+ ### Port Conflicts
553
+
554
+ **Problem:** Script fails with "port already in use" error
555
+
556
+ **Solutions:**
557
+ 1. Use `--force` or `-F` flag to auto-resolve:
558
+ ```bash
559
+ prx 1 dev --force
560
+ ```
561
+
562
+ 2. Manually kill the process:
563
+ ```bash
564
+ # Find process on port (macOS/Linux)
565
+ lsof -ti:3000
566
+ kill -9 $(lsof -ti:3000)
567
+
568
+ # Windows
569
+ netstat -ano | findstr :3000
570
+ taskkill /F /PID <pid>
571
+ ```
572
+
573
+ 3. Check what's using the port:
574
+ ```bash
575
+ # The CLI will show this when detecting conflicts
576
+ prx 1 dev
577
+ # ⚠️ Port 3000 is already in use by process 12345 (node)
578
+ ```
579
+
580
+ ### Background Processes
581
+
582
+ **Problem:** Background process logs or management
583
+
584
+ **Solutions:**
585
+ - Logs are stored in `~/.projax/logs/`
586
+ - View logs: `tail -f ~/.projax/logs/process-*.log`
587
+ - Process information is tracked in `~/.projax/processes.json`
588
+
589
+ **Problem:** Background process not starting
590
+
591
+ **Solutions:**
592
+ 1. Check if port is available (see Port Conflicts above)
593
+ 2. Check log files for errors
594
+ 3. Try running in foreground first to see errors:
595
+ ```bash
596
+ prx 1 dev # Remove -M flag
597
+ ```
598
+
599
+ ### Port Scanning Issues
600
+
601
+ **Problem:** Ports not detected in `prx list`
602
+
603
+ **Solutions:**
604
+ 1. Manually trigger port scan:
605
+ ```bash
606
+ prx scan-ports 1
607
+ prx scan-ports # All projects
608
+ ```
609
+
610
+ 2. Check if config file is supported (see Port Scanning section)
611
+
612
+ 3. Verify config file syntax is correct
613
+
614
+ 4. Ports are rescanned automatically if older than 24 hours
615
+
616
+ ### Database Issues
617
+
618
+ **Problem:** Database errors or corruption
619
+
620
+ **Solutions:**
621
+ 1. Database location: `~/.projax/data.json`
622
+ 2. Backup database before troubleshooting:
623
+ ```bash
624
+ cp ~/.projax/data.json ~/.projax/data.json.backup
625
+ ```
626
+ 3. Delete database to start fresh (will lose all data):
627
+ ```bash
628
+ rm ~/.projax/data.json
629
+ ```
630
+ 4. If you have an old SQLite database, migration happens automatically on first API start
631
+
632
+ ### API Server Issues
633
+
634
+ **Problem:** API server not running or connection errors
635
+
636
+ **Solutions:**
637
+ 1. Check API status:
638
+ ```bash
639
+ prx api
640
+ ```
641
+
642
+ 2. Start API server manually:
643
+ ```bash
644
+ prx api --start
645
+ ```
646
+
647
+ 3. Check if port is available:
648
+ ```bash
649
+ # The API tries ports 3001-3010 automatically
650
+ # Check which port is in use
651
+ lsof -i :3001 # macOS/Linux
652
+ netstat -ano | findstr :3001 # Windows
653
+ ```
654
+
655
+ 4. The API port is displayed in:
656
+ - CLI welcome screen
657
+ - Desktop app status bar
658
+ - `prx api` command output
659
+
660
+ ### Script Execution Issues
661
+
662
+ **Problem:** Script not found or not running
663
+
664
+ **Solutions:**
665
+ 1. List available scripts:
666
+ ```bash
667
+ prx scripts 1
668
+ ```
669
+
670
+ 2. Check project type is supported:
671
+ - Node.js (package.json)
672
+ - Python (pyproject.toml)
673
+ - Rust (Cargo.toml)
674
+ - Go (go.mod or Makefile)
675
+ - Makefile
676
+
677
+ 3. Verify script exists in project's config file
678
+
679
+ 4. Try running script directly to see error:
680
+ ```bash
681
+ cd $(prx pwd 1)
682
+ npm run dev # or appropriate command
683
+ ```
684
+
685
+ ### Project Not Found
686
+
687
+ **Problem:** "Project not found" error
688
+
689
+ **Solutions:**
690
+ 1. List all projects to see available IDs and names:
691
+ ```bash
692
+ prx list
693
+ ```
694
+
695
+ 2. Use project ID instead of name (more reliable):
696
+ ```bash
697
+ prx 1 dev # Instead of prx "My Project" dev
698
+ ```
699
+
700
+ 3. Check project path still exists:
701
+ ```bash
702
+ prx list # Shows paths
703
+ ```
704
+
705
+ ### Desktop App Issues
706
+
707
+ **Problem:** `prx web` fails
708
+
709
+ **Solutions:**
710
+ 1. Build the Desktop app first:
711
+ ```bash
712
+ npm run build:desktop
713
+ ```
714
+
715
+ 2. Try development mode:
716
+ ```bash
717
+ prx web --dev
718
+ ```
719
+
720
+ 3. Check if Desktop dependencies are installed:
721
+ ```bash
722
+ cd packages/desktop
723
+ npm install
724
+ ```
725
+
726
+ ## Comprehensive Usage Examples
727
+
728
+ ### Basic Workflow
174
729
 
175
730
  ```bash
176
- # Add multiple projects
177
- prx add ~/projects/api-server
178
- prx add ~/projects/frontend-app
179
- prx add ~/projects/mobile-app
731
+ # 1. Add projects with custom names
732
+ prx add ~/projects/api-server --name "API Server"
733
+ prx add ~/projects/frontend --name "Frontend App"
734
+ prx add ~/projects/mobile-app --name "Mobile App"
180
735
 
181
- # List all projects
736
+ # 2. List all projects (table format with ports)
182
737
  prx list
183
738
 
184
- # Scan all projects for tests
739
+ # 3. View detailed port information
740
+ prx list --ports
741
+
742
+ # 4. Run projects with intelligent selection
743
+ prx 1 # Auto-selects dev or start
744
+ prx "API Server" # Same, using name
745
+
746
+ # 5. Run specific scripts
747
+ prx 1 dev
748
+ prx 2 build
749
+ prx "Frontend App" test --watch
750
+
751
+ # 6. Run in background
752
+ prx 1 dev -M
753
+ prx 2 start --background
754
+
755
+ # 7. Navigate to projects
756
+ eval $(prx cd 1)
757
+ cd $(prx pwd "Frontend App")
758
+ ```
759
+
760
+ ### Port Conflict Resolution
761
+
762
+ ```bash
763
+ # Scenario: Port 3000 is already in use
764
+
765
+ # Option 1: Interactive resolution
766
+ prx 1 dev
767
+ # ⚠️ Port 3000 is already in use by process 12345 (node)
768
+ # Kill process 12345 (node) and continue? (y/N)
769
+ # y
770
+ # ✓ Process killed. Retrying...
771
+
772
+ # Option 2: Auto-resolve with --force
773
+ prx 1 dev --force
774
+ # Port 3000 is already in use by process 12345 (node)
775
+ # Killing process 12345 on port 3000...
776
+ # ✓ Process killed. Retrying...
777
+
778
+ # Option 3: Background mode with auto-resolve
779
+ prx 1 dev -M --force
780
+ ```
781
+
782
+ ### Shell Integration
783
+
784
+ Add to your `~/.zshrc` or `~/.bashrc`:
785
+
786
+ ```bash
787
+ # Quick navigation function
788
+ prxcd() {
789
+ eval $(prx cd "$@")
790
+ }
791
+
792
+ # Quick script execution with background mode
793
+ prxbg() {
794
+ prx "$@" -M
795
+ }
796
+ ```
797
+
798
+ Usage:
799
+ ```bash
800
+ prxcd 1 # Change to project 1
801
+ prxbg 2 dev # Run dev script in background for project 2
802
+ ```
803
+
804
+ ### Multi-Project Management
805
+
806
+ ```bash
807
+ # Add multiple projects
808
+ prx add ~/projects/project1 --name "Project 1"
809
+ prx add ~/projects/project2 --name "Project 2"
810
+ prx add ~/projects/project3 --name "Project 3"
811
+
812
+ # Scan all projects for tests and ports
185
813
  prx scan
186
814
 
187
- # View detailed project information
188
- prx list --verbose
815
+ # List with port information
816
+ prx list --ports
817
+
818
+ # Run multiple projects in background
819
+ prx 1 dev -M
820
+ prx 2 dev -M
821
+ prx 3 start -M
189
822
 
190
- # Remove a project
191
- prx remove api-server
823
+ # Check what's running
824
+ prx list
825
+ ```
192
826
 
193
- # Quickly navigate to a project
194
- cd $(prx cd api-server)
827
+ ### Project Renaming
195
828
 
196
- # Run scripts from projects
197
- prx api-server dev
198
- prx 1 build
199
- prx frontend-app test --watch
829
+ ```bash
830
+ # Rename a project
831
+ prx rn 1 "New Project Name"
832
+ prx rename "Old Name" "New Name"
200
833
 
201
- # List available scripts
202
- prx scripts api-server
834
+ # The directory path remains unchanged
835
+ # Only the display name is updated
203
836
  ```
204
837
 
205
- ## Database
838
+ ### Advanced Script Execution
839
+
840
+ ```bash
841
+ # Run with arguments
842
+ prx 1 dev --port 3001
843
+ prx 2 test --watch --coverage
844
+
845
+ # Run in background with arguments
846
+ prx 1 dev -M --port 3001
847
+
848
+ # Auto-resolve port conflicts
849
+ prx 1 dev --force --port 3000
850
+
851
+ # Combine all options
852
+ prx 1 dev -M --force --port 3001
853
+ ```
854
+
855
+ ## Test Detection
856
+
857
+ The dashboard automatically detects test files from:
858
+
859
+ - **Jest**: `*.test.js`, `*.test.ts`, `*.spec.js`, `*.spec.ts`, `__tests__/` directories
860
+ - **Vitest**: Same patterns as Jest
861
+ - **Mocha**: `*.test.js`, `*.spec.js`, `test/` directories
862
+
863
+ Detection is based on:
864
+ 1. Framework configuration files (`jest.config.js`, `vitest.config.ts`, `.mocharc.js`)
865
+ 2. `package.json` dependencies and test scripts
866
+ 3. File naming patterns and directory structures
867
+
868
+ ## Future Features
869
+
870
+ - **Jenkins Integration**: Connect to local Jenkins instances to display build status
871
+ - **Test Execution**: Run tests directly from the dashboard
872
+ - **Project Templates**: Quick project setup from templates
873
+ - **Git Integration**: Show git status and branch information
874
+ - **Notifications**: Alert on test failures or build status changes
875
+
876
+ ## License
877
+
878
+ MIT
879
+
880
+ ## Contributing
206
881
 
207
- The CLI uses a shared SQLite database located at `~/.projax/dashboard.db`. This database is shared with the Electron web interface.
882
+ Contributions are welcome! Please feel free to submit a Pull Request.
208
883
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projax-api",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "REST API server for projax project dashboard (internal use)",
5
5
  "private": true,
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projax",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "Cross-platform project management dashboard for tracking local development projects. Features CLI, Terminal UI, Desktop app, REST API, and built-in tools for test detection, port management, and script execution.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {