@qodalis/cli-core 2.0.0-beta.1 → 2.0.0-beta.10

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
@@ -21,6 +21,17 @@
21
21
 
22
22
  ---
23
23
 
24
+ ## Try It Online
25
+
26
+ | Framework | StackBlitz | CodeSandbox | Gitpod |
27
+ |-----------|------------|-------------|--------|
28
+ | **Angular** | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/qodalis-solutions/qodalis-cli-angular-example) | [![Open in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/qodalis-solutions/qodalis-cli-angular-example) | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/qodalis-solutions/qodalis-cli-angular-example) |
29
+ | **React** | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/qodalis-solutions/qodalis-cli-react-example) | [![Open in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/qodalis-solutions/qodalis-cli-react-example) | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/qodalis-solutions/qodalis-cli-react-example) |
30
+ | **Vue** | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/qodalis-solutions/qodalis-cli-vue-example) | [![Open in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/qodalis-solutions/qodalis-cli-vue-example) | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/qodalis-solutions/qodalis-cli-vue-example) |
31
+ | **Vanilla** | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/qodalis-solutions/qodalis-cli-vanilla-example) | [![Open in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/qodalis-solutions/qodalis-cli-vanilla-example) | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/qodalis-solutions/qodalis-cli-vanilla-example) |
32
+
33
+ ---
34
+
24
35
  ![Help command](assets/help_command.gif)
25
36
 
26
37
  ## Packages
@@ -55,7 +66,7 @@ Add styles to `angular.json`:
55
66
  ```json
56
67
  {
57
68
  "styles": [
58
- "node_modules/@qodalis/angular-cli/src/assets/styles.sass"
69
+ "node_modules/@qodalis/angular-cli/src/assets/styles.css"
59
70
  ]
60
71
  }
61
72
  ```
@@ -75,6 +86,7 @@ npm install @qodalis/react-cli
75
86
  ```
76
87
 
77
88
  ```tsx
89
+ import '@qodalis/react-cli/styles.css';
78
90
  import { Cli } from '@qodalis/react-cli';
79
91
 
80
92
  function App() {
@@ -90,6 +102,7 @@ npm install @qodalis/vue-cli
90
102
 
91
103
  ```vue
92
104
  <script setup lang="ts">
105
+ import '@qodalis/vue-cli/styles.css';
93
106
  import { Cli } from '@qodalis/vue-cli';
94
107
  </script>
95
108
 
@@ -192,19 +205,60 @@ pkg source set unpkg # Set package source directly
192
205
 
193
206
  ### Available Packages
194
207
 
208
+ #### Utility Plugins
209
+
195
210
  | Package | Command | Description |
196
211
  |---------|---------|-------------|
212
+ | [@qodalis/cli-data-explorer](https://www.npmjs.com/package/@qodalis/cli-data-explorer) | `data-explorer` | Interactive query console for SQL, MongoDB, Redis, Elasticsearch |
197
213
  | [@qodalis/cli-guid](https://www.npmjs.com/package/@qodalis/cli-guid) | `guid` | Generate and validate UUIDs |
198
- | [@qodalis/cli-string](https://www.npmjs.com/package/@qodalis/cli-string) | `string` | String manipulation (case, trim, reverse, slug, wc, etc.) |
199
- | [@qodalis/cli-curl](https://www.npmjs.com/package/@qodalis/cli-curl) | `curl` | HTTP requests (GET, POST, PUT, DELETE) |
200
- | [@qodalis/cli-todo](https://www.npmjs.com/package/@qodalis/cli-todo) | `todo` | Task management |
201
214
  | [@qodalis/cli-regex](https://www.npmjs.com/package/@qodalis/cli-regex) | `regex` | Regular expression testing |
202
215
  | [@qodalis/cli-qr](https://www.npmjs.com/package/@qodalis/cli-qr) | `qr` | QR code generation |
203
216
  | [@qodalis/cli-speed-test](https://www.npmjs.com/package/@qodalis/cli-speed-test) | `speed-test` | Internet speed test |
204
- | [@qodalis/cli-server-logs](https://www.npmjs.com/package/@qodalis/cli-server-logs) | `server-logs` | Live server log streaming |
217
+ | [@qodalis/cli-curl](https://www.npmjs.com/package/@qodalis/cli-curl) | `curl` | HTTP requests (GET, POST, PUT, DELETE) |
218
+ | [@qodalis/cli-password-generator](https://www.npmjs.com/package/@qodalis/cli-password-generator) | `generate-password` | Password generation |
219
+ | [@qodalis/cli-string](https://www.npmjs.com/package/@qodalis/cli-string) | `string` | String manipulation (case, trim, reverse, slug, wc, etc.) |
220
+ | [@qodalis/cli-todo](https://www.npmjs.com/package/@qodalis/cli-todo) | `todo` | Task management |
205
221
  | [@qodalis/cli-browser-storage](https://www.npmjs.com/package/@qodalis/cli-browser-storage) | `local-storage`, `cookies` | Browser storage operations |
206
222
  | [@qodalis/cli-text-to-image](https://www.npmjs.com/package/@qodalis/cli-text-to-image) | `text-to-image` | Generate images from text |
207
- | [@qodalis/cli-password-generator](https://www.npmjs.com/package/@qodalis/cli-password-generator) | `generate-password` | Password generation |
223
+ | [@qodalis/cli-files](https://www.npmjs.com/package/@qodalis/cli-files) | `ls`, `cat`, `nano`, `mkdir`, `touch`, `rm` | Virtual filesystem |
224
+ | [@qodalis/cli-yesno](https://www.npmjs.com/package/@qodalis/cli-yesno) | `yesno` | Interactive yes/no confirmation prompts |
225
+ | [@qodalis/cli-server-logs](https://www.npmjs.com/package/@qodalis/cli-server-logs) | `server logs` | Live server log streaming with level filtering |
226
+ | [@qodalis/cli-server-jobs](https://www.npmjs.com/package/@qodalis/cli-server-jobs) | `server jobs` | Manage server-side background jobs |
227
+ | [@qodalis/cli-users](https://www.npmjs.com/package/@qodalis/cli-users) | `whoami`, `adduser`, `login` | User management and authentication |
228
+ | [@qodalis/cli-chart](https://www.npmjs.com/package/@qodalis/cli-chart) | `chart` | Render bar, line, and sparkline charts |
229
+ | [@qodalis/cli-cron](https://www.npmjs.com/package/@qodalis/cli-cron) | `cron` | Schedule and manage recurring commands |
230
+ | [@qodalis/cli-csv](https://www.npmjs.com/package/@qodalis/cli-csv) | `csv` | Parse, filter, sort, and convert CSV data |
231
+ | [@qodalis/cli-markdown](https://www.npmjs.com/package/@qodalis/cli-markdown) | `md` | Render Markdown content in the terminal |
232
+ | [@qodalis/cli-encode](https://www.npmjs.com/package/@qodalis/cli-encode) | `base64`, `url`, `hex`, `html` | Encode/decode Base64, URL, hex, HTML entities |
233
+ | [@qodalis/cli-scp](https://www.npmjs.com/package/@qodalis/cli-scp) | `scp` | Secure copy — transfer files between local and remote |
234
+ | [@qodalis/cli-wget](https://www.npmjs.com/package/@qodalis/cli-wget) | `wget` | Download files from URLs |
235
+ | [@qodalis/cli-stopwatch](https://www.npmjs.com/package/@qodalis/cli-stopwatch) | `stopwatch` | Interactive stopwatch and countdown timer |
236
+
237
+ #### Game Plugins
238
+
239
+ | Package | Command | Description |
240
+ |---------|---------|-------------|
241
+ | [@qodalis/cli-snake](https://www.npmjs.com/package/@qodalis/cli-snake) | `snake` | Classic Snake game |
242
+ | [@qodalis/cli-tetris](https://www.npmjs.com/package/@qodalis/cli-tetris) | `tetris` | Tetris |
243
+ | [@qodalis/cli-2048](https://www.npmjs.com/package/@qodalis/cli-2048) | `2048` | 2048 sliding puzzle |
244
+ | [@qodalis/cli-minesweeper](https://www.npmjs.com/package/@qodalis/cli-minesweeper) | `minesweeper` | Minesweeper |
245
+ | [@qodalis/cli-wordle](https://www.npmjs.com/package/@qodalis/cli-wordle) | `wordle` | Wordle word game |
246
+ | [@qodalis/cli-sudoku](https://www.npmjs.com/package/@qodalis/cli-sudoku) | `sudoku` | Sudoku puzzle |
247
+
248
+ #### Language Packs
249
+
250
+ | Package | Language |
251
+ |---------|----------|
252
+ | [@qodalis/cli-lang-es](https://www.npmjs.com/package/@qodalis/cli-lang-es) | Spanish |
253
+ | [@qodalis/cli-lang-fr](https://www.npmjs.com/package/@qodalis/cli-lang-fr) | French |
254
+ | [@qodalis/cli-lang-de](https://www.npmjs.com/package/@qodalis/cli-lang-de) | German |
255
+ | [@qodalis/cli-lang-it](https://www.npmjs.com/package/@qodalis/cli-lang-it) | Italian |
256
+ | [@qodalis/cli-lang-pt](https://www.npmjs.com/package/@qodalis/cli-lang-pt) | Portuguese |
257
+ | [@qodalis/cli-lang-ro](https://www.npmjs.com/package/@qodalis/cli-lang-ro) | Romanian |
258
+ | [@qodalis/cli-lang-ru](https://www.npmjs.com/package/@qodalis/cli-lang-ru) | Russian |
259
+ | [@qodalis/cli-lang-zh](https://www.npmjs.com/package/@qodalis/cli-lang-zh) | Chinese |
260
+ | [@qodalis/cli-lang-ja](https://www.npmjs.com/package/@qodalis/cli-lang-ja) | Japanese |
261
+ | [@qodalis/cli-lang-ko](https://www.npmjs.com/package/@qodalis/cli-lang-ko) | Korean |
208
262
 
209
263
  Any npm package with UMD support can also be loaded:
210
264
 
@@ -213,6 +267,76 @@ pkg add lodash
213
267
  eval _.map([1, 2, 3], n => n * 2)
214
268
  ```
215
269
 
270
+ ## Server Integration
271
+
272
+ Connect the frontend terminal to a backend server for server-side command execution, interactive shell sessions, filesystem access, and event streaming. Three official backend implementations are available:
273
+
274
+ | Server | Package | Port | Tech Stack |
275
+ |--------|---------|------|------------|
276
+ | **.NET** | [Qodalis.Cli](https://www.nuget.org/packages/Qodalis.Cli) | 8046 | ASP.NET Core, .NET 8 |
277
+ | **Node.js** | [@qodalis/cli-server](https://www.npmjs.com/package/@qodalis/cli-server) | 8047 | Express, TypeScript, node-pty |
278
+ | **Python** | [qodalis-cli-server](https://pypi.org/project/qodalis-cli-server/) | 8048 | FastAPI, uvicorn |
279
+
280
+ All three implement the same API surface:
281
+
282
+ | Endpoint | Method | Purpose |
283
+ |----------|--------|---------|
284
+ | `/api/cli/versions` | GET | Version discovery |
285
+ | `/api/v1/cli/commands` | GET | List registered command processors |
286
+ | `/api/v1/cli/execute` | POST | Execute a CLI command |
287
+ | `/api/v1/cli/execute/stream` | POST | Execute with SSE streaming output |
288
+ | `/ws/v1/cli/events` | WS | Server-push event streaming |
289
+ | `/ws/v1/cli/shell` | WS | Interactive PTY shell session |
290
+ | `/api/cli/fs/*` | Various | Filesystem operations (ls, cat, upload, download, mkdir, rm) |
291
+
292
+ ### Connecting to a Server
293
+
294
+ ```typescript
295
+ import { CliOptions } from '@qodalis/cli-core';
296
+
297
+ const options: CliOptions = {
298
+ servers: [
299
+ { name: 'node', url: 'http://localhost:8047' },
300
+ { name: 'dotnet', url: 'http://localhost:8046' },
301
+ { name: 'python', url: 'http://localhost:8048' },
302
+ ],
303
+ };
304
+
305
+ // Angular: <cli [options]="options" />
306
+ // React: <Cli options={options} />
307
+ // Vue: <Cli :options="options" />
308
+ ```
309
+
310
+ ### SSE Streaming Execution
311
+
312
+ The frontend automatically uses SSE streaming when the server supports it, with transparent fallback to the legacy POST endpoint. Streaming processors emit output chunks as they execute rather than buffering the full response.
313
+
314
+ ### Resilience
315
+
316
+ The frontend includes built-in resilience features:
317
+
318
+ - **WebSocket auto-reconnect** with exponential backoff (up to 5 attempts, max 30s delay)
319
+ - **Periodic health checks** for disconnected servers (30s interval)
320
+ - **HTTP retry** on transient fetch failures (1 retry with 1s delay)
321
+ - **Configurable request timeout** per server (default 30s)
322
+
323
+ ### Server Plugins
324
+
325
+ | Plugin | Servers | Description |
326
+ |--------|---------|-------------|
327
+ | **Background Jobs** | .NET, Node.js, Python | Scheduled and recurring job execution with cron/interval support |
328
+ | **Admin Dashboard** | .NET, Node.js | React-based web UI for server management — commands, jobs, plugins, logs, filesystem, events, and an embedded terminal |
329
+ | **AWS Cloud** | .NET, Python | S3, EC2, Lambda, DynamoDB, IAM, ECS, SQS, SNS, CloudWatch with multi-profile credential management |
330
+ | **Data Explorer** | .NET, Node.js, Python | SQL, MongoDB, Redis, Elasticsearch, and custom data source providers |
331
+
332
+ ### Docker
333
+
334
+ Run all three servers with Docker Compose from the [workspace root](https://github.com/qodalis-solutions/cli-workspace):
335
+
336
+ ```bash
337
+ docker compose up --build
338
+ ```
339
+
216
340
  ## Creating a CLI Plugin
217
341
 
218
342
  ### Quick Start
@@ -256,7 +380,7 @@ The tool auto-detects whether you're inside the `web-cli` monorepo:
256
380
  In monorepo mode, the tool also:
257
381
  - Creates `project.json` (Nx build + test targets)
258
382
  - Creates `tsconfig.spec.json` (Karma/Jasmine test config)
259
- - Updates `tsconfig.base.json` with the path alias `@qodalis/cli-<name>` → `dist/<name>`
383
+ - Updates `tsconfig.base.json` with the path alias `@qodalis/cli-<name>` -> `dist/<name>`
260
384
 
261
385
  ### Generated Project Structure
262
386
 
@@ -522,6 +646,81 @@ import { weatherModule } from '@qodalis/cli-weather';
522
646
  </template>
523
647
  ```
524
648
 
649
+ ## Data Explorer
650
+
651
+ The `@qodalis/cli-data-explorer` plugin adds an interactive, full-screen REPL for querying data sources (SQL, MongoDB, Redis, Elasticsearch, and custom providers) directly from the terminal.
652
+
653
+ ### Setup
654
+
655
+ Install and register the plugin, then configure backend servers:
656
+
657
+ ```typescript
658
+ import { dataExplorerModule } from '@qodalis/cli-data-explorer';
659
+
660
+ // Add to your modules array
661
+ const modules = [dataExplorerModule, /* ... other modules */];
662
+
663
+ // Configure at least one server with data explorer providers
664
+ const options: CliOptions = {
665
+ servers: [
666
+ { name: 'node', url: 'http://localhost:8047' },
667
+ { name: 'dotnet', url: 'http://localhost:8046' },
668
+ { name: 'python', url: 'http://localhost:8048' },
669
+ ],
670
+ };
671
+ ```
672
+
673
+ Or install at runtime without a rebuild:
674
+
675
+ ```bash
676
+ pkg add data-explorer
677
+ ```
678
+
679
+ ### Usage
680
+
681
+ ```bash
682
+ data-explorer
683
+ ```
684
+
685
+ Select a server and data source, then enter the full-screen REPL:
686
+
687
+ ```
688
+ data-explorer> SELECT * FROM users WHERE active = true;
689
+
690
+ 3 rows (12ms)
691
+ ┌────┬───────┬──────────────┐
692
+ │ id │ name │ email │
693
+ ├────┼───────┼──────────────┤
694
+ │ 1 │ Alice │ alice@ex.com │
695
+ │ 2 │ Bob │ bob@ex.com │
696
+ │ 3 │ Carol │ carol@ex.com │
697
+ └────┴───────┴──────────────┘
698
+
699
+ data-explorer> \format json
700
+ Output format set to: json
701
+
702
+ data-explorer> db.users.find({"age": {"$gt": 25}})
703
+ [
704
+ { "_id": "abc", "name": "Alice", "age": 30 },
705
+ { "_id": "def", "name": "Bob", "age": 28 }
706
+ ]
707
+ ```
708
+
709
+ ### REPL Commands
710
+
711
+ | Command | Description |
712
+ |---------|-------------|
713
+ | `\format <table\|json\|csv\|raw>` | Switch output format |
714
+ | `\schema` | Show database schema (tables, columns, types) |
715
+ | `\templates` | List available query templates |
716
+ | `\use <name>` | Load a template query |
717
+ | `\history` | Show query history |
718
+ | `\clear` | Clear screen |
719
+ | `\help` | Show all commands |
720
+ | `\quit` / `\q` | Exit |
721
+
722
+ Use **Up/Down arrows** for history navigation, **Escape** or **Ctrl+C** to exit.
723
+
525
724
  ## Extending with Inline Commands
526
725
 
527
726
  For quick one-off commands without creating a full plugin, implement `ICliCommandProcessor` directly in your app:
@@ -581,16 +780,21 @@ await engine.start();
581
780
  ## Features
582
781
 
583
782
  - **Multi-framework** — Angular, React, Vue, or vanilla JS
783
+ - **38 official plugins** — 24 utility, 6 games, 10 language packs
584
784
  - **Command chaining** with `&&`, `||`, `|`, and `>>` operators
585
785
  - **Command history** with arrow key navigation
586
786
  - **Tab-like completions** and keyboard shortcuts (`Ctrl+C`, `Ctrl+L`, `Escape`)
587
- - **Theming** with built-in themes and custom color support
787
+ - **29 built-in themes** with custom color support
788
+ - **Tabs & split panes** — multiple terminals in tabs with horizontal splitting
588
789
  - **User sessions** with multi-user support
589
790
  - **State persistence** across sessions
590
791
  - **Interactive prompts** with live preview (select menus with real-time feedback)
591
- - **Full-screen mode API** for rich TUI commands
792
+ - **Full-screen mode API** for rich TUI commands (games, editors, pagers)
592
793
  - **Progress bars, spinners, and text animations**
593
794
  - **Runtime package installation** from npm
795
+ - **Server integration** with SSE streaming, auto-reconnect, and health checks
796
+ - **Admin dashboard** for server management (React SPA)
797
+ - **Data explorer** for SQL, MongoDB, Redis, and Elasticsearch
594
798
 
595
799
  ## Contributing
596
800
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qodalis/cli-core",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.10",
4
4
  "description": "Core interfaces, types, and utilities for the @qodalis CLI ecosystem.",
5
5
  "author": "Nicolae Lupei, Qodalis Solutions",
6
6
  "license": "MIT",