mepcli 0.6.1 → 1.0.0-beta.2

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 (113) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +512 -326
  3. package/dist/ansi.d.ts +8 -0
  4. package/dist/ansi.js +8 -0
  5. package/dist/base.d.ts +21 -0
  6. package/dist/base.js +57 -0
  7. package/dist/core.d.ts +48 -1
  8. package/dist/core.js +156 -0
  9. package/dist/data/licenses.d.ts +2 -0
  10. package/dist/data/licenses.js +109 -0
  11. package/dist/highlight.js +58 -26
  12. package/dist/index.d.ts +36 -0
  13. package/dist/index.js +36 -0
  14. package/dist/input.js +0 -3
  15. package/dist/prompts/box.d.ts +21 -0
  16. package/dist/prompts/box.js +192 -0
  17. package/dist/prompts/breadcrumb.d.ts +22 -0
  18. package/dist/prompts/breadcrumb.js +302 -0
  19. package/dist/prompts/byte.d.ts +13 -0
  20. package/dist/prompts/byte.js +159 -0
  21. package/dist/prompts/calculator.d.ts +16 -0
  22. package/dist/prompts/calculator.js +213 -0
  23. package/dist/prompts/calendar.js +0 -5
  24. package/dist/prompts/code.d.ts +2 -0
  25. package/dist/prompts/code.js +104 -70
  26. package/dist/prompts/connection-string.d.ts +18 -0
  27. package/dist/prompts/connection-string.js +97 -0
  28. package/dist/prompts/curl.d.ts +39 -0
  29. package/dist/prompts/curl.js +285 -0
  30. package/dist/prompts/data-inspector.d.ts +22 -0
  31. package/dist/prompts/data-inspector.js +256 -0
  32. package/dist/prompts/dependency.d.ts +16 -0
  33. package/dist/prompts/dependency.js +265 -0
  34. package/dist/prompts/dial.d.ts +10 -0
  35. package/dist/prompts/dial.js +110 -0
  36. package/dist/prompts/diff.d.ts +10 -0
  37. package/dist/prompts/diff.js +101 -0
  38. package/dist/prompts/draw.d.ts +20 -0
  39. package/dist/prompts/draw.js +188 -0
  40. package/dist/prompts/editor.js +0 -4
  41. package/dist/prompts/emoji.d.ts +18 -0
  42. package/dist/prompts/emoji.js +228 -0
  43. package/dist/prompts/exec.d.ts +13 -0
  44. package/dist/prompts/exec.js +83 -0
  45. package/dist/prompts/fuzzy.d.ts +12 -0
  46. package/dist/prompts/fuzzy.js +136 -0
  47. package/dist/prompts/gauge.d.ts +21 -0
  48. package/dist/prompts/gauge.js +130 -0
  49. package/dist/prompts/heatmap.d.ts +13 -0
  50. package/dist/prompts/heatmap.js +141 -0
  51. package/dist/prompts/ip.d.ts +11 -0
  52. package/dist/prompts/ip.js +118 -0
  53. package/dist/prompts/kanban.d.ts +17 -0
  54. package/dist/prompts/kanban.js +228 -0
  55. package/dist/prompts/keypress.js +0 -2
  56. package/dist/prompts/license.d.ts +9 -0
  57. package/dist/prompts/license.js +105 -0
  58. package/dist/prompts/map.d.ts +15 -0
  59. package/dist/prompts/map.js +199 -0
  60. package/dist/prompts/match.d.ts +19 -0
  61. package/dist/prompts/match.js +275 -0
  62. package/dist/prompts/miller.d.ts +15 -0
  63. package/dist/prompts/miller.js +221 -0
  64. package/dist/prompts/multi-column-select.d.ts +10 -0
  65. package/dist/prompts/multi-column-select.js +166 -0
  66. package/dist/prompts/number.js +0 -2
  67. package/dist/prompts/otp.d.ts +10 -0
  68. package/dist/prompts/otp.js +91 -0
  69. package/dist/prompts/pattern.d.ts +22 -0
  70. package/dist/prompts/pattern.js +249 -0
  71. package/dist/prompts/quiz-select.d.ts +10 -0
  72. package/dist/prompts/quiz-select.js +104 -0
  73. package/dist/prompts/quiz-text.d.ts +11 -0
  74. package/dist/prompts/quiz-text.js +82 -0
  75. package/dist/prompts/regex.d.ts +13 -0
  76. package/dist/prompts/regex.js +131 -0
  77. package/dist/prompts/region.d.ts +11 -0
  78. package/dist/prompts/region.js +164 -0
  79. package/dist/prompts/schedule.d.ts +18 -0
  80. package/dist/prompts/schedule.js +221 -0
  81. package/dist/prompts/scroll.d.ts +13 -0
  82. package/dist/prompts/scroll.js +152 -0
  83. package/dist/prompts/seat.d.ts +17 -0
  84. package/dist/prompts/seat.js +165 -0
  85. package/dist/prompts/select-range.d.ts +8 -0
  86. package/dist/prompts/select-range.js +136 -0
  87. package/dist/prompts/select.d.ts +9 -9
  88. package/dist/prompts/semver.d.ts +6 -0
  89. package/dist/prompts/semver.js +32 -0
  90. package/dist/prompts/shortcut.d.ts +9 -0
  91. package/dist/prompts/shortcut.js +135 -0
  92. package/dist/prompts/slot.d.ts +16 -0
  93. package/dist/prompts/slot.js +107 -0
  94. package/dist/prompts/snippet.js +0 -3
  95. package/dist/prompts/sort-grid.d.ts +16 -0
  96. package/dist/prompts/sort-grid.js +146 -0
  97. package/dist/prompts/sort.js +0 -1
  98. package/dist/prompts/spreadsheet.d.ts +21 -0
  99. package/dist/prompts/spreadsheet.js +239 -0
  100. package/dist/prompts/text.d.ts +9 -7
  101. package/dist/prompts/text.js +52 -0
  102. package/dist/prompts/time.d.ts +12 -0
  103. package/dist/prompts/time.js +202 -0
  104. package/dist/prompts/tree-select.d.ts +0 -1
  105. package/dist/prompts/tree-select.js +1 -5
  106. package/dist/symbols.d.ts +12 -0
  107. package/dist/symbols.js +14 -2
  108. package/dist/theme.js +10 -1
  109. package/dist/types.d.ts +264 -1
  110. package/dist/utils.d.ts +53 -0
  111. package/dist/utils.js +252 -0
  112. package/package.json +51 -47
  113. package/example.ts +0 -390
package/README.md CHANGED
@@ -1,326 +1,512 @@
1
- # Mep
2
-
3
- **Mep** is a lightweight and zero-dependency library for creating interactive command-line prompts in Node.js. It focuses on simplicity, modern design, and robust input handling, including support for cursor movement and input validation.
4
-
5
- A **CodeTease** project.
6
-
7
- ## Features
8
-
9
- - **Zero Dependency:** Keeps your project clean and fast.
10
- - **Comprehensive Prompts:** Includes `text`, `password`, `secret`, `select`, `checkbox`, `confirm`, `number`, `toggle`, `list`, `slider`, `range`, `date`, `file`, `multiSelect`, `autocomplete`, `sort`, `transfer`, `cron`, `table`, `rating`, `editor`, `tree`, `keypress`, `color`, `grid`, and `calendar`.
11
- - **Mouse Support:** Built-in support for mouse interaction (SGR 1006 protocol). Scroll to navigate lists or change values.
12
- - **Responsive Input:** Supports cursor movement (Left/Right) and character insertion/deletion in text-based prompts.
13
- - **Validation:** Built-in support for input validation (sync and async) with custom error messages.
14
- - **Elegant Look:** Uses ANSI colors for a clean, modern CLI experience.
15
-
16
- ## Installation
17
-
18
- ```shell
19
- npm install mepcli
20
- # or
21
- yarn add mepcli
22
- ```
23
-
24
- ## Usage Example
25
-
26
- Mep provides a static class facade, `MepCLI`, for all interactions.
27
-
28
- ```typescript
29
- import { MepCLI } from 'mepcli';
30
-
31
- async function main() {
32
- // Text input with validation
33
- const name = await MepCLI.text({
34
- message: "Enter your name:",
35
- placeholder: "John Doe",
36
- validate: (v) => v.length > 0 || "Name cannot be empty"
37
- });
38
-
39
- // Number input
40
- const age = await MepCLI.number({
41
- message: "How old are you?",
42
- min: 1,
43
- max: 120
44
- });
45
-
46
- // Toggle (Switch)
47
- const newsletter = await MepCLI.toggle({
48
- message: "Subscribe to newsletter?",
49
- initial: true
50
- });
51
-
52
- // Select menu
53
- const lang = await MepCLI.select({
54
- message: "Preferred Language:",
55
- choices: [
56
- { title: "JavaScript", value: "js" },
57
- { title: "TypeScript", value: "ts" },
58
- { title: "Python", value: "py" }
59
- ]
60
- });
61
-
62
- // Checkbox (Multiple choice)
63
- const tools = await MepCLI.checkbox({
64
- message: "Select tools:",
65
- choices: [
66
- { title: "ESLint", value: "eslint" },
67
- { title: "Prettier", value: "prettier", selected: true },
68
- { title: "Jest", value: "jest" }
69
- ]
70
- });
71
-
72
- // Rating (Star rating)
73
- const stars = await MepCLI.rating({
74
- message: "Rate your experience:",
75
- min: 1,
76
- max: 5,
77
- initial: 5
78
- });
79
-
80
- // Autocomplete (Search)
81
- const city = await MepCLI.autocomplete({
82
- message: "Search for a city:",
83
- suggest: async (query) => {
84
- const cities = [
85
- { title: "New York", value: "NY" },
86
- { title: "London", value: "LDN" },
87
- { title: "Paris", value: "PAR" }
88
- ];
89
- return cities.filter(c => c.title.toLowerCase().includes(query.toLowerCase()));
90
- }
91
- });
92
-
93
- // Sort (Drag & Drop)
94
- const priorities = await MepCLI.sort({
95
- message: "Rank priorities:",
96
- items: ["Speed", "Quality", "Cost"]
97
- });
98
-
99
- // Table (Data selection)
100
- const user = await MepCLI.table({
101
- message: "Select a user:",
102
- columns: ["ID", "Name"],
103
- data: [
104
- { value: 1, row: ["001", "Alice"] },
105
- { value: 2, row: ["002", "Bob"] }
106
- ]
107
- });
108
-
109
- // Color (RGB Picker)
110
- const color = await MepCLI.color({
111
- message: "Choose theme color:",
112
- initial: "#3B82F6"
113
- });
114
-
115
- // Grid (Matrix Selection)
116
- const permissions = await MepCLI.grid({
117
- message: "Manage Permissions:",
118
- rows: ["Admin", "User", "Guest"],
119
- columns: ["Read", "Write", "Delete"]
120
- });
121
-
122
- // Calendar (Date/Range Picker)
123
- const booking = await MepCLI.calendar({
124
- message: "Select dates:",
125
- mode: "range"
126
- });
127
-
128
- // Editor (External text editor)
129
- const bio = await MepCLI.editor({
130
- message: "Write your biography:",
131
- extension: ".md"
132
- });
133
-
134
- // Form (Multi-field input)
135
- const userDetails = await MepCLI.form({
136
- message: "User Details:",
137
- fields: [
138
- { name: "firstname", message: "First Name", initial: "John" },
139
- { name: "lastname", message: "Last Name", validate: (v) => v.length > 0 ? true : "Required" },
140
- { name: "email", message: "Email", validate: (v) => v.includes("@") || "Invalid email" }
141
- ]
142
- });
143
-
144
- // Snippet (Template filling)
145
- const commitMsg = await MepCLI.snippet({
146
- message: "Commit Message:",
147
- template: "feat(${scope}): ${message}",
148
- values: {
149
- scope: "core"
150
- }
151
- });
152
-
153
- // Code Prompt (JSON/YAML Editing)
154
- const config = await MepCLI.code({
155
- message: "Configure Server:",
156
- language: "json",
157
- template: `
158
- {
159
- "host": "\${host}",
160
- "port": \${port},
161
- "debug": \${debug}
162
- }
163
- `
164
- });
165
-
166
- // Tree Select (Hierarchical Multi-Select)
167
- const selectedFiles = await MepCLI.treeSelect({
168
- message: "Select files to backup:",
169
- data: [
170
- {
171
- title: "src",
172
- value: "src",
173
- children: [
174
- { title: "index.ts", value: "src/index.ts" },
175
- { title: "utils.ts", value: "src/utils.ts" }
176
- ]
177
- }
178
- ]
179
- });
180
-
181
- console.log({ name, age, newsletter, lang, tools, stars, city, priorities, user, color, permissions, booking, bio, userDetails, commitMsg, config, selectedFiles });
182
- }
183
-
184
- main();
185
- ```
186
-
187
- ## API Reference
188
-
189
- ### MepCLI
190
-
191
- * `text(options)` - Single line or multiline text input.
192
- * `password(options)` - Masked text input.
193
- * `secret(options)` - Completely hidden text input.
194
- * `number(options)` - Numeric input with increment/decrement support.
195
- * `confirm(options)` - Yes/No question.
196
- * `toggle(options)` - On/Off switch.
197
- * `select(options)` - Single item selection from a list.
198
- * `multiSelect(options)` - Multiple item selection with filtering.
199
- * `checkbox(options)` - Classic checkbox selection.
200
- * `list(options)` - Enter a list of tags/strings.
201
- * `slider(options)` - Select a number within a range using a visual slider.
202
- * `range(options)` - Select a numerical range (min/max) using a dual-handle slider.
203
- * `rating(options)` - Star rating input.
204
- * `date(options)` - Date and time picker.
205
- * `color(options)` - RGB color picker with hex output and TrueColor preview.
206
- * `grid(options)` - 2D matrix selection (rows x columns).
207
- * `calendar(options)` - Interactive monthly calendar for single dates or ranges.
208
- * `file(options)` - File system navigator and selector.
209
- * `autocomplete(options)` - Searchable selection with async suggestions.
210
- * `sort(options)` - Reorder a list of items.
211
- * `transfer(options)` - Move items between two lists (Source/Target).
212
- * `cron(options)` - Visually build a cron schedule (Minute, Hour, Day, Month, Weekday).
213
- * `table(options)` - Display data in columns and select rows.
214
- * `tree(options)` - Navigate and select from a hierarchical tree structure.
215
- * `keypress(options)` - Wait for a specific key press or any key.
216
- * `editor(options)` - Launch an external editor (Vim, Nano, Notepad, etc.) to capture multi-line content.
217
- * `form(options)` - Multi-field input form with navigation.
218
- * `snippet(options)` - Template string filling with variable navigation.
219
- * `code(options)` - Edit variables within a code block (JSON/YAML). Syntax highlighting is supported (Experimental).
220
- * `treeSelect(options)` - Hierarchical multi-selection with cascading checkboxes.
221
- * `spam(options)` - Confirm a dangerous action or fun.
222
- * `wait(options)` - Wait for a specified number of seconds.
223
- * `spinner(message)` - Returns a `Spinner` instance for manual control (`start`, `stop`, `update`, `success`, `error`).
224
-
225
- ## Mouse Support
226
-
227
- MepCLI automatically detects modern terminals and enables **Mouse Tracking** (using SGR 1006 protocol).
228
-
229
- * **Scrolling:**
230
- * `select`, `multiSelect`, `checkbox`, `autocomplete`, `table`, `tree`, `transfer`: Scroll to navigate the list.
231
- * `form`, `snippet`, `cron`: Scroll to navigate between fields or values.
232
- * `number`, `slider`, `range`, `rating`, `date`: Scroll to increment/decrement values or fields.
233
- * `sort`: Scroll to navigate or reorder items (when grabbed).
234
- * `toggle`, `confirm`: Scroll to toggle the state.
235
- * `calendar`: Scroll to switch months.
236
- * `color`: Scroll to adjust RGB channels.
237
- * `grid`: Scroll to move selection.
238
- * **Configuration:**
239
- * Mouse support is enabled by default if the terminal supports it.
240
- * You can explicitly disable it per prompt by setting `mouse: false` in the options.
241
-
242
- ## Advanced Shortcuts
243
-
244
- ### Calendar Prompt
245
-
246
- Mep's Calendar prompt supports advanced navigation and selection shortcuts for power users.
247
-
248
- * **Keyboard:**
249
- * `Arrow Keys`: Move cursor day by day.
250
- * `PageUp` / `PageDown`: Jump to previous/next **Month**.
251
- * `Ctrl + Up` / `Ctrl + Down`: Jump to previous/next **Year**.
252
- * `Home` / `End`: Jump to the first/last day of the current month.
253
- * `t`: Jump immediately to **Today**.
254
- * `Enter`: Select date (or start/end of range).
255
-
256
- * **Mouse:**
257
- * `Scroll`: Navigate **Months**.
258
- * `Ctrl + Scroll`: Adjust the selected **Day** (cursor movement).
259
-
260
- ### Color Prompt
261
-
262
- * **Keyboard:**
263
- * `Tab`: Switch between RGB channels.
264
- * `Up` / `Down`: Move between channels.
265
- * `Left` / `Right`: Adjust current channel value.
266
- * `Shift + Left` / `Shift + Right`: Fast adjust current channel value.
267
-
268
- * **Mouse:**
269
- * `Scroll`: Adjust the current channel value.
270
- * `Ctrl + Scroll`: Fast adjust.
271
-
272
- ### Checkbox Prompt
273
-
274
- * **Keyboard:**
275
- * `Space`: Toggle selection.
276
- * `a`: Select **All**.
277
- * `x` / `n`: Select **None**.
278
- * `i`: **Invert** selection.
279
-
280
- ### MultiSelect Prompt
281
-
282
- * **Keyboard:**
283
- * `Space`: Toggle selection.
284
- * `Ctrl + A`: Select **All** (Visible).
285
- * `Ctrl + X`: Deselect **All** (Visible).
286
- * `Typing`: Filter list.
287
-
288
- ### Transfer Prompt
289
-
290
- * **Keyboard:**
291
- * `Tab` / `Left` / `Right`: Switch focus between Source and Target.
292
- * `Space`: Move selected item.
293
- * `a` / `>`: Move **All** to Target.
294
- * `r` / `<`: Move **All** to Source (Reset).
295
-
296
- ### Tree & TreeSelect Prompt
297
-
298
- * **Keyboard:**
299
- * `Right`: Expand folder or jump to child.
300
- * `Left`: Collapse folder or jump to parent.
301
- * `Space`: Toggle expansion (Tree) or Checkbox (TreeSelect).
302
- * `e`: **Expand** all recursively.
303
- * `c`: **Collapse** all recursively.
304
-
305
- ### Grid Prompt
306
-
307
- The Grid prompt (Matrix selection) includes robust shortcuts for bulk actions.
308
-
309
- * **Keyboard:**
310
- * `Arrow Keys`: Move cursor.
311
- * `PageUp` / `PageDown`: Jump to the first/last **Row**.
312
- * `Home` / `End`: Jump to the first/last **Column**.
313
- * `Space`: Toggle current cell.
314
- * `r`: Toggle entire **Row**.
315
- * `c`: Toggle entire **Column**.
316
- * `a`: Select **All**.
317
- * `x`: Deselect **All** (None).
318
- * `i`: **Invert** selection.
319
-
320
- * **Mouse:**
321
- * `Scroll`: Vertical navigation (Rows).
322
- * `Shift + Scroll`: Horizontal navigation (Columns).
323
-
324
- ## License
325
-
326
- This project is under the **MIT License**.
1
+ <h1 align="center">Mep</h1>
2
+
3
+
4
+ <p align="center">
5
+ <sub>(Mep <a href="examples/basic-prompts.ts">Basic Prompts</a>)</a></sub>
6
+ <img src="https://raw.githubusercontent.com/CodeTease/mep/refs/heads/dev/media/basic.gif" alt="Enquirer Survey Prompt" width="750">
7
+
8
+ **Mep** is a lightweight and zero-dependency library for creating interactive command-line prompts in Node.js. It focuses on simplicity, modern design, and robust input handling.
9
+
10
+ [Try the demo](https://stackblitz.com/edit/mepcli?file=index.js)
11
+
12
+ A **CodeTease** project.
13
+
14
+ ## Features
15
+
16
+ - **Zero Dependency:** Keeps your project clean and fast.
17
+ - **Comprehensive:** 60+ prompt types for every need.
18
+ - **Mouse Support:** Built-in scroll and click interaction.
19
+ - **Responsive:** Fluid cursor movement and validation.
20
+ - **Elegant:** Modern ANSI color styling.
21
+
22
+ ## Installation
23
+
24
+ ```sh
25
+ npm install mepcli
26
+ # or
27
+ yarn add mepcli
28
+ ```
29
+
30
+ ## Quick Start
31
+
32
+ ```typescript
33
+ import { MepCLI } from 'mepcli';
34
+
35
+ async function main() {
36
+ // 1. Text Input
37
+ const name = await MepCLI.text({
38
+ message: "What's your name?",
39
+ placeholder: "John Doe"
40
+ });
41
+
42
+ // 2. Select Menu
43
+ const lang = await MepCLI.select({
44
+ message: "Choose language:",
45
+ choices: [
46
+ { title: "JavaScript", value: "js" },
47
+ { title: "TypeScript", value: "ts" }
48
+ ]
49
+ });
50
+
51
+ // 3. Confirm
52
+ const ready = await MepCLI.confirm({
53
+ message: "Ready to deploy?"
54
+ });
55
+
56
+ console.log({ name, lang, ready });
57
+ }
58
+
59
+ main();
60
+ ```
61
+
62
+ > 💡 **Want more?** Check out the full feature demo in [`example.ts`](example.ts) or browse the `examples/` directory. Or see [`GALLERY.md`](GALLERY.md) for media demos.
63
+
64
+ ## Prompt Types
65
+
66
+ Feature mark with "(experimental)" are still in active development and may have limited functionality or stability.
67
+
68
+ ### 🔹 The Basics
69
+ Essential prompts for everyday input.
70
+
71
+ | Function | Description |
72
+ | :--- | :--- |
73
+ | `text` | Single line or multiline text input. |
74
+ | `password` | Masked text input (`***`). |
75
+ | `secret` | Completely hidden text input. |
76
+ | `number` | Numeric input with increment/decrement. |
77
+ | `confirm` | Yes/No question. |
78
+ | `toggle` | On/Off switch (True/False). |
79
+ | `select` | Single item selection from a list. |
80
+ | `list` | Enter a list of tags/strings. |
81
+
82
+ ### 🔹 Selection & Pickers
83
+ Powerful tools for selecting dates, files, colors, and more.
84
+
85
+ | Function | Description |
86
+ | :--- | :--- |
87
+ | `checkbox` | Multiple choice selection. |
88
+ | `multiSelect` | Multiple selection with filtering. |
89
+ | `multiColumnSelect` | Selection with grid layout. |
90
+ | `fuzzySelect` | Selection with fuzzy search. |
91
+ | `autocomplete` | Async searchable selection. |
92
+ | `selectRange` | Select a continuous range (start-end). |
93
+ | `treeSelect` | Hierarchical multi-selection. |
94
+ | `grid` | 2D matrix selection (rows x columns). |
95
+ | `seat` | Seat selection map with gaps. |
96
+ | `emoji` | Emoji picker with history. |
97
+ | `color` | RGB/Hex color picker. |
98
+ | `date` | Date and time picker. |
99
+ | `calendar` | Interactive calendar for dates/ranges. |
100
+ | `time` | Time picker. |
101
+ | `file` | File system navigator. |
102
+ | `breadcrumb` | Breadcrumb navigation style. |
103
+ | `miller` | Miller columns navigation. |
104
+ | `tree` | Hierarchical tree navigation. |
105
+
106
+ ### 🔹 Advanced Layouts
107
+ Complex interfaces for structured data.
108
+
109
+ | Function | Description |
110
+ | :--- | :--- |
111
+ | `table` | Display data in columns and select rows. |
112
+ | `spreadsheet` | Interactive table editor. |
113
+ | `inspector` | JSON data explorer/editor. |
114
+ | `schedule` | Gantt chart timeline. |
115
+ | `kanban` | Kanban board (Drag & Drop). |
116
+ | `heatmap` | Grid intensity selector. |
117
+ | `sort` | Reorder a list of items. |
118
+ | `sortGrid` | Rearrange items in a 2D grid. |
119
+ | `transfer` | Move items between two lists. |
120
+ | `match` | Link items between source and target. |
121
+ | `map` | Key-Value editor. |
122
+ | `form` | Multi-field input form. |
123
+ | `snippet` | Template string filling. |
124
+ | `cron` | Cron schedule builder. |
125
+ | `code` | Code/JSON editor with syntax highlighting. |
126
+
127
+ ### 🔹 Specialized Inputs
128
+ tailored for specific data formats.
129
+
130
+ | Function | Description |
131
+ | :--- | :--- |
132
+ | `ip` | IPv4 address input. |
133
+ | `semver` | Semantic versioning bumper. |
134
+ | `otp` | One Time Password (PIN) input. |
135
+ | `byte` | Byte size input (KB, MB, GB). |
136
+ | `rating` | Star rating input. |
137
+ | `slider` | Visual numeric slider. |
138
+ | `range` | Dual-handle slider (min-max). |
139
+ | `dial` | Rotary knob for numeric input. |
140
+ | `calculator` | Math expression evaluator. |
141
+ | `region` | ASCII map region selector. |
142
+ | `pattern` | Android-style pattern lock. |
143
+ | `dependency` | Checkbox with logic (Depends/Conflict). |
144
+ | `license` | License picker with Split View. |
145
+ | `regex` | Real-time regex validator. |
146
+ | `box` | Box model (CSS Margin/Padding) editor. |
147
+ | `connectionString` | Database URL wizard. |
148
+ | `curl` (experimental) | Interactive HTTP request builder. |
149
+
150
+ ### 🔹 Gamified & Fun
151
+ Add some personality to your CLI.
152
+
153
+ | Function | Description |
154
+ | :--- | :--- |
155
+ | `slot` | Slot machine randomizer. |
156
+ | `gauge` | Rhythm/accuracy game. |
157
+ | `draw` | Braille canvas drawing. |
158
+ | `quizSelect` | Multiple choice quiz. |
159
+ | `quizText` | Text answer quiz. |
160
+ | `spam` | Mash keys to confirm (fun mode). |
161
+
162
+ ### 🔹 Utilities
163
+ Helper functions for better CLI UX.
164
+
165
+ | Function | Description |
166
+ | :--- | :--- |
167
+ | `exec` (experimental) | Run shell command with spinner. |
168
+ | `scroll` | Scrollable text viewer (e.g., License). |
169
+ | `diff` | Text merge conflict resolver. |
170
+ | `editor` | Open external editor (Vim/Nano). |
171
+ | `shortcut` | Record key combinations. |
172
+ | `keypress` | Wait for a specific key press. |
173
+ | `wait` | Pause for a few seconds. |
174
+ | `spinner` | Simple loading spinner control. |
175
+
176
+ ## Keyboard & Mouse Support
177
+
178
+ MepCLI automatically detects modern terminals and enables **Mouse Tracking** (using SGR 1006 protocol) for scrolling and clicking.
179
+
180
+ ### ⌨️ Advanced Shortcuts
181
+
182
+ <details>
183
+ <summary><b>Calendar Prompt</b></summary>
184
+
185
+ Mep's Calendar prompt supports advanced navigation and selection shortcuts for power users.
186
+
187
+ * **Keyboard:**
188
+ * `Arrow Keys`: Move cursor day by day.
189
+ * `PageUp` / `PageDown`: Jump to previous/next **Month**.
190
+ * `Ctrl + Up` / `Ctrl + Down`: Jump to previous/next **Year**.
191
+ * `Home` / `End`: Jump to the first/last day of the current month.
192
+ * `t`: Jump immediately to **Today**.
193
+ * `Enter`: Select date (or start/end of range).
194
+
195
+ * **Mouse:**
196
+ * `Scroll`: Navigate **Months**.
197
+ * `Ctrl + Scroll`: Adjust the selected **Day** (cursor movement).
198
+
199
+ </details>
200
+
201
+ <details>
202
+ <summary><b>Color Prompt</b></summary>
203
+
204
+ * **Keyboard:**
205
+ * `Tab`: Switch between RGB channels.
206
+ * `Up` / `Down`: Move between channels.
207
+ * `Left` / `Right`: Adjust current channel value.
208
+ * `Shift + Left` / `Shift + Right`: Fast adjust current channel value.
209
+
210
+ * **Mouse:**
211
+ * `Scroll`: Adjust the current channel value.
212
+ * `Ctrl + Scroll`: Fast adjust.
213
+
214
+ </details>
215
+
216
+ <details>
217
+ <summary><b>Checkbox Prompt</b></summary>
218
+
219
+ * **Keyboard:**
220
+ * `Space`: Toggle selection.
221
+ * `a`: Select **All**.
222
+ * `x` / `n`: Select **None**.
223
+ * `i`: **Invert** selection.
224
+
225
+ </details>
226
+
227
+ <details>
228
+ <summary><b>MultiSelect Prompt</b></summary>
229
+
230
+ * **Keyboard:**
231
+ * `Space`: Toggle selection.
232
+ * `Ctrl + A`: Select **All** (Visible).
233
+ * `Ctrl + X`: Deselect **All** (Visible).
234
+ * `Typing`: Filter list.
235
+
236
+ </details>
237
+
238
+ <details>
239
+ <summary><b>Transfer Prompt</b></summary>
240
+
241
+ * **Keyboard:**
242
+ * `Tab` / `Left` / `Right`: Switch focus between Source and Target.
243
+ * `Space`: Move selected item.
244
+ * `a` / `>`: Move **All** to Target.
245
+ * `r` / `<`: Move **All** to Source (Reset).
246
+
247
+ </details>
248
+
249
+ <details>
250
+ <summary><b>Tree & TreeSelect Prompt</b></summary>
251
+
252
+ * **Keyboard:**
253
+ * `Right`: Expand folder or jump to child.
254
+ * `Left`: Collapse folder or jump to parent.
255
+ * `Space`: Toggle expansion (Tree) or Checkbox (TreeSelect).
256
+ * `e`: **Expand** all recursively.
257
+ * `c`: **Collapse** all recursively.
258
+
259
+ </details>
260
+
261
+ <details>
262
+ <summary><b>Grid Prompt</b></summary>
263
+
264
+ The Grid prompt (Matrix selection) includes robust shortcuts for bulk actions.
265
+
266
+ * **Keyboard:**
267
+ * `Arrow Keys`: Move cursor.
268
+ * `PageUp` / `PageDown`: Jump to the first/last **Row**.
269
+ * `Home` / `End`: Jump to the first/last **Column**.
270
+ * `Space`: Toggle current cell.
271
+ * `r`: Toggle entire **Row**.
272
+ * `c`: Toggle entire **Column**.
273
+ * `a`: Select **All**.
274
+ * `x`: Deselect **All** (None).
275
+ * `i`: **Invert** selection.
276
+
277
+ * **Mouse:**
278
+ * `Scroll`: Vertical navigation (Rows).
279
+ * `Shift + Scroll`: Horizontal navigation (Columns).
280
+
281
+ </details>
282
+
283
+ <details>
284
+ <summary><b>Map Prompt</b></summary>
285
+
286
+ * **Keyboard:**
287
+ * `Ctrl + N`: Add new row.
288
+ * `Ctrl + D`: Delete current row.
289
+ * `Arrows` / `Tab`: Navigate cells.
290
+
291
+ </details>
292
+
293
+ <details>
294
+ <summary><b>IP Prompt</b></summary>
295
+
296
+ * **Keyboard:**
297
+ * `typing...`: Auto-jumps to next octet after 3 digits or `.`.
298
+ * `Backspace`: Navigates back to previous octet if empty.
299
+
300
+ </details>
301
+
302
+ <details>
303
+ <summary><b>Kanban Prompt</b></summary>
304
+
305
+ * **Keyboard:**
306
+ * `Arrows`: Navigate items/columns.
307
+ * `Space`: Grab/Drop item (Drag & Drop mode).
308
+ * `Enter`: Submit.
309
+
310
+ * **Mouse:**
311
+ * `Scroll`: Navigate items (Normal) or Move item Left/Right (Grabbed).
312
+
313
+ </details>
314
+
315
+ <details>
316
+ <summary><b>Time Prompt</b></summary>
317
+
318
+ * **Keyboard:**
319
+ * `Up` / `Down`: Adjust value.
320
+ * `Left` / `Right` / `Tab`: Switch unit (Hour/Minute/AM-PM).
321
+
322
+ * **Mouse:**
323
+ * `Scroll`: Adjust value (Up/Down).
324
+
325
+ </details>
326
+
327
+ <details>
328
+ <summary><b>Heatmap Prompt</b></summary>
329
+
330
+ * **Keyboard:**
331
+ * `Arrows`: Navigate cells.
332
+ * `Tab` / `Shift+Tab`: Navigate cells (Horizontal).
333
+ * `Space`: Cycle value.
334
+ * `0-9`: Set value directly.
335
+
336
+ * **Mouse:**
337
+ * `Scroll`: Navigate rows (Vertical).
338
+
339
+ </details>
340
+
341
+ <details>
342
+ <summary><b>Emoji Prompt & MultiColumnSelect</b></summary>
343
+
344
+ * **Keyboard:**
345
+ * `Arrows`: Navigate grid.
346
+ * `Typing`: Filter/Search (Emoji only).
347
+
348
+ </details>
349
+
350
+ <details>
351
+ <summary><b>Miller Prompt</b></summary>
352
+
353
+ * **Keyboard:**
354
+ * `Up` / `Down`: Navigate items.
355
+ * `Right` / `Enter` / `Tab`: Expand child or Drill down.
356
+ * `Left` / `Shift + Tab`: Collapse or Go back.
357
+
358
+ </details>
359
+
360
+ <details>
361
+ <summary><b>Match Prompt</b></summary>
362
+
363
+ * **Keyboard:**
364
+ * `Arrows`: Navigate lists.
365
+ * `Tab`: Switch Source/Target.
366
+ * `Space`: Pick Source or Toggle Link.
367
+
368
+ </details>
369
+
370
+ <details>
371
+ <summary><b>Diff Prompt</b></summary>
372
+
373
+ * **Keyboard:**
374
+ * `Left` / `Right`: Switch Action (Original / Modified / Edit).
375
+ * `Enter`: Submit selection.
376
+
377
+ </details>
378
+
379
+ <details>
380
+ <summary><b>Dial Prompt</b></summary>
381
+
382
+ * **Keyboard:**
383
+ * `Arrows`: Adjust value (rotate knob).
384
+ * `Enter`: Submit.
385
+
386
+ * **Mouse:**
387
+ * `Scroll`: Adjust value.
388
+
389
+ </details>
390
+
391
+ <details>
392
+ <summary><b>Draw Prompt</b></summary>
393
+
394
+ * **Keyboard:**
395
+ * `Arrows`: Move cursor.
396
+ * `Space`: Toggle pixel.
397
+ * `c`: Clear canvas.
398
+ * `i`: Invert canvas.
399
+ * `Enter`: Submit.
400
+
401
+ * **Mouse:**
402
+ * `Drag`: Paint (Left Click) or Erase (Right Click).
403
+ * `Click`: Toggle pixel.
404
+
405
+ </details>
406
+
407
+ <details>
408
+ <summary><b>Breadcrumb Prompt</b></summary>
409
+
410
+ * **Keyboard:**
411
+ * `Arrows`: Navigate list.
412
+ * `Enter`: Drill down into folder.
413
+ * `Backspace`: Go up one level.
414
+
415
+ * **Mouse:**
416
+ * `Scroll`: Navigate list.
417
+
418
+ </details>
419
+
420
+ <details>
421
+ <summary><b>Schedule Prompt</b></summary>
422
+
423
+ * **Keyboard:**
424
+ * `Arrows`: Move task in time.
425
+ * `Tab` / `Shift + Tab`: Switch between tasks.
426
+ * `Shift + Left/Right`: Resize task duration.
427
+ * `PageUp` / `PageDown`: Scroll timeline horizontally.
428
+
429
+ * **Mouse:**
430
+ * `Scroll`: Scroll timeline horizontally.
431
+
432
+ </details>
433
+
434
+ <details>
435
+ <summary><b>Data Inspector</b></summary>
436
+
437
+ * **Keyboard:**
438
+ * `Space` / `Arrows`: Expand/Collapse nodes.
439
+ * `Enter`: Toggle Boolean or Edit String/Number.
440
+
441
+ * **Mouse:**
442
+ * `Scroll`: Navigate tree.
443
+
444
+ </details>
445
+
446
+ <details>
447
+ <summary><b>Seat Prompt</b></summary>
448
+
449
+ * **Keyboard:**
450
+ * `Arrows`: Navigate seat grid.
451
+ * `Tab` / `Shift+Tab`: Navigate Left/Right.
452
+ * `Space`: Select/Deselect seat.
453
+
454
+ * **Mouse:**
455
+ * `Scroll`: Navigate Up/Down.
456
+
457
+ </details>
458
+
459
+ <details>
460
+ <summary><b>Select Range Prompt</b></summary>
461
+
462
+ * **Keyboard:**
463
+ * `Arrows (Up/Down)`: Navigate items.
464
+ * `Space`: Set/Unset anchor point.
465
+ * `Enter`: Submit selected range.
466
+
467
+ </details>
468
+
469
+ <details>
470
+ <summary><b>Sort Grid Prompt</b></summary>
471
+
472
+ * **Keyboard:**
473
+ * `Arrows`: Navigate grid.
474
+ * `Tab` / `Shift+Tab`: Navigate Left/Right.
475
+ * `Space`: Grab/Drop item.
476
+ * `Enter`: Submit grid.
477
+
478
+ * **Mouse:**
479
+ * `Scroll`: Navigate Up/Down.
480
+
481
+ </details>
482
+
483
+ <details>
484
+ <summary><b>Dependency Prompt</b></summary>
485
+
486
+ * **Keyboard:**
487
+ * `Arrows`: Navigate items.
488
+ * `Space`: Toggle item (Triggers auto-resolution).
489
+ * `Enter`: Submit selection.
490
+
491
+ * **Mouse:**
492
+ * `Scroll`: Navigate Up/Down.
493
+
494
+ </details>
495
+
496
+ <details>
497
+ <summary><b>Box Prompt</b></summary>
498
+
499
+ * **Keyboard:**
500
+ * `Arrows` / `Tab`: Navigate (Top -> Right -> Bottom -> Left).
501
+ * `Shift + Tab`: Navigate backwards.
502
+ * `+` / `-`: Increment/Decrement value.
503
+ * `0-9`: Type value directly.
504
+
505
+ * **Mouse:**
506
+ * `Scroll`: Cycle focus (Up=Backwards, Down=Forwards).
507
+
508
+ </details>
509
+
510
+ ## License
511
+
512
+ This project is under the **MIT License**.