@qodalis/mcp-cli 0.2.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.2.1] - 2026-11-05
8
+
9
+ ### Changed
10
+
11
+ - Bundled plugin guide (`docs/llms-full.txt`) refreshed from web-cli 2.1.0: the CLI's
12
+ `branding` option (name and icon), .NET jobs that run elsewhere (`ICliJobManager`,
13
+ `SetJobManager`), the admin dashboard's name and icon on all three servers, and the
14
+ opt-in filesystem API.
15
+
7
16
  ## [0.2.0] - 2026-10-27
8
17
 
9
18
  ### Added
@@ -1,6 +1,6 @@
1
1
  # Qodalis CLI plugin development
2
2
 
3
- > Reference for writing Qodalis CLI plugins: browser (web) plugins that run in the terminal UI, and server plugins for the Node.js, .NET and Python CLI servers. Every topic is self-contained. Version 2.0 (web packages `2.0.0-rc.1`). Source: https://github.com/qodalis-solutions/web-cli. Docs: https://cli.qodalis.com.
3
+ > Reference for writing Qodalis CLI plugins: browser (web) plugins that run in the terminal UI, and server plugins for the Node.js, .NET and Python CLI servers. Every topic is self-contained. Version 2.0. Source: https://github.com/qodalis-solutions/web-cli. Docs: https://cli.qodalis.com.
4
4
 
5
5
  ## Overview
6
6
 
@@ -31,6 +31,18 @@ The npm, NuGet and PyPI packages a plugin author uses, by role.
31
31
  | `qodalis-cli-server-abstractions` (PyPI, import `qodalis_cli_server_abstractions`) | Python server plugin API. Server: `qodalis-cli-server` (import `qodalis_cli`). |
32
32
  | `@qodalis/mcp-cli` | MCP server for AI assistants: docs search, API lookup, plugin scaffolding, and (with `QCLI_URL`) driving a CLI server. |
33
33
 
34
+ ### Shipping the CLI under your own name
35
+
36
+ `CliOptions.branding` sets the name and icon an application ships the CLI under. Anything left out keeps Qodalis CLI's.
37
+
38
+ ```tsx
39
+ <CliPanel options={{ branding: { name: 'RateBell CLI', icon: '/favicon.svg' }, servers: [...] }} />
40
+ ```
41
+
42
+ - `name` replaces "Web CLI" and the Qodalis CLI art in the welcome banner and the startup log, and "CLI" in the panel's header and hide tab (React, Vue, Angular).
43
+ - `icon` (an image URL: http(s), a path, or a `data:image` URL) replaces the panel's terminal glyph.
44
+ - The copyright line, the documentation link and `version` stay Qodalis CLI's; `version` adds the name as an `App` row.
45
+
34
46
  ## Web plugins
35
47
 
36
48
  ### Scaffolding a web plugin with create-cli-plugin
@@ -154,6 +166,7 @@ All members:
154
166
  | `onData?(data, context)` | `Promise<void>` | Raw terminal input while this processor is the context processor (full-screen apps). |
155
167
  | `onResize?(cols, rows, context)` | `void` | Terminal resized while in full-screen mode. |
156
168
  | `onDispose?(context)` | `void` | Full-screen mode ended, terminal disconnected or component destroyed. |
169
+ | `controls?` | `ICliCommandControls` | Keys a full-screen command reads, so touch hosts can show them as buttons (see below). |
157
170
 
158
171
  Execution order for one command: parse -> find processor -> global parameter handlers (`--help`, ...) -> extract `value`/`positionals` -> command guards -> `valueRequired` check -> required-parameter and `validator` checks -> `validateBeforeExecution` -> `before` hooks -> `processCommand` -> `after` hooks.
159
172
 
@@ -621,6 +634,32 @@ export class CliClockCommandProcessor implements ICliCommandProcessor {
621
634
  - `onData` receives raw sequences: arrows `\x1b[A`/`\x1b[B`/`\x1b[C`/`\x1b[D`, Enter `\r`, Backspace `\x7f`, Escape `\x1b`, Ctrl+C `\x03` (passed through in full-screen mode).
622
635
  - Pass `{ showCursor: true }` for REPL-style UIs.
623
636
 
637
+ ### Touch keys for full-screen commands (controls)
638
+
639
+ A full-screen command lists the keys it reads in `controls`, so phones (which have no Ctrl, Esc or arrow keys) can show them as buttons.
640
+
641
+ Hosts on touch screens (the Qodalis CLI phone app) show them as buttons while the command runs and send each key's `data` to `onData`; help screens can list them.
642
+
643
+ ```typescript
644
+ import { CliKeyData, ICliCommandControls } from '@qodalis/cli-core';
645
+
646
+ controls: ICliCommandControls = {
647
+ keys: [
648
+ { label: 'ESC', key: 'Esc', data: CliKeyData.escape, description: 'Quit' },
649
+ { label: 'PAUSE', key: 'Space', data: CliKeyData.space, description: 'Pause' },
650
+ { label: '←', key: 'Left', data: CliKeyData.left, description: 'Left', repeat: true },
651
+ { label: 'SAVE', key: 'Ctrl+S', data: CliKeyData.ctrl('s'), description: 'Save' },
652
+ ],
653
+ swipe: true, // swipes on the screen send arrows (games on a board)
654
+ tap: CliKeyData.space, // a tap sends this key's data
655
+ // textInput: true, // the command also reads typed text (editors): keep the keyboard open
656
+ };
657
+ ```
658
+
659
+ - `data` is what a terminal sends for the key (`CliKeyData` has the arrows, Home/End, PgUp/PgDn, Esc, Enter, Backspace and `ctrl(letter)`); a letter key is just the letter (`'f'`).
660
+ - List the most used keys first; `repeat: true` repeats a held key.
661
+ - Without `textInput`, touch hosts close the on-screen keyboard so the command gets the screen (a hardware keyboard keeps working).
662
+
624
663
  ### Extending an existing command
625
664
 
626
665
  Set `extendsProcessor = true` to wrap a processor registered with the same `command` and delegate to `originalProcessor`.
@@ -801,6 +840,34 @@ A server plugin registers command processors in a Qodalis CLI server (Node, .NET
801
840
  - Exceptions thrown by a processor become exit code 1 with `Error executing command: <message>` (style `error`). Unknown commands return `Unknown command: <name>`.
802
841
  - Servers: Node `@qodalis/cli-server-node` (default port 8047 in the demos), .NET `Qodalis.Cli` (8046), Python `qodalis-cli-server` (8048).
803
842
 
843
+ ### Paging list output (all servers)
844
+
845
+ A command that can return many rows must page them: a terminal should never receive thousands of rows.
846
+
847
+ - Declare the parameters: `--skip` (default 0) and `--take` (default 50, at most 500). Node `CliPaging.parameters()`, .NET `CliPaging.Parameters()` (`Qodalis.Cli.Abstractions.Helpers`), Python `CliPaging.parameters()`.
848
+ - Read the request: Node `CliPaging.from(command)`, .NET `CliPaging.From(command)`, Python `CliPaging.from_command(command)`. It gives `skip` and `take` for the query; missing or invalid values fall back to the defaults.
849
+ - Query those rows (and the total when it is cheap) and write it with the paged table writer: Node `writePagedTable(headers, rows, page, { total, hasMore })`, .NET `WritePagedTable(headers, rows, page, total, hasMore)`, Python `write_paged_table(headers, rows, page, total=None, has_more=None)`. Without a total, pass `hasMore` (query `take + 1` rows to find out).
850
+ - On the wire the table carries `page: { skip, take, total?, hasMore }`. The web terminal prints `Rows 51–100 of 1987 · next: <command> --skip 100` under it; MCP text output adds `(rows 51-100 of 1987; next: skip=100)`.
851
+ - Safety net: a table without a page that has more than the server's `maxTableRows` / `MaxTableRows` / `max_table_rows` rows (default 200, 0 = no limit) is cut to that many and marked `page.truncated`; the terminal says the command does not page. Do not rely on it: page instead.
852
+
853
+ .NET example:
854
+
855
+ ```csharp
856
+ public override IEnumerable<ICliCommandParameterDescriptor>? Parameters { get; set; } = CliPaging.Parameters();
857
+
858
+ public async Task<ICliStructuredResponse?> HandleStructuredAsync(CliProcessCommand command, CancellationToken cancellationToken = default)
859
+ {
860
+ var page = CliPaging.From(command);
861
+ var total = await db.Orders.CountAsync(cancellationToken);
862
+ var rows = await db.Orders.OrderBy(o => o.Id).Skip(page.Skip).Take(page.Take)
863
+ .Select(o => new[] { o.Id.ToString(), o.Customer }).ToArrayAsync(cancellationToken);
864
+
865
+ var builder = new CliResponseBuilder();
866
+ builder.WritePagedTable(["Id", "Customer"], rows, page, total);
867
+ return builder.Build();
868
+ }
869
+ ```
870
+
804
871
  ### Node: minimal server processor
805
872
 
806
873
  A Node server command extends `CliCommandProcessor` from `@qodalis/cli-server-abstractions` and returns its output text from `handleAsync`.
@@ -942,8 +1009,8 @@ export class CliUsersCommandProcessor extends CliCommandProcessor implements ICl
942
1009
  }
943
1010
  ```
944
1011
 
945
- - `CliStructuredOutput` = `text` (`value`, `style?`) | `table` (`headers`, `rows`) | `list` (`items`, `ordered?`) | `json` (`value`) | `key-value` (`entries`). Import these types from `@qodalis/cli-server-abstractions` (the server package re-exports them as `CliServerOutput` / `CliServerResponse`).
946
- - `CliResponseBuilder` (from `@qodalis/cli-server-node`): `writeText(text, style?)`, `writeTable(headers, rows)`, `writeList(items, ordered?)`, `writeJson(value)`, `writeKeyValue(record)`, `setExitCode(code)`, `build()`.
1012
+ - `CliStructuredOutput` = `text` (`value`, `style?`) | `table` (`headers`, `rows`, `page?`) | `list` (`items`, `ordered?`) | `json` (`value`) | `key-value` (`entries`). Import these types from `@qodalis/cli-server-abstractions` (the server package re-exports them as `CliServerOutput` / `CliServerResponse`).
1013
+ - `CliResponseBuilder` (from `@qodalis/cli-server-node`): `writeText(text, style?)`, `writeTable(headers, rows)`, `writePagedTable(headers, rows, page, { total?, hasMore? })`, `writeList(items, ordered?)`, `writeJson(value)`, `writeKeyValue(record)`, `setExitCode(code)`, `build()`.
947
1014
  - `/execute/stream` prefers `handleStreamAsync`, then `handleStructuredAsync` (each output emitted), then `handleAsync`.
948
1015
 
949
1016
  ### Node: permissions and MCP tools
@@ -1163,8 +1230,8 @@ public class CliUsersCommandProcessor : CliCommandProcessor, ICliStreamCommandPr
1163
1230
  }
1164
1231
  ```
1165
1232
 
1166
- - `ICliResponseBuilder`: `WriteText(text, style?)`, `WriteTable(headers, rows)`, `WriteList(items, ordered = false)`, `WriteJson(value)`, `WriteKeyValue(dictionary)`, `SetExitCode(code)`, `Build()` -> `CliServerResponse { ExitCode, Outputs }`.
1167
- - Output classes (`Qodalis.Cli.Models`): `TextOutput { Value, Style }`, `TableOutput { Headers, Rows }`, `ListOutput { Items, Ordered }`, `JsonOutput { Value }`, `KeyValueOutput { Entries: KeyValueEntry[] }`.
1233
+ - `ICliResponseBuilder`: `WriteText(text, style?)`, `WriteTable(headers, rows)`, `WritePagedTable(headers, rows, page, total?, hasMore?)`, `WriteList(items, ordered = false)`, `WriteJson(value)`, `WriteKeyValue(dictionary)`, `SetExitCode(code)`, `Build()` -> `CliServerResponse { ExitCode, Outputs }`.
1234
+ - Output classes (`Qodalis.Cli.Models`): `TextOutput { Value, Style }`, `TableOutput { Headers, Rows, Page? }`, `ListOutput { Items, Ordered }`, `JsonOutput { Value }`, `KeyValueOutput { Entries: KeyValueEntry[] }`.
1168
1235
  - The executor uses the structured result only if it is a `CliServerResponse`; an empty `HandleAsync` string produces no output.
1169
1236
 
1170
1237
  ### .NET: permissions and MCP tools
@@ -1433,7 +1500,7 @@ class CliUsersCommandProcessor(CliCommandProcessor, ICliStreamCommandProcessor):
1433
1500
 
1434
1501
  - Keep the `cancellation_event` parameter in every override: the executor always passes two arguments.
1435
1502
  - Return `self._STRUCTURED_NOT_IMPLEMENTED` from `handle_structured_async` to fall back to `handle_async`.
1436
- - `CliResponseBuilder`: `write_text(text, style=None)`, `write_table(headers, rows)`, `write_list(items, ordered=False)`, `write_json(value)`, `write_key_value(dict)`, `set_exit_code(code)`, `build()` -> `CliServerResponse`. Output models (`qodalis_cli.models`): `CliServerTextOutput`, `CliServerTableOutput`, `CliServerListOutput`, `CliServerJsonOutput`, `CliServerKeyValueOutput`.
1503
+ - `CliResponseBuilder`: `write_text(text, style=None)`, `write_table(headers, rows)`, `write_paged_table(headers, rows, page, total=None, has_more=None)`, `write_list(items, ordered=False)`, `write_json(value)`, `write_key_value(dict)`, `set_exit_code(code)`, `build()` -> `CliServerResponse`. Output models (`qodalis_cli.models`): `CliServerTextOutput`, `CliServerTableOutput`, `CliServerListOutput`, `CliServerJsonOutput`, `CliServerKeyValueOutput`.
1437
1504
 
1438
1505
  ### Python: permissions and MCP tools
1439
1506
 
@@ -1496,6 +1563,24 @@ async def test_greet_executor():
1496
1563
 
1497
1564
  - HTTP tests: `from fastapi.testclient import TestClient`; `with TestClient(create_cli_server(CliServerOptions(configure=...)).app) as client: client.post("/api/v1/qcli/execute", json={...})`.
1498
1565
 
1566
+ ### .NET: jobs that run elsewhere
1567
+
1568
+ The jobs API (`/api/v1/qcli/jobs`), the `jobs_*` MCP tools, `server jobs` and the dashboard's jobs page work on an `ICliJobManager` (`Qodalis.Cli.Abstractions.Jobs`). The default runs the jobs registered with `AddJob` in the server's process; a host whose jobs run elsewhere implements the interface and registers it with `cli.SetJobManager<T>()` (scoped).
1569
+
1570
+ - Implement `GetJobsAsync` (each `CliJobInfo` with `Id`, `Name`, `Status`, `LastRunAt`, `LastRunStatus` and `Actions`, such as `["trigger", "pause", "resume"]`), `TriggerAsync`, `PauseAsync`, `ResumeAsync`, `GetExecutionsAsync` and `GetExecutionAsync`.
1571
+ - `StopAsync`, `CancelAsync` and `UpdateAsync` default to `NotSupportedException` (HTTP `501`, `NOT_SUPPORTED`); the dashboard shows only the actions in `Actions`.
1572
+ - Throw `KeyNotFoundException` for an unknown job (`404`) and `InvalidOperationException` when the job's state refuses the action (`409`).
1573
+
1574
+ ### Admin dashboard: name and icon (all servers)
1575
+
1576
+ The dashboard is "Qodalis Cli Admin" with the Qodalis Solutions logo unless the admin plugin sets its branding: the name and icon (browser tab, sidebar, sign-in page) and the terminal's name in its welcome banner.
1577
+
1578
+ - .NET: `cli.AddAdmin(o => { o.Branding.Name = "RateBell"; o.Branding.IconUrl = "/favicon.svg"; o.Branding.CliName = "RateBell CLI"; })`
1579
+ - Node: `new CliAdminBuilder().setBranding({ name: 'RateBell', iconUrl: '/favicon.svg', cliName: 'RateBell CLI' })`
1580
+ - Python: `CliAdminBuilder().set_branding({"name": "RateBell", "icon_url": "/favicon.svg", "cli_name": "RateBell CLI"})`
1581
+ - The icon is an absolute http(s) URL, a root-relative path or a base64 `data:image` URL; invalid values fail at startup. The values are served as `branding` in `/qcli/admin/theme.json`.
1582
+ - The filesystem API (`/api/qcli/fs/*`) and the dashboard's Files page exist only when the server enables the filesystem (`AddFileSystem()` in .NET); otherwise the routes answer `404`.
1583
+
1499
1584
  ## Recipes
1500
1585
 
1501
1586
  ### Recipe: a complete web plugin end to end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qodalis/mcp-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Model Context Protocol (MCP) server for Qodalis CLI: plugin-development tools (docs search, API declarations, scaffolding) for AI assistants, and a resilient stdio proxy to a Qodalis CLI server's commands, files, data explorer and jobs.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",