@qodalis/cli-core 2.0.0-beta.2 → 2.0.0-beta.21

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
 
@@ -123,7 +136,7 @@ const options = {
123
136
  | `help` | `man` | Show all commands or help for a specific command |
124
137
  | `version` | `ver` | Display CLI version and documentation link |
125
138
  | `hotkeys` | `shortcuts`, `keys` | Show keyboard shortcuts |
126
- | `history` | `hist` | Browse and clear command history |
139
+ | `history` | `hist` | Browse and clear your command history (per user with the users plugin) |
127
140
  | `theme` | `themes` | Apply, customize, and save terminal themes (interactive selection with live preview) |
128
141
  | `feedback` | `support` | Report bugs or request features on GitHub |
129
142
  | `pkg` | `packages` | Install, update, remove, and browse packages |
@@ -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,90 @@ 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
+ | `/api/qcli/mcp` | POST | MCP endpoint for AI clients (opt-in) |
292
+
293
+ ### Connecting to a Server
294
+
295
+ ```typescript
296
+ import { CliOptions } from '@qodalis/cli-core';
297
+
298
+ const options: CliOptions = {
299
+ servers: [
300
+ { name: 'node', url: 'http://localhost:8047' },
301
+ { name: 'dotnet', url: 'http://localhost:8046' },
302
+ { name: 'python', url: 'http://localhost:8048' },
303
+ ],
304
+ };
305
+
306
+ // Angular: <cli [options]="options" />
307
+ // React: <Cli options={options} />
308
+ // Vue: <Cli :options="options" />
309
+ ```
310
+
311
+ ### SSE Streaming Execution
312
+
313
+ 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.
314
+
315
+ ### Resilience
316
+
317
+ The frontend includes built-in resilience features:
318
+
319
+ - **WebSocket auto-reconnect** with exponential backoff (up to 5 attempts, max 30s delay)
320
+ - **Periodic health checks** for disconnected servers (30s interval)
321
+ - **HTTP retry** on transient fetch failures (1 retry with 1s delay)
322
+ - **Configurable request timeout** per server (default 30s)
323
+
324
+ ### MCP
325
+
326
+ Each server can expose the whole system to AI clients such as Claude Code over the [Model Context Protocol](https://modelcontextprotocol.io) at `POST /api/qcli/mcp` (opt-in): CLI commands, the filesystem API, the data explorer, jobs and plugin-contributed tools, each with the caller's permissions. It works with or without the users plugin, whose `token create` command issues the API tokens MCP clients sign in with:
327
+
328
+ ```bash
329
+ # direct HTTP
330
+ claude mcp add --transport http qcli http://localhost:8047/api/qcli/mcp --header "Authorization: Bearer <token>"
331
+ # or the local stdio proxy @qodalis/mcp-cli (token or user/password, read-only mode, tool filters)
332
+ claude mcp add qcli -e QCLI_URL=http://localhost:8047 -e QCLI_TOKEN=<token> -- npx -y @qodalis/mcp-cli
333
+ ```
334
+
335
+ See [MCP endpoint](https://cli.qodalis.com/docs/server-integration#mcp-endpoint) for enabling it, the tools and permissions, and client setup.
336
+
337
+ ### Server Plugins
338
+
339
+ | Plugin | Servers | Description |
340
+ |--------|---------|-------------|
341
+ | **Background Jobs** | .NET, Node.js, Python | Scheduled and recurring job execution with cron/interval support |
342
+ | **Admin Dashboard** | .NET, Node.js | React-based web UI for server management — commands, jobs, plugins, logs, filesystem, events, and an embedded terminal |
343
+ | **AWS Cloud** | .NET, Python | S3, EC2, Lambda, DynamoDB, IAM, ECS, SQS, SNS, CloudWatch with multi-profile credential management |
344
+ | **Data Explorer** | .NET, Node.js, Python | SQL, MongoDB, Redis, Elasticsearch, and custom data source providers |
345
+
346
+ ### Docker
347
+
348
+ Run all three servers with Docker Compose from the [workspace root](https://github.com/qodalis-solutions/cli-workspace):
349
+
350
+ ```bash
351
+ docker compose up --build
352
+ ```
353
+
216
354
  ## Creating a CLI Plugin
217
355
 
218
356
  ### Quick Start
@@ -256,7 +394,7 @@ The tool auto-detects whether you're inside the `web-cli` monorepo:
256
394
  In monorepo mode, the tool also:
257
395
  - Creates `project.json` (Nx build + test targets)
258
396
  - Creates `tsconfig.spec.json` (Karma/Jasmine test config)
259
- - Updates `tsconfig.base.json` with the path alias `@qodalis/cli-<name>` → `dist/<name>`
397
+ - Updates `tsconfig.base.json` with the path alias `@qodalis/cli-<name>` -> `dist/<name>`
260
398
 
261
399
  ### Generated Project Structure
262
400
 
@@ -522,6 +660,81 @@ import { weatherModule } from '@qodalis/cli-weather';
522
660
  </template>
523
661
  ```
524
662
 
663
+ ## Data Explorer
664
+
665
+ 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.
666
+
667
+ ### Setup
668
+
669
+ Install and register the plugin, then configure backend servers:
670
+
671
+ ```typescript
672
+ import { dataExplorerModule } from '@qodalis/cli-data-explorer';
673
+
674
+ // Add to your modules array
675
+ const modules = [dataExplorerModule, /* ... other modules */];
676
+
677
+ // Configure at least one server with data explorer providers
678
+ const options: CliOptions = {
679
+ servers: [
680
+ { name: 'node', url: 'http://localhost:8047' },
681
+ { name: 'dotnet', url: 'http://localhost:8046' },
682
+ { name: 'python', url: 'http://localhost:8048' },
683
+ ],
684
+ };
685
+ ```
686
+
687
+ Or install at runtime without a rebuild:
688
+
689
+ ```bash
690
+ pkg add data-explorer
691
+ ```
692
+
693
+ ### Usage
694
+
695
+ ```bash
696
+ data-explorer
697
+ ```
698
+
699
+ Select a server and data source, then enter the full-screen REPL:
700
+
701
+ ```
702
+ data-explorer> SELECT * FROM users WHERE active = true;
703
+
704
+ 3 rows (12ms)
705
+ ┌────┬───────┬──────────────┐
706
+ │ id │ name │ email │
707
+ ├────┼───────┼──────────────┤
708
+ │ 1 │ Alice │ alice@ex.com │
709
+ │ 2 │ Bob │ bob@ex.com │
710
+ │ 3 │ Carol │ carol@ex.com │
711
+ └────┴───────┴──────────────┘
712
+
713
+ data-explorer> \format json
714
+ Output format set to: json
715
+
716
+ data-explorer> db.users.find({"age": {"$gt": 25}})
717
+ [
718
+ { "_id": "abc", "name": "Alice", "age": 30 },
719
+ { "_id": "def", "name": "Bob", "age": 28 }
720
+ ]
721
+ ```
722
+
723
+ ### REPL Commands
724
+
725
+ | Command | Description |
726
+ |---------|-------------|
727
+ | `\format <table\|json\|csv\|raw>` | Switch output format |
728
+ | `\schema` | Show database schema (tables, columns, types) |
729
+ | `\templates` | List available query templates |
730
+ | `\use <name>` | Load a template query |
731
+ | `\history` | Show query history |
732
+ | `\clear` | Clear screen |
733
+ | `\help` | Show all commands |
734
+ | `\quit` / `\q` | Exit |
735
+
736
+ Use **Up/Down arrows** for history navigation, **Escape** or **Ctrl+C** to exit.
737
+
525
738
  ## Extending with Inline Commands
526
739
 
527
740
  For quick one-off commands without creating a full plugin, implement `ICliCommandProcessor` directly in your app:
@@ -581,16 +794,21 @@ await engine.start();
581
794
  ## Features
582
795
 
583
796
  - **Multi-framework** — Angular, React, Vue, or vanilla JS
797
+ - **38 official plugins** — 24 utility, 6 games, 10 language packs
584
798
  - **Command chaining** with `&&`, `||`, `|`, and `>>` operators
585
- - **Command history** with arrow key navigation
586
- - **Tab-like completions** and keyboard shortcuts (`Ctrl+C`, `Ctrl+L`, `Escape`)
587
- - **Theming** with built-in themes and custom color support
799
+ - **Command history** with arrow key navigation, per user when the users plugin is used (like `~/.bash_history`)
800
+ - **Tab-like completions** and readline keyboard shortcuts (`Ctrl+C`, `Ctrl+L`, `Escape`, `Ctrl+A/E`, `Ctrl+U/K/W/Y`, Home/End; `hotkeys` lists them)
801
+ - **29 built-in themes** with custom color support
802
+ - **Tabs & split panes** — multiple terminals in tabs with horizontal splitting
588
803
  - **User sessions** with multi-user support
589
804
  - **State persistence** across sessions
590
805
  - **Interactive prompts** with live preview (select menus with real-time feedback)
591
- - **Full-screen mode API** for rich TUI commands
806
+ - **Full-screen mode API** for rich TUI commands (games, editors, pagers)
592
807
  - **Progress bars, spinners, and text animations**
593
808
  - **Runtime package installation** from npm
809
+ - **Server integration** with SSE streaming, auto-reconnect, and health checks
810
+ - **Admin dashboard** for server management (React SPA)
811
+ - **Data explorer** for SQL, MongoDB, Redis, and Elasticsearch
594
812
 
595
813
  ## Contributing
596
814
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qodalis/cli-core",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.21",
4
4
  "description": "Core interfaces, types, and utilities for the @qodalis CLI ecosystem.",
5
5
  "author": "Nicolae Lupei, Qodalis Solutions",
6
6
  "license": "MIT",