@qodalis/react-cli 2.0.0-beta.8 → 2.0.0-rc.1
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 +227 -19
- package/dist/index.d.mts +36 -17
- package/dist/index.d.ts +36 -17
- package/dist/index.js +227 -586
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +264 -590
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +7 -6
- package/dist/styles.css +8 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Add styles to `angular.json`:
|
|
|
66
66
|
```json
|
|
67
67
|
{
|
|
68
68
|
"styles": [
|
|
69
|
-
"node_modules/@qodalis/angular-cli/src/assets/styles.
|
|
69
|
+
"node_modules/@qodalis/angular-cli/src/assets/styles.css"
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
```
|
|
@@ -86,6 +86,7 @@ npm install @qodalis/react-cli
|
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
```tsx
|
|
89
|
+
import '@qodalis/react-cli/styles.css';
|
|
89
90
|
import { Cli } from '@qodalis/react-cli';
|
|
90
91
|
|
|
91
92
|
function App() {
|
|
@@ -101,6 +102,7 @@ npm install @qodalis/vue-cli
|
|
|
101
102
|
|
|
102
103
|
```vue
|
|
103
104
|
<script setup lang="ts">
|
|
105
|
+
import '@qodalis/vue-cli/styles.css';
|
|
104
106
|
import { Cli } from '@qodalis/vue-cli';
|
|
105
107
|
</script>
|
|
106
108
|
|
|
@@ -115,13 +117,10 @@ Pass options to customize the terminal:
|
|
|
115
117
|
|
|
116
118
|
```typescript
|
|
117
119
|
const options = {
|
|
118
|
-
|
|
120
|
+
welcome: {
|
|
119
121
|
message: '-- your custom welcome message --',
|
|
120
122
|
show: 'daily', // 'never', 'once', 'daily', 'always'
|
|
121
123
|
},
|
|
122
|
-
usersModule: {
|
|
123
|
-
enabled: true,
|
|
124
|
-
},
|
|
125
124
|
};
|
|
126
125
|
```
|
|
127
126
|
|
|
@@ -134,7 +133,7 @@ const options = {
|
|
|
134
133
|
| `help` | `man` | Show all commands or help for a specific command |
|
|
135
134
|
| `version` | `ver` | Display CLI version and documentation link |
|
|
136
135
|
| `hotkeys` | `shortcuts`, `keys` | Show keyboard shortcuts |
|
|
137
|
-
| `history` | `hist` | Browse and clear command history |
|
|
136
|
+
| `history` | `hist` | Browse and clear your command history (per user with the users plugin) |
|
|
138
137
|
| `theme` | `themes` | Apply, customize, and save terminal themes (interactive selection with live preview) |
|
|
139
138
|
| `feedback` | `support` | Report bugs or request features on GitHub |
|
|
140
139
|
| `pkg` | `packages` | Install, update, remove, and browse packages |
|
|
@@ -203,19 +202,60 @@ pkg source set unpkg # Set package source directly
|
|
|
203
202
|
|
|
204
203
|
### Available Packages
|
|
205
204
|
|
|
205
|
+
#### Utility Plugins
|
|
206
|
+
|
|
206
207
|
| Package | Command | Description |
|
|
207
208
|
|---------|---------|-------------|
|
|
209
|
+
| [@qodalis/cli-data-explorer](https://www.npmjs.com/package/@qodalis/cli-data-explorer) | `data-explorer` | Interactive query console for SQL, MongoDB, Redis, Elasticsearch |
|
|
208
210
|
| [@qodalis/cli-guid](https://www.npmjs.com/package/@qodalis/cli-guid) | `guid` | Generate and validate UUIDs |
|
|
209
|
-
| [@qodalis/cli-string](https://www.npmjs.com/package/@qodalis/cli-string) | `string` | String manipulation (case, trim, reverse, slug, wc, etc.) |
|
|
210
|
-
| [@qodalis/cli-curl](https://www.npmjs.com/package/@qodalis/cli-curl) | `curl` | HTTP requests (GET, POST, PUT, DELETE) |
|
|
211
|
-
| [@qodalis/cli-todo](https://www.npmjs.com/package/@qodalis/cli-todo) | `todo` | Task management |
|
|
212
211
|
| [@qodalis/cli-regex](https://www.npmjs.com/package/@qodalis/cli-regex) | `regex` | Regular expression testing |
|
|
213
212
|
| [@qodalis/cli-qr](https://www.npmjs.com/package/@qodalis/cli-qr) | `qr` | QR code generation |
|
|
214
213
|
| [@qodalis/cli-speed-test](https://www.npmjs.com/package/@qodalis/cli-speed-test) | `speed-test` | Internet speed test |
|
|
215
|
-
| [@qodalis/cli-
|
|
214
|
+
| [@qodalis/cli-curl](https://www.npmjs.com/package/@qodalis/cli-curl) | `curl` | HTTP requests (GET, POST, PUT, DELETE) |
|
|
215
|
+
| [@qodalis/cli-password-generator](https://www.npmjs.com/package/@qodalis/cli-password-generator) | `generate-password` | Password generation |
|
|
216
|
+
| [@qodalis/cli-string](https://www.npmjs.com/package/@qodalis/cli-string) | `string` | String manipulation (case, trim, reverse, slug, wc, etc.) |
|
|
217
|
+
| [@qodalis/cli-todo](https://www.npmjs.com/package/@qodalis/cli-todo) | `todo` | Task management |
|
|
216
218
|
| [@qodalis/cli-browser-storage](https://www.npmjs.com/package/@qodalis/cli-browser-storage) | `local-storage`, `cookies` | Browser storage operations |
|
|
217
219
|
| [@qodalis/cli-text-to-image](https://www.npmjs.com/package/@qodalis/cli-text-to-image) | `text-to-image` | Generate images from text |
|
|
218
|
-
| [@qodalis/cli-
|
|
220
|
+
| [@qodalis/cli-files](https://www.npmjs.com/package/@qodalis/cli-files) | `ls`, `cat`, `nano`, `mkdir`, `touch`, `rm` | Virtual filesystem |
|
|
221
|
+
| [@qodalis/cli-yesno](https://www.npmjs.com/package/@qodalis/cli-yesno) | `yesno` | Interactive yes/no confirmation prompts |
|
|
222
|
+
| [@qodalis/cli-server-logs](https://www.npmjs.com/package/@qodalis/cli-server-logs) | `server logs` | Live server log streaming with level filtering |
|
|
223
|
+
| [@qodalis/cli-server-jobs](https://www.npmjs.com/package/@qodalis/cli-server-jobs) | `server jobs` | Manage server-side background jobs |
|
|
224
|
+
| [@qodalis/cli-users](https://www.npmjs.com/package/@qodalis/cli-users) | `whoami`, `adduser`, `login` | User management and authentication |
|
|
225
|
+
| [@qodalis/cli-chart](https://www.npmjs.com/package/@qodalis/cli-chart) | `chart` | Render bar, line, and sparkline charts |
|
|
226
|
+
| [@qodalis/cli-cron](https://www.npmjs.com/package/@qodalis/cli-cron) | `cron` | Schedule and manage recurring commands |
|
|
227
|
+
| [@qodalis/cli-csv](https://www.npmjs.com/package/@qodalis/cli-csv) | `csv` | Parse, filter, sort, and convert CSV data |
|
|
228
|
+
| [@qodalis/cli-markdown](https://www.npmjs.com/package/@qodalis/cli-markdown) | `md` | Render Markdown content in the terminal |
|
|
229
|
+
| [@qodalis/cli-encode](https://www.npmjs.com/package/@qodalis/cli-encode) | `base64`, `url`, `hex`, `html` | Encode/decode Base64, URL, hex, HTML entities |
|
|
230
|
+
| [@qodalis/cli-scp](https://www.npmjs.com/package/@qodalis/cli-scp) | `scp` | Secure copy — transfer files between local and remote |
|
|
231
|
+
| [@qodalis/cli-wget](https://www.npmjs.com/package/@qodalis/cli-wget) | `wget` | Download files from URLs |
|
|
232
|
+
| [@qodalis/cli-stopwatch](https://www.npmjs.com/package/@qodalis/cli-stopwatch) | `stopwatch` | Interactive stopwatch and countdown timer |
|
|
233
|
+
|
|
234
|
+
#### Game Plugins
|
|
235
|
+
|
|
236
|
+
| Package | Command | Description |
|
|
237
|
+
|---------|---------|-------------|
|
|
238
|
+
| [@qodalis/cli-snake](https://www.npmjs.com/package/@qodalis/cli-snake) | `snake` | Classic Snake game |
|
|
239
|
+
| [@qodalis/cli-tetris](https://www.npmjs.com/package/@qodalis/cli-tetris) | `tetris` | Tetris |
|
|
240
|
+
| [@qodalis/cli-2048](https://www.npmjs.com/package/@qodalis/cli-2048) | `2048` | 2048 sliding puzzle |
|
|
241
|
+
| [@qodalis/cli-minesweeper](https://www.npmjs.com/package/@qodalis/cli-minesweeper) | `minesweeper` | Minesweeper |
|
|
242
|
+
| [@qodalis/cli-wordle](https://www.npmjs.com/package/@qodalis/cli-wordle) | `wordle` | Wordle word game |
|
|
243
|
+
| [@qodalis/cli-sudoku](https://www.npmjs.com/package/@qodalis/cli-sudoku) | `sudoku` | Sudoku puzzle |
|
|
244
|
+
|
|
245
|
+
#### Language Packs
|
|
246
|
+
|
|
247
|
+
| Package | Language |
|
|
248
|
+
|---------|----------|
|
|
249
|
+
| [@qodalis/cli-lang-es](https://www.npmjs.com/package/@qodalis/cli-lang-es) | Spanish |
|
|
250
|
+
| [@qodalis/cli-lang-fr](https://www.npmjs.com/package/@qodalis/cli-lang-fr) | French |
|
|
251
|
+
| [@qodalis/cli-lang-de](https://www.npmjs.com/package/@qodalis/cli-lang-de) | German |
|
|
252
|
+
| [@qodalis/cli-lang-it](https://www.npmjs.com/package/@qodalis/cli-lang-it) | Italian |
|
|
253
|
+
| [@qodalis/cli-lang-pt](https://www.npmjs.com/package/@qodalis/cli-lang-pt) | Portuguese |
|
|
254
|
+
| [@qodalis/cli-lang-ro](https://www.npmjs.com/package/@qodalis/cli-lang-ro) | Romanian |
|
|
255
|
+
| [@qodalis/cli-lang-ru](https://www.npmjs.com/package/@qodalis/cli-lang-ru) | Russian |
|
|
256
|
+
| [@qodalis/cli-lang-zh](https://www.npmjs.com/package/@qodalis/cli-lang-zh) | Chinese |
|
|
257
|
+
| [@qodalis/cli-lang-ja](https://www.npmjs.com/package/@qodalis/cli-lang-ja) | Japanese |
|
|
258
|
+
| [@qodalis/cli-lang-ko](https://www.npmjs.com/package/@qodalis/cli-lang-ko) | Korean |
|
|
219
259
|
|
|
220
260
|
Any npm package with UMD support can also be loaded:
|
|
221
261
|
|
|
@@ -224,6 +264,90 @@ pkg add lodash
|
|
|
224
264
|
eval _.map([1, 2, 3], n => n * 2)
|
|
225
265
|
```
|
|
226
266
|
|
|
267
|
+
## Server Integration
|
|
268
|
+
|
|
269
|
+
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:
|
|
270
|
+
|
|
271
|
+
| Server | Package | Port | Tech Stack |
|
|
272
|
+
|--------|---------|------|------------|
|
|
273
|
+
| **.NET** | [Qodalis.Cli](https://www.nuget.org/packages/Qodalis.Cli) | 8046 | ASP.NET Core, .NET 8 |
|
|
274
|
+
| **Node.js** | [@qodalis/cli-server](https://www.npmjs.com/package/@qodalis/cli-server) | 8047 | Express, TypeScript, node-pty |
|
|
275
|
+
| **Python** | [qodalis-cli-server](https://pypi.org/project/qodalis-cli-server/) | 8048 | FastAPI, uvicorn |
|
|
276
|
+
|
|
277
|
+
All three implement the same API surface:
|
|
278
|
+
|
|
279
|
+
| Endpoint | Method | Purpose |
|
|
280
|
+
|----------|--------|---------|
|
|
281
|
+
| `/api/cli/versions` | GET | Version discovery |
|
|
282
|
+
| `/api/v1/cli/commands` | GET | List registered command processors |
|
|
283
|
+
| `/api/v1/cli/execute` | POST | Execute a CLI command |
|
|
284
|
+
| `/api/v1/cli/execute/stream` | POST | Execute with SSE streaming output |
|
|
285
|
+
| `/ws/v1/cli/events` | WS | Server-push event streaming |
|
|
286
|
+
| `/ws/v1/cli/shell` | WS | Interactive PTY shell session |
|
|
287
|
+
| `/api/cli/fs/*` | Various | Filesystem operations (ls, cat, upload, download, mkdir, rm) |
|
|
288
|
+
| `/api/qcli/mcp` | POST | MCP endpoint for AI clients (opt-in) |
|
|
289
|
+
|
|
290
|
+
### Connecting to a Server
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
import { CliOptions } from '@qodalis/cli-core';
|
|
294
|
+
|
|
295
|
+
const options: CliOptions = {
|
|
296
|
+
servers: [
|
|
297
|
+
{ name: 'node', url: 'http://localhost:8047' },
|
|
298
|
+
{ name: 'dotnet', url: 'http://localhost:8046' },
|
|
299
|
+
{ name: 'python', url: 'http://localhost:8048' },
|
|
300
|
+
],
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
// Angular: <cli [options]="options" />
|
|
304
|
+
// React: <Cli options={options} />
|
|
305
|
+
// Vue: <Cli :options="options" />
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### SSE Streaming Execution
|
|
309
|
+
|
|
310
|
+
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.
|
|
311
|
+
|
|
312
|
+
### Resilience
|
|
313
|
+
|
|
314
|
+
The frontend includes built-in resilience features:
|
|
315
|
+
|
|
316
|
+
- **WebSocket auto-reconnect** with exponential backoff (up to 5 attempts, max 30s delay)
|
|
317
|
+
- **Periodic health checks** for disconnected servers (30s interval)
|
|
318
|
+
- **HTTP retry** on transient fetch failures (1 retry with 1s delay)
|
|
319
|
+
- **Configurable request timeout** per server (default 30s)
|
|
320
|
+
|
|
321
|
+
### MCP
|
|
322
|
+
|
|
323
|
+
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:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# direct HTTP
|
|
327
|
+
claude mcp add --transport http qcli http://localhost:8047/api/qcli/mcp --header "Authorization: Bearer <token>"
|
|
328
|
+
# or the local stdio proxy @qodalis/mcp-cli (token or user/password, read-only mode, tool filters)
|
|
329
|
+
claude mcp add qcli -e QCLI_URL=http://localhost:8047 -e QCLI_TOKEN=<token> -- npx -y @qodalis/mcp-cli
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
See [MCP endpoint](https://cli.qodalis.com/docs/server-integration#mcp-endpoint) for enabling it, the tools and permissions, and client setup.
|
|
333
|
+
|
|
334
|
+
### Server Plugins
|
|
335
|
+
|
|
336
|
+
| Plugin | Servers | Description |
|
|
337
|
+
|--------|---------|-------------|
|
|
338
|
+
| **Background Jobs** | .NET, Node.js, Python | Scheduled and recurring job execution with cron/interval support |
|
|
339
|
+
| **Admin Dashboard** | .NET, Node.js | React-based web UI for server management — commands, jobs, plugins, logs, filesystem, events, and an embedded terminal |
|
|
340
|
+
| **AWS Cloud** | .NET, Python | S3, EC2, Lambda, DynamoDB, IAM, ECS, SQS, SNS, CloudWatch with multi-profile credential management |
|
|
341
|
+
| **Data Explorer** | .NET, Node.js, Python | SQL, MongoDB, Redis, Elasticsearch, and custom data source providers |
|
|
342
|
+
|
|
343
|
+
### Docker
|
|
344
|
+
|
|
345
|
+
Run all three servers with Docker Compose from the [workspace root](https://github.com/qodalis-solutions/cli-workspace):
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
docker compose up --build
|
|
349
|
+
```
|
|
350
|
+
|
|
227
351
|
## Creating a CLI Plugin
|
|
228
352
|
|
|
229
353
|
### Quick Start
|
|
@@ -267,7 +391,7 @@ The tool auto-detects whether you're inside the `web-cli` monorepo:
|
|
|
267
391
|
In monorepo mode, the tool also:
|
|
268
392
|
- Creates `project.json` (Nx build + test targets)
|
|
269
393
|
- Creates `tsconfig.spec.json` (Karma/Jasmine test config)
|
|
270
|
-
- Updates `tsconfig.base.json` with the path alias `@qodalis/cli-<name>`
|
|
394
|
+
- Updates `tsconfig.base.json` with the path alias `@qodalis/cli-<name>` -> `dist/<name>`
|
|
271
395
|
|
|
272
396
|
### Generated Project Structure
|
|
273
397
|
|
|
@@ -533,6 +657,81 @@ import { weatherModule } from '@qodalis/cli-weather';
|
|
|
533
657
|
</template>
|
|
534
658
|
```
|
|
535
659
|
|
|
660
|
+
## Data Explorer
|
|
661
|
+
|
|
662
|
+
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.
|
|
663
|
+
|
|
664
|
+
### Setup
|
|
665
|
+
|
|
666
|
+
Install and register the plugin, then configure backend servers:
|
|
667
|
+
|
|
668
|
+
```typescript
|
|
669
|
+
import { dataExplorerModule } from '@qodalis/cli-data-explorer';
|
|
670
|
+
|
|
671
|
+
// Add to your modules array
|
|
672
|
+
const modules = [dataExplorerModule, /* ... other modules */];
|
|
673
|
+
|
|
674
|
+
// Configure at least one server with data explorer providers
|
|
675
|
+
const options: CliOptions = {
|
|
676
|
+
servers: [
|
|
677
|
+
{ name: 'node', url: 'http://localhost:8047' },
|
|
678
|
+
{ name: 'dotnet', url: 'http://localhost:8046' },
|
|
679
|
+
{ name: 'python', url: 'http://localhost:8048' },
|
|
680
|
+
],
|
|
681
|
+
};
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
Or install at runtime without a rebuild:
|
|
685
|
+
|
|
686
|
+
```bash
|
|
687
|
+
pkg add data-explorer
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
### Usage
|
|
691
|
+
|
|
692
|
+
```bash
|
|
693
|
+
data-explorer
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
Select a server and data source, then enter the full-screen REPL:
|
|
697
|
+
|
|
698
|
+
```
|
|
699
|
+
data-explorer> SELECT * FROM users WHERE active = true;
|
|
700
|
+
|
|
701
|
+
3 rows (12ms)
|
|
702
|
+
┌────┬───────┬──────────────┐
|
|
703
|
+
│ id │ name │ email │
|
|
704
|
+
├────┼───────┼──────────────┤
|
|
705
|
+
│ 1 │ Alice │ alice@ex.com │
|
|
706
|
+
│ 2 │ Bob │ bob@ex.com │
|
|
707
|
+
│ 3 │ Carol │ carol@ex.com │
|
|
708
|
+
└────┴───────┴──────────────┘
|
|
709
|
+
|
|
710
|
+
data-explorer> \format json
|
|
711
|
+
Output format set to: json
|
|
712
|
+
|
|
713
|
+
data-explorer> db.users.find({"age": {"$gt": 25}})
|
|
714
|
+
[
|
|
715
|
+
{ "_id": "abc", "name": "Alice", "age": 30 },
|
|
716
|
+
{ "_id": "def", "name": "Bob", "age": 28 }
|
|
717
|
+
]
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### REPL Commands
|
|
721
|
+
|
|
722
|
+
| Command | Description |
|
|
723
|
+
|---------|-------------|
|
|
724
|
+
| `\format <table\|json\|csv\|raw>` | Switch output format |
|
|
725
|
+
| `\schema` | Show database schema (tables, columns, types) |
|
|
726
|
+
| `\templates` | List available query templates |
|
|
727
|
+
| `\use <name>` | Load a template query |
|
|
728
|
+
| `\history` | Show query history |
|
|
729
|
+
| `\clear` | Clear screen |
|
|
730
|
+
| `\help` | Show all commands |
|
|
731
|
+
| `\quit` / `\q` | Exit |
|
|
732
|
+
|
|
733
|
+
Use **Up/Down arrows** for history navigation, **Escape** or **Ctrl+C** to exit.
|
|
734
|
+
|
|
536
735
|
## Extending with Inline Commands
|
|
537
736
|
|
|
538
737
|
For quick one-off commands without creating a full plugin, implement `ICliCommandProcessor` directly in your app:
|
|
@@ -559,7 +758,7 @@ export class GreetCommandProcessor implements ICliCommandProcessor {
|
|
|
559
758
|
}
|
|
560
759
|
```
|
|
561
760
|
|
|
562
|
-
|
|
761
|
+
Wrap it in an `ICliModule` and register the module with your framework (Angular: `resolveCliModuleProvider(myModule)`, React/Vue: the `modules` prop, vanilla: `engine.registerModule(myModule)`):
|
|
563
762
|
|
|
564
763
|
```typescript
|
|
565
764
|
const myModule: ICliModule = {
|
|
@@ -582,26 +781,35 @@ For advanced use cases or non-framework environments, use `CliEngine` directly:
|
|
|
582
781
|
import { CliEngine } from '@qodalis/cli';
|
|
583
782
|
|
|
584
783
|
const engine = new CliEngine(document.getElementById('terminal')!, {
|
|
585
|
-
|
|
784
|
+
welcome: { message: 'Welcome!', show: 'always' },
|
|
586
785
|
});
|
|
587
786
|
|
|
588
|
-
engine.
|
|
787
|
+
engine.registerModule({
|
|
788
|
+
apiVersion: 2,
|
|
789
|
+
name: 'my-app-commands',
|
|
790
|
+
processors: [new GreetCommandProcessor()],
|
|
791
|
+
});
|
|
589
792
|
await engine.start();
|
|
590
793
|
```
|
|
591
794
|
|
|
592
795
|
## Features
|
|
593
796
|
|
|
594
797
|
- **Multi-framework** — Angular, React, Vue, or vanilla JS
|
|
798
|
+
- **38 official plugins** — 24 utility, 6 games, 10 language packs
|
|
595
799
|
- **Command chaining** with `&&`, `||`, `|`, and `>>` operators
|
|
596
|
-
- **Command history** with arrow key navigation
|
|
597
|
-
- **Tab-like completions** and keyboard shortcuts (`Ctrl+C`, `Ctrl+L`, `Escape`)
|
|
598
|
-
- **
|
|
800
|
+
- **Command history** with arrow key navigation, per user when the users plugin is used (like `~/.bash_history`)
|
|
801
|
+
- **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)
|
|
802
|
+
- **29 built-in themes** with custom color support
|
|
803
|
+
- **Tabs & split panes** — multiple terminals in tabs with horizontal splitting
|
|
599
804
|
- **User sessions** with multi-user support
|
|
600
805
|
- **State persistence** across sessions
|
|
601
806
|
- **Interactive prompts** with live preview (select menus with real-time feedback)
|
|
602
|
-
- **Full-screen mode API** for rich TUI commands
|
|
807
|
+
- **Full-screen mode API** for rich TUI commands (games, editors, pagers)
|
|
603
808
|
- **Progress bars, spinners, and text animations**
|
|
604
809
|
- **Runtime package installation** from npm
|
|
810
|
+
- **Server integration** with SSE streaming, auto-reconnect, and health checks
|
|
811
|
+
- **Admin dashboard** for server management (React SPA)
|
|
812
|
+
- **Data explorer** for SQL, MongoDB, Redis, and Elasticsearch
|
|
605
813
|
|
|
606
814
|
## Contributing
|
|
607
815
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { RefObject } from 'react';
|
|
3
|
-
import { ICliModule,
|
|
4
|
-
import { CliEngineOptions, CliEngine } from '@qodalis/cli';
|
|
3
|
+
import { ICliModule, CliEngineSnapshot, CliPanelConfig, CliPanelPosition, ICliPanelRef } from '@qodalis/cli-core';
|
|
4
|
+
import { CliEngineOptions, CliEngine, CreateCliEngineConfig } from '@qodalis/cli';
|
|
5
5
|
export { CliEngine, CliEngineOptions } from '@qodalis/cli';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
interface CliProps {
|
|
9
8
|
modules?: ICliModule[];
|
|
10
|
-
processors?: ICliCommandProcessor[];
|
|
11
9
|
options?: CliEngineOptions;
|
|
12
10
|
services?: Record<string, any>;
|
|
13
11
|
snapshot?: CliEngineSnapshot;
|
|
@@ -15,30 +13,55 @@ interface CliProps {
|
|
|
15
13
|
style?: React__default.CSSProperties;
|
|
16
14
|
className?: string;
|
|
17
15
|
}
|
|
18
|
-
declare function Cli({ modules,
|
|
16
|
+
declare function Cli({ modules, options, services, snapshot, onReady, style, className, }: CliProps): React__default.JSX.Element;
|
|
19
17
|
|
|
20
18
|
interface CliPanelOptions extends CliEngineOptions, CliPanelConfig {
|
|
21
19
|
}
|
|
22
20
|
interface CliPanelProps {
|
|
23
21
|
options?: CliPanelOptions;
|
|
24
22
|
modules?: ICliModule[];
|
|
25
|
-
processors?: ICliCommandProcessor[];
|
|
26
23
|
services?: Record<string, any>;
|
|
27
24
|
onClose?: () => void;
|
|
28
25
|
style?: React__default.CSSProperties;
|
|
29
26
|
className?: string;
|
|
27
|
+
collapsed?: boolean;
|
|
28
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
onHiddenChange?: (hidden: boolean) => void;
|
|
31
|
+
maximized?: boolean;
|
|
32
|
+
onMaximizedChange?: (maximized: boolean) => void;
|
|
33
|
+
activeTabId?: number;
|
|
34
|
+
onActiveTabIdChange?: (tabId: number) => void;
|
|
35
|
+
position?: CliPanelPosition;
|
|
36
|
+
onPositionChange?: (position: CliPanelPosition) => void;
|
|
37
|
+
height?: number;
|
|
38
|
+
onHeightChange?: (height: number) => void;
|
|
39
|
+
width?: number;
|
|
40
|
+
onWidthChange?: (width: number) => void;
|
|
41
|
+
onTabAdded?: (event: {
|
|
42
|
+
tabId: number;
|
|
43
|
+
}) => void;
|
|
44
|
+
onTabClosed?: (event: {
|
|
45
|
+
tabId: number;
|
|
46
|
+
}) => void;
|
|
47
|
+
onPaneSplit?: (event: {
|
|
48
|
+
paneId: number;
|
|
49
|
+
tabId: number;
|
|
50
|
+
}) => void;
|
|
51
|
+
onPaneClosed?: (event: {
|
|
52
|
+
paneId: number;
|
|
53
|
+
}) => void;
|
|
30
54
|
}
|
|
31
|
-
declare
|
|
55
|
+
declare const CliPanel: React__default.ForwardRefExoticComponent<CliPanelProps & React__default.RefAttributes<ICliPanelRef<CliEngine>>>;
|
|
32
56
|
|
|
33
57
|
interface CliProviderProps {
|
|
34
58
|
modules?: ICliModule[];
|
|
35
|
-
processors?: ICliCommandProcessor[];
|
|
36
59
|
options?: CliEngineOptions;
|
|
37
60
|
services?: Record<string, any>;
|
|
38
61
|
children: React__default.ReactNode;
|
|
39
62
|
style?: React__default.CSSProperties;
|
|
40
63
|
}
|
|
41
|
-
declare function CliProvider({ modules,
|
|
64
|
+
declare function CliProvider({ modules, options, services, children, style, }: CliProviderProps): React__default.JSX.Element;
|
|
42
65
|
|
|
43
66
|
interface CliContextValue {
|
|
44
67
|
engine: CliEngine | null;
|
|
@@ -48,7 +71,6 @@ declare function useCli(): CliContextValue;
|
|
|
48
71
|
|
|
49
72
|
interface CliConfigValue {
|
|
50
73
|
modules?: ICliModule[];
|
|
51
|
-
processors?: ICliCommandProcessor[];
|
|
52
74
|
options?: CliEngineOptions;
|
|
53
75
|
services?: Record<string, any>;
|
|
54
76
|
}
|
|
@@ -56,15 +78,12 @@ declare function useCliConfig(): CliConfigValue;
|
|
|
56
78
|
interface CliConfigProviderProps extends CliConfigValue {
|
|
57
79
|
children: React__default.ReactNode;
|
|
58
80
|
}
|
|
59
|
-
declare function CliConfigProvider({ modules,
|
|
81
|
+
declare function CliConfigProvider({ modules, options, services, children, }: CliConfigProviderProps): React__default.JSX.Element;
|
|
60
82
|
|
|
61
|
-
interface UseCliEngineConfig {
|
|
62
|
-
modules?: ICliModule[];
|
|
63
|
-
processors?: ICliCommandProcessor[];
|
|
64
|
-
options?: CliEngineOptions;
|
|
65
|
-
services?: Record<string, any>;
|
|
83
|
+
interface UseCliEngineConfig extends Omit<CreateCliEngineConfig, 'framework'> {
|
|
66
84
|
disabled?: boolean;
|
|
67
85
|
}
|
|
68
86
|
declare function useCliEngine(containerRef: RefObject<HTMLElement | null>, config?: UseCliEngineConfig): CliEngine | null;
|
|
69
87
|
|
|
70
|
-
export { Cli, CliConfigProvider,
|
|
88
|
+
export { Cli, CliConfigProvider, CliContext, CliPanel, CliProvider, useCli, useCliConfig, useCliEngine };
|
|
89
|
+
export type { CliConfigProviderProps, CliConfigValue, CliContextValue, CliPanelOptions, CliPanelProps, CliProps, CliProviderProps, UseCliEngineConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { RefObject } from 'react';
|
|
3
|
-
import { ICliModule,
|
|
4
|
-
import { CliEngineOptions, CliEngine } from '@qodalis/cli';
|
|
3
|
+
import { ICliModule, CliEngineSnapshot, CliPanelConfig, CliPanelPosition, ICliPanelRef } from '@qodalis/cli-core';
|
|
4
|
+
import { CliEngineOptions, CliEngine, CreateCliEngineConfig } from '@qodalis/cli';
|
|
5
5
|
export { CliEngine, CliEngineOptions } from '@qodalis/cli';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
interface CliProps {
|
|
9
8
|
modules?: ICliModule[];
|
|
10
|
-
processors?: ICliCommandProcessor[];
|
|
11
9
|
options?: CliEngineOptions;
|
|
12
10
|
services?: Record<string, any>;
|
|
13
11
|
snapshot?: CliEngineSnapshot;
|
|
@@ -15,30 +13,55 @@ interface CliProps {
|
|
|
15
13
|
style?: React__default.CSSProperties;
|
|
16
14
|
className?: string;
|
|
17
15
|
}
|
|
18
|
-
declare function Cli({ modules,
|
|
16
|
+
declare function Cli({ modules, options, services, snapshot, onReady, style, className, }: CliProps): React__default.JSX.Element;
|
|
19
17
|
|
|
20
18
|
interface CliPanelOptions extends CliEngineOptions, CliPanelConfig {
|
|
21
19
|
}
|
|
22
20
|
interface CliPanelProps {
|
|
23
21
|
options?: CliPanelOptions;
|
|
24
22
|
modules?: ICliModule[];
|
|
25
|
-
processors?: ICliCommandProcessor[];
|
|
26
23
|
services?: Record<string, any>;
|
|
27
24
|
onClose?: () => void;
|
|
28
25
|
style?: React__default.CSSProperties;
|
|
29
26
|
className?: string;
|
|
27
|
+
collapsed?: boolean;
|
|
28
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
onHiddenChange?: (hidden: boolean) => void;
|
|
31
|
+
maximized?: boolean;
|
|
32
|
+
onMaximizedChange?: (maximized: boolean) => void;
|
|
33
|
+
activeTabId?: number;
|
|
34
|
+
onActiveTabIdChange?: (tabId: number) => void;
|
|
35
|
+
position?: CliPanelPosition;
|
|
36
|
+
onPositionChange?: (position: CliPanelPosition) => void;
|
|
37
|
+
height?: number;
|
|
38
|
+
onHeightChange?: (height: number) => void;
|
|
39
|
+
width?: number;
|
|
40
|
+
onWidthChange?: (width: number) => void;
|
|
41
|
+
onTabAdded?: (event: {
|
|
42
|
+
tabId: number;
|
|
43
|
+
}) => void;
|
|
44
|
+
onTabClosed?: (event: {
|
|
45
|
+
tabId: number;
|
|
46
|
+
}) => void;
|
|
47
|
+
onPaneSplit?: (event: {
|
|
48
|
+
paneId: number;
|
|
49
|
+
tabId: number;
|
|
50
|
+
}) => void;
|
|
51
|
+
onPaneClosed?: (event: {
|
|
52
|
+
paneId: number;
|
|
53
|
+
}) => void;
|
|
30
54
|
}
|
|
31
|
-
declare
|
|
55
|
+
declare const CliPanel: React__default.ForwardRefExoticComponent<CliPanelProps & React__default.RefAttributes<ICliPanelRef<CliEngine>>>;
|
|
32
56
|
|
|
33
57
|
interface CliProviderProps {
|
|
34
58
|
modules?: ICliModule[];
|
|
35
|
-
processors?: ICliCommandProcessor[];
|
|
36
59
|
options?: CliEngineOptions;
|
|
37
60
|
services?: Record<string, any>;
|
|
38
61
|
children: React__default.ReactNode;
|
|
39
62
|
style?: React__default.CSSProperties;
|
|
40
63
|
}
|
|
41
|
-
declare function CliProvider({ modules,
|
|
64
|
+
declare function CliProvider({ modules, options, services, children, style, }: CliProviderProps): React__default.JSX.Element;
|
|
42
65
|
|
|
43
66
|
interface CliContextValue {
|
|
44
67
|
engine: CliEngine | null;
|
|
@@ -48,7 +71,6 @@ declare function useCli(): CliContextValue;
|
|
|
48
71
|
|
|
49
72
|
interface CliConfigValue {
|
|
50
73
|
modules?: ICliModule[];
|
|
51
|
-
processors?: ICliCommandProcessor[];
|
|
52
74
|
options?: CliEngineOptions;
|
|
53
75
|
services?: Record<string, any>;
|
|
54
76
|
}
|
|
@@ -56,15 +78,12 @@ declare function useCliConfig(): CliConfigValue;
|
|
|
56
78
|
interface CliConfigProviderProps extends CliConfigValue {
|
|
57
79
|
children: React__default.ReactNode;
|
|
58
80
|
}
|
|
59
|
-
declare function CliConfigProvider({ modules,
|
|
81
|
+
declare function CliConfigProvider({ modules, options, services, children, }: CliConfigProviderProps): React__default.JSX.Element;
|
|
60
82
|
|
|
61
|
-
interface UseCliEngineConfig {
|
|
62
|
-
modules?: ICliModule[];
|
|
63
|
-
processors?: ICliCommandProcessor[];
|
|
64
|
-
options?: CliEngineOptions;
|
|
65
|
-
services?: Record<string, any>;
|
|
83
|
+
interface UseCliEngineConfig extends Omit<CreateCliEngineConfig, 'framework'> {
|
|
66
84
|
disabled?: boolean;
|
|
67
85
|
}
|
|
68
86
|
declare function useCliEngine(containerRef: RefObject<HTMLElement | null>, config?: UseCliEngineConfig): CliEngine | null;
|
|
69
87
|
|
|
70
|
-
export { Cli, CliConfigProvider,
|
|
88
|
+
export { Cli, CliConfigProvider, CliContext, CliPanel, CliProvider, useCli, useCliConfig, useCliEngine };
|
|
89
|
+
export type { CliConfigProviderProps, CliConfigValue, CliContextValue, CliPanelOptions, CliPanelProps, CliProps, CliProviderProps, UseCliEngineConfig };
|