Skip to content

Commit 6f1d2f7

Browse files
committed
chore: remove inquirer and @inquirer/prompts dependencies, use node:readline
Replace all inquirer-based prompts with native node:readline utilities. Add defaultValue parameter to promptForConfirmation() for "Did you mean?" flows. Create promptForSelection() utility for interactive list selection. Delete dead code (PromptHelper class, InteractiveHelper.confirm()). Removes ~44 transitive packages from node_modules.
1 parent 46a8e72 commit 6f1d2f7

17 files changed

Lines changed: 341 additions & 730 deletions

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ updates:
2828
ignore:
2929
- dependency-name: "zod"
3030
update-types: ["version-update:semver-major"]
31-
- dependency-name: "inquirer"
32-
update-types: ["version-update:semver-major"]
3331
- dependency-name: "typescript"
3432
update-types: ["version-update:semver-major"]
3533
cooldown:

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Flags are NOT global. Each command explicitly declares only the flags it needs v
103103
- **`durationFlag`**`--duration` / `-D`. Use for long-running subscribe/stream commands that auto-exit after N seconds.
104104
- **`rewindFlag`**`--rewind`. Use for subscribe commands that support message replay (default: 0).
105105
- **`timeRangeFlags`**`--start`, `--end`. Use for history and stats commands. Parse with `parseTimestamp()` from `src/utils/time.ts`. Accepts ISO 8601, Unix ms, or relative (e.g., `"1h"`, `"30m"`, `"2d"`).
106-
- **`forceFlag`**`--force` / `-f`. Use for destructive commands (delete, revoke) that require user confirmation. When `--force` is provided, skip the interactive prompt. When `--json` is used without `--force`, fail with an error requiring `--force`. Use `promptForConfirmation()` from `src/utils/prompt-confirmation.js` for the interactive promptdo NOT use `interactiveHelper.confirm()` (inquirer-based, inconsistent UX).
106+
- **`forceFlag`**`--force` / `-f`. Use for destructive commands (delete, revoke) that require user confirmation. When `--force` is provided, skip the interactive prompt. When `--json` is used without `--force`, fail with an error requiring `--force`. Use `promptForConfirmation()` from `src/utils/prompt-confirmation.js` for the interactive prompt.
107107
- **`endpointFlag`**`--endpoint`. Hidden, only on `accounts login` and `accounts switch`.
108108

109109
**When creating a new command:**

docs/Interactive-REPL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ I would like to explore an alternative route where the Ably CLI supports an inte
2424
There are some relevant Node.js projects we can draw inspiration from:
2525

2626
- [Vorpal interactive CLI](https://vorpal.js.org/) with source code at https://github.com/dthree/vorpal
27-
- [Inquirer package](https://www.npmjs.com/package/inquirer) for common interactive command line user interface commands
27+
- Node.js built-in `node:readline` module for interactive prompts (confirmation, selection)
2828

2929
[oclif](https://oclif.io/) does not appear to have any plugins to support an interactive/embedded CLI mode.
3030
However, a [REPL plugin](https://github.com/sisou/oclif-plugin-repl) exists, although that's unlikely to share much with the goals of interactive CLI.

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
"dependencies": {
114114
"@ably/chat": "^1.3.1",
115115
"@ably/spaces": "^0.5.2",
116-
"@inquirer/prompts": "^5.5.0",
117116
"@oclif/core": "^4.10.5",
118117
"@oclif/plugin-autocomplete": "^3.2.45",
119118
"@oclif/plugin-warn-if-update-available": "^3.1.60",
@@ -125,7 +124,6 @@
125124
"cli-table3": "^0.6.5",
126125
"color-json": "^3.0.5",
127126
"fast-levenshtein": "^3.0.0",
128-
"inquirer": "^9.3.8",
129127
"jsonwebtoken": "^9.0.3",
130128
"node-fetch": "^3.3.2",
131129
"open": "^11.0.0",
@@ -142,7 +140,6 @@
142140
"@oclif/test": "^4.1.18",
143141
"@types/fast-levenshtein": "^0.0.4",
144142
"@types/fs-extra": "^11.0.4",
145-
"@types/inquirer": "^9.0.9",
146143
"@types/jsonwebtoken": "^9.0.10",
147144
"@types/node": "^25.6.0",
148145
"@types/node-fetch": "^2.6.13",

0 commit comments

Comments
 (0)