@scriptdb/client 1.0.8 → 1.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 (2) hide show
  1. package/README.md +85 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -302,6 +302,91 @@ npm run typecheck
302
302
  npm run lint
303
303
  ```
304
304
 
305
+ ## CLI Tool
306
+
307
+ ScriptDB also provides a CLI tool for server management:
308
+
309
+ ```bash
310
+ # Install CLI globally
311
+ npm install -g @scriptdb/cli
312
+
313
+ # Start server in foreground
314
+ scriptdb start
315
+
316
+ # Start server in background (daemon mode with PM2)
317
+ scriptdb start -d
318
+
319
+ # Check server status
320
+ scriptdb status
321
+
322
+ # View real-time logs
323
+ scriptdb logs
324
+
325
+ # Monitor performance
326
+ scriptdb monit
327
+
328
+ # Stop server
329
+ scriptdb stop
330
+
331
+ # Restart server
332
+ scriptdb restart -d
333
+
334
+ # Install packages to ScriptDB
335
+ scriptdb add lodash
336
+ scriptdb add axios express
337
+
338
+ # Install packages locally
339
+ scriptdb add --local lodash
340
+ ```
341
+
342
+ ### CLI Commands
343
+
344
+ - `scriptdb start [-d]` - Start the ScriptDB server (`-d` for daemon mode)
345
+ - `scriptdb stop` - Stop the running server
346
+ - `scriptdb restart [-d]` - Restart the server
347
+ - `scriptdb status` - Check server status and view metrics
348
+ - `scriptdb logs` - View real-time logs
349
+ - `scriptdb monit` - Monitor performance (CPU, memory, uptime)
350
+ - `scriptdb shell` - Start interactive shell
351
+ - `scriptdb add <package> [--local]` - Install packages
352
+ - `scriptdb remove <package> [--local]` - Remove packages
353
+
354
+ ### Configuration
355
+
356
+ The CLI reads configuration from `~/.scriptdb/config.json`:
357
+
358
+ ```json
359
+ {
360
+ "host": "localhost",
361
+ "port": 1234,
362
+ "users": [
363
+ {
364
+ "username": "admin",
365
+ "password": "your-password",
366
+ "hash": false
367
+ }
368
+ ],
369
+ "folder": "databases",
370
+ "secure": false
371
+ }
372
+ ```
373
+
374
+ ## Changelog
375
+
376
+ ### 1.1.0 (2025-01-16)
377
+
378
+ **Added**
379
+ - Native `scriptdb logs` command to view real-time logs
380
+ - Native `scriptdb monit` command to monitor performance
381
+ - Native `scriptdb restart` command to restart the server
382
+ - Native `scriptdb stop` command to stop the server
383
+ - Dynamic version reading from package.json
384
+
385
+ **Fixed**
386
+ - Fixed TypeScript module resolution errors
387
+ - Fixed test command to continue gracefully when packages have no tests
388
+ - Improved error handling and Windows compatibility
389
+
305
390
  ## License
306
391
 
307
392
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scriptdb/client",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "Client module resolver for script database",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",