@revenexx/cli 0.1.1 → 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.
Files changed (90) hide show
  1. package/README.md +61 -18
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/{bundle-win-arm64.mjs → cli.mjs} +46045 -14679
  4. package/dist/index.cjs +6 -2
  5. package/dist/index.js +6 -2
  6. package/dist/lib/command-picker.d.ts +4 -2
  7. package/dist/lib/command-picker.d.ts.map +1 -1
  8. package/dist/lib/commands/repl.d.ts.map +1 -1
  9. package/dist/lib/commands/services/apps.d.ts.map +1 -1
  10. package/dist/lib/commands/services/avatars.d.ts.map +1 -1
  11. package/dist/lib/commands/services/carts.d.ts.map +1 -1
  12. package/dist/lib/commands/services/channels.d.ts.map +1 -1
  13. package/dist/lib/commands/services/customers.d.ts.map +1 -1
  14. package/dist/lib/commands/services/forms.d.ts.map +1 -1
  15. package/dist/lib/commands/services/inventories.d.ts.map +1 -1
  16. package/dist/lib/commands/services/io.d.ts +3 -0
  17. package/dist/lib/commands/services/io.d.ts.map +1 -0
  18. package/dist/lib/commands/services/locale.d.ts.map +1 -1
  19. package/dist/lib/commands/services/markets.d.ts.map +1 -1
  20. package/dist/lib/commands/services/messaging.d.ts.map +1 -1
  21. package/dist/lib/commands/services/orderlists.d.ts.map +1 -1
  22. package/dist/lib/commands/services/orders.d.ts.map +1 -1
  23. package/dist/lib/commands/services/pages.d.ts.map +1 -1
  24. package/dist/lib/commands/services/payments.d.ts.map +1 -1
  25. package/dist/lib/commands/services/prices.d.ts.map +1 -1
  26. package/dist/lib/commands/services/products.d.ts.map +1 -1
  27. package/dist/lib/commands/services/search.d.ts.map +1 -1
  28. package/dist/lib/commands/services/settings.d.ts.map +1 -1
  29. package/dist/lib/commands/services/shipping.d.ts.map +1 -1
  30. package/dist/lib/commands/services/sites.d.ts.map +1 -1
  31. package/dist/lib/commands/services/storage.d.ts.map +1 -1
  32. package/dist/lib/commands/services/tokens.d.ts.map +1 -1
  33. package/dist/lib/commands/status.d.ts.map +1 -1
  34. package/dist/lib/commands/tui.d.ts +8 -0
  35. package/dist/lib/commands/tui.d.ts.map +1 -0
  36. package/dist/lib/commands/update.d.ts +32 -0
  37. package/dist/lib/commands/update.d.ts.map +1 -1
  38. package/dist/lib/config.d.ts +1 -0
  39. package/dist/lib/config.d.ts.map +1 -1
  40. package/dist/lib/constants.d.ts +3 -1
  41. package/dist/lib/constants.d.ts.map +1 -1
  42. package/dist/lib/interactive.d.ts +46 -0
  43. package/dist/lib/interactive.d.ts.map +1 -1
  44. package/dist/lib/parser.d.ts +7 -0
  45. package/dist/lib/parser.d.ts.map +1 -1
  46. package/dist/lib/project-config.d.ts +15 -0
  47. package/dist/lib/project-config.d.ts.map +1 -1
  48. package/dist/lib/tui/app.d.ts +17 -0
  49. package/dist/lib/tui/app.d.ts.map +1 -0
  50. package/dist/lib/tui/clipboard.d.ts +2 -0
  51. package/dist/lib/tui/clipboard.d.ts.map +1 -0
  52. package/dist/lib/tui/command-tree.d.ts +89 -0
  53. package/dist/lib/tui/command-tree.d.ts.map +1 -0
  54. package/dist/lib/tui/confirm.d.ts +6 -0
  55. package/dist/lib/tui/confirm.d.ts.map +1 -0
  56. package/dist/lib/tui/context.d.ts +16 -0
  57. package/dist/lib/tui/context.d.ts.map +1 -0
  58. package/dist/lib/tui/eggs.d.ts +22 -0
  59. package/dist/lib/tui/eggs.d.ts.map +1 -0
  60. package/dist/lib/tui/executor.d.ts +24 -0
  61. package/dist/lib/tui/executor.d.ts.map +1 -0
  62. package/dist/lib/tui/form.d.ts +43 -0
  63. package/dist/lib/tui/form.d.ts.map +1 -0
  64. package/dist/lib/tui/json-editor.d.ts +29 -0
  65. package/dist/lib/tui/json-editor.d.ts.map +1 -0
  66. package/dist/lib/tui/panel.d.ts +61 -0
  67. package/dist/lib/tui/panel.d.ts.map +1 -0
  68. package/dist/lib/tui/resource-picker.d.ts +15 -0
  69. package/dist/lib/tui/resource-picker.d.ts.map +1 -0
  70. package/dist/lib/tui/results.d.ts +90 -0
  71. package/dist/lib/tui/results.d.ts.map +1 -0
  72. package/dist/lib/tui/terminal.d.ts +5 -0
  73. package/dist/lib/tui/terminal.d.ts.map +1 -0
  74. package/dist/lib/tui/theme.d.ts +120 -0
  75. package/dist/lib/tui/theme.d.ts.map +1 -0
  76. package/dist/tests/executor.test.d.ts +2 -0
  77. package/dist/tests/executor.test.d.ts.map +1 -0
  78. package/dist/tests/setup.d.ts +2 -0
  79. package/dist/tests/setup.d.ts.map +1 -0
  80. package/dist/tests/theme.test.d.ts +2 -0
  81. package/dist/tests/theme.test.d.ts.map +1 -0
  82. package/dist/tests/tui.test.d.ts +2 -0
  83. package/dist/tests/tui.test.d.ts.map +1 -0
  84. package/dist/tests/update.test.d.ts +2 -0
  85. package/dist/tests/update.test.d.ts.map +1 -0
  86. package/dist/vitest.config.d.ts.map +1 -1
  87. package/package.json +14 -9
  88. package/dist/cli.cjs +0 -124680
  89. package/dist/lib/commands/services/greetings.d.ts +0 -3
  90. package/dist/lib/commands/services/greetings.d.ts.map +0 -1
package/README.md CHANGED
@@ -13,7 +13,7 @@ Revenexx command-line interface for managing your platform.
13
13
 
14
14
  ## Installation
15
15
 
16
- The Revenexx CLI is a Node based command line tool to help you interact with the Revenexx API. The CLI is distributed both as an [`npm package`](https://www.npmjs.com/package/@revenexx/cli) as well as [pre built binaries](https://github.com/revenexx-sdks/cli/releases/latest) for specific operating systems and architectures.
16
+ The Revenexx CLI is a command line tool to help you interact with the Revenexx API. Install it from [npm](https://www.npmjs.com/package/@revenexx/cli) or, on macOS and Linux, with [Homebrew](https://brew.sh) the Homebrew formula installs a self-contained binary, so no Node.js is needed. Single-file binaries for every supported platform are also attached to each [GitHub release](https://github.com/revenexx-sdks/cli/releases/latest) for manual download.
17
17
 
18
18
  ### Install using NPM
19
19
  ---
@@ -28,41 +28,49 @@ Once the installation is complete, you can verify the install using
28
28
 
29
29
  ```sh
30
30
  $ revenexx -v
31
- 0.1.1
31
+ 0.2.1
32
32
  ```
33
33
 
34
- ### Install using prebuilt binaries
34
+ ### MacOS / Linux via [Homebrew](https://brew.sh)
35
35
  ---
36
36
 
37
- If you do not have `npm` installed, you can always install the prebuilt binaries for your architecture and OS using our convenient installation scripts.
37
+ The CLI ships its own tap, [`revenexx-sdks/homebrew-cli`](https://github.com/revenexx-sdks/homebrew-cli) (Homebrew strips the `homebrew-` prefix, so it is addressed as `revenexx-sdks/cli`). No Node.js needed the formula installs the prebuilt binary for your platform:
38
38
 
39
- ### Linux / MacOS Terminal
40
39
  ```bash
41
- $ wget -q https://revenexx.com/cli/install.sh -O - | /bin/bash
40
+ $ brew install revenexx-sdks/cli/revenexx
42
41
  ```
43
42
 
44
- ### MacOS via [Homebrew](https://brew.sh)
45
-
46
- > **Coming soon** — Homebrew support is not yet available.
43
+ Or add the tap once and refer to the formula by name afterwards:
47
44
 
48
45
  ```bash
46
+ $ brew tap revenexx-sdks/cli
49
47
  $ brew install revenexx
50
48
  ```
51
49
 
52
- ### Windows
53
- Via Powershell
54
- ```powershell
55
- $ iwr -useb https://revenexx.com/cli/install.ps1 | iex
50
+ Upgrading to a newer release:
51
+
52
+ ```bash
53
+ $ brew update && brew upgrade revenexx-sdks/cli/revenexx
56
54
  ```
57
- Via [Scoop](https://scoop.sh)
58
- ```powershell
59
- $ scoop install https://raw.githubusercontent.com/revenexx-sdks/cli/master/scoop/revenexx.config.json
55
+
56
+ `revenexx update` detects a Homebrew install and runs those two commands for you.
57
+
58
+ ### Manual download
59
+ ---
60
+
61
+ Every release attaches a single-file binary per platform — `revenexx-darwin-arm64`, `revenexx-linux-x64`, `revenexx-win-x64.exe` and so on. Grab the one for your platform from the [latest release](https://github.com/revenexx-sdks/cli/releases/latest), make it executable, and put it on your `PATH`:
62
+
63
+ ```bash
64
+ $ chmod +x revenexx-darwin-arm64
65
+ $ mv revenexx-darwin-arm64 /usr/local/bin/revenexx
60
66
  ```
61
67
 
68
+ On Windows, use `npm` — or download the `.exe` from the same release page.
69
+
62
70
  Once the installation completes, you can verify your install using
63
71
  ```
64
72
  $ revenexx -v
65
- 0.1.1
73
+ 0.2.1
66
74
  ```
67
75
 
68
76
  ## Getting Started
@@ -123,9 +131,10 @@ $ revenexx status # identity, tenant, endpoint, token expiry & gate
123
131
  $ revenexx p ls # built-in aliases: same as `products list`
124
132
  $ revenexx alias set deploy "apps create-deployment --activate true"
125
133
  $ revenexx repl # interactive shell — many commands, one session
134
+ $ revenexx tui # full-screen app — browse commands, forms, results
126
135
  ```
127
136
 
128
- A **production safety banner** is printed before most commands showing which tenant/endpoint you're hitting (prominent and red for production). Silence it with `-q`/`--quiet`. See [Command aliases](../README.md#command-aliases), [Production safety banner](../README.md#production-safety-banner), [`status`](../README.md#status) and [Interactive shell (`repl`)](../README.md#interactive-shell-repl) in the README.
137
+ A **production safety banner** is printed before most commands showing which tenant/endpoint you're hitting (prominent and red for production). Silence it with `-q`/`--quiet`. See [Command aliases](../README.md#command-aliases), [Production safety banner](../README.md#production-safety-banner), [`status`](../README.md#status), [Interactive shell (`repl`)](../README.md#interactive-shell-repl) and [Full-screen app (`tui`)](../README.md#full-screen-app-tui) in the README.
129
138
 
130
139
  > ### Note
131
140
  > By default, requests to domains with self-signed SSL certificates (or no certificates) are rejected. If you trust the host, you can bypass certificate validation using
@@ -133,6 +142,20 @@ A **production safety banner** is printed before most commands showing which ten
133
142
  > $ revenexx client --self-signed true
134
143
  > ```
135
144
 
145
+ ## Three ways to use it
146
+
147
+ The CLI has one command tree reachable three ways — every service command, plugin, and alias behaves identically in all of them:
148
+
149
+ | Mode | How to start it | When |
150
+ |---|---|---|
151
+ | **Full-screen app** ([`tui`](#full-screen-app-tui)) | bare `revenexx` on a terminal (**the default**), or `revenexx tui` | Browse and run interactively — the default landing experience. |
152
+ | **Interactive shell** ([`repl`](#interactive-shell-repl)) | `revenexx repl` | Fire several commands in a row without re-typing `revenexx`. |
153
+ | **Direct / one-shot** | `revenexx products list --json …` | Scripting, CI, pipes — flag-driven and non-interactive. |
154
+
155
+ Running `revenexx` with no arguments on an interactive terminal launches the **full-screen app**. A partial or named invocation (`revenexx p`, `revenexx products`) still opens the guided command picker and resolves to a single one-shot command. Anything non-interactive — a pipe, CI, `--json`, or `--help` — prints help and never opens an interactive surface, so scripts stay byte-stable.
156
+
157
+ **Opting out of the TUI default:** set `REVENEXX_NO_TUI=1` (any value other than `0`/`false`) to make a bare `revenexx` fall back to the guided picker. For a per-project default, add a `defaultMode:` key to `.revenexx.yaml` — `tui` (default), `guided` (the picker), or `help` (print usage). Explicit subcommands (`repl`, `tui`, any service command) always win regardless of this setting.
158
+
136
159
  ## Authentication
137
160
 
138
161
  The CLI supports two ways to authenticate:
@@ -326,6 +349,26 @@ revenexx> exit
326
349
  - Missing required options **prompt interactively** just like they do outside the shell (search/select), so `p get` will ask for the product id. Ctrl-C cancels the current line without leaving the shell.
327
350
  - The [production safety banner](#production-safety-banner) is shown before **every** command in the session (prominent and red for production) — the safeguard matters most in a rapid-fire shell. Launch with `revenexx --quiet repl` to silence it for the session.
328
351
 
352
+ ## Full-screen app (`tui`)
353
+
354
+ `revenexx tui` — or just a bare `revenexx` on a terminal, since this is the **default landing experience** — opens a full-screen terminal app for the whole CLI: browse the command tree in a sidebar, fill in a command's parameters with a guided form, and read the results in a scrollable table — all on one screen that always shows the tenant and endpoint you're hitting. It's built on the same command tree as the rest of the CLI, so every service command, plugin, and alias is reachable, and each action maps to a plain one-shot command you can copy out and script.
355
+
356
+ ```sh
357
+ $ revenexx # bare invocation on a TTY → launches the TUI
358
+ $ revenexx tui # explicit, always works
359
+ ```
360
+
361
+ - Needs an interactive terminal (a TTY); in a pipe or CI it exits with a hint to use one-shot commands.
362
+ - Launched by default from a bare `revenexx` on a TTY. Set `REVENEXX_NO_TUI=1` or `defaultMode: guided|help` in `.revenexx.yaml` to opt out (see [Three ways to use it](#three-ways-to-use-it)); `revenexx tui` always launches it explicitly.
363
+ - **Browse:** `↑`/`↓` move, `Enter`/`→` open a group or run a command, `Esc`/`←` go back (`Esc` quits at the top level), `q` back/quit. Type or press `/` to filter.
364
+ - **Themes:** press `^t` for a live theme picker — arrow through the list to preview the whole UI instantly, `Enter` keeps it, `Esc` reverts. The choice is saved to `prefs.json` and restored next launch. Start with a specific one via `revenexx tui --theme <name>` or the `REVENEXX_THEME` env var. Built-in: `revenexx` (default), `dark`, `light`, `dracula`, `nord`, `solarized-dark`, `solarized-light`, `gruvbox`, `monokai`, `one-dark`, `matrix`. On terminals that honour it (e.g. Ghostty) the theme also sets the terminal background.
365
+ - **Run:** commands with required parameters open a form; destructive ones ask to confirm (`y`/`n`); the rest run immediately. The detail pane shows the equivalent one-shot command.
366
+ - **Forms:** `Tab`/`Shift+Tab` move between fields, `←`/`→`/`Space` cycle toggles and choices, `Enter` advances or runs, `^r` runs from any field. Values are validated on submit; secrets (password/token/api-key) are masked. Resource-id fields open the matching list as a **filterable table** — type to narrow it (server-side when the endpoint supports `search`, otherwise across the loaded rows), `↑`/`↓` to move, `Enter` to pick the highlighted record's id.
367
+ - **JSON body fields:** an `object` parameter (e.g. `--data`) opens a full-screen **key/value editor** — `Enter` adds a field (or appends an array item), `Tab` switches between the key and value cell, `^d` deletes the focused field, `^s` saves it back to the form. Values are entered as JSON (`"text"`, `42`, `true`) and validated live, so the request body round-trips exactly. **Nested JSON** is edited in place: a value that is an object or array shows as `{ n fields }` / `[ n items ]`, and `→` drills into it one level deeper (breadcrumb `data › meta › [0]`, any depth); `Esc` goes back up a level (and cancels at the top). Type `{}` or `[]` into a value to start a nested container.
368
+ - **Results:** table with `↑`/`↓` rows, `Enter` for row detail, `/` to filter the loaded rows (type to narrow across all columns, `Esc` clears), `←`/`→` to scroll columns, `n`/`p` to page, `o` to cycle output format (`table`/`json`/`jsonl`/`csv`), `y` to copy (`Y` copies the whole output), `c` to open the matching `create` form, `u` to open the matching `update` pre-filled, `d` to `delete` the record (behind the confirm modal), `e` to edit parameters. `u`/`d` act on the row under the cursor in a list, or on the single record from a `get`; `c` needs no row, so it works from an empty list too.
369
+ - The header carries a persistent, filled yellow `▲ PRODUCTION` chip (the same [production safety](#production-safety-banner) signal) for the whole session.
370
+ - Not browsable in the TUI (still available as one-shot commands): `tui`, `repl`, `update`, `generate`, `types`, `completion`.
371
+
329
372
  ## Global Configuration
330
373
 
331
374
  The CLI stores its state in `~/.revenexx/prefs.json`. It holds one entry per signed-in **session**, keyed by a generated session ID, plus a top-level `current` that points at the active one. You don't normally edit this by hand — it's written by `login`, `logout`, `tenants use`, and `client`.
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AA0DvB,OAAO,gCAAgC,CAAC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AA2DvB,OAAO,gCAAgC,CAAC"}