editprompt 1.4.1 → 1.6.0
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 +45 -10
- package/dist/index.js +688 -201
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ A CLI tool that lets you write prompts for CLI tools using your favorite text ed
|
|
|
22
22
|
## ✨ Features
|
|
23
23
|
|
|
24
24
|
- 🖊️ **Editor Integration**: Use your preferred text editor to write prompts
|
|
25
|
-
- 🖥️ **Multiplexer Support**: Send prompts directly to tmux or
|
|
25
|
+
- 🖥️ **Multiplexer Support**: Send prompts directly to tmux, WezTerm, or Herdr sessions
|
|
26
26
|
- 🖥️ **Universal Terminal Support**: Works with any terminal via clipboard - no multiplexer required
|
|
27
27
|
- 📤 **Send Without Closing**: Iterate on prompts without closing your editor
|
|
28
28
|
- 📋 **Quote Buffering**: Collect text selections and send them as quoted replies
|
|
@@ -88,7 +88,7 @@ Ideal for trial-and-error workflows with AI assistants.
|
|
|
88
88
|
|
|
89
89
|
For replying to specific parts of AI responses:
|
|
90
90
|
|
|
91
|
-
1. Select text in your terminal
|
|
91
|
+
1. Select text in your terminal and trigger collect mode
|
|
92
92
|
2. Repeat to collect multiple selections
|
|
93
93
|
3. Run `editprompt dump` to retrieve all collected quotes
|
|
94
94
|
4. Edit and send your reply with context
|
|
@@ -169,6 +169,24 @@ bind -n M-q run-shell '\
|
|
|
169
169
|
|
|
170
170
|
**Note:** The `-lc` flag ensures your shell loads the full login environment, making `editprompt` available in your PATH.
|
|
171
171
|
|
|
172
|
+
### Herdr Integration
|
|
173
|
+
|
|
174
|
+
Herdr v0.7.5 or later exposes the pane environment and socket API used by editprompt. Add a custom command to `~/.config/herdr/config.toml`:
|
|
175
|
+
|
|
176
|
+
```toml
|
|
177
|
+
[[keys.command]]
|
|
178
|
+
key = "prefix+e"
|
|
179
|
+
type = "shell"
|
|
180
|
+
command = 'editprompt toggle --mux herdr --target-pane "$HERDR_ACTIVE_PANE_ID" --editor nvim --always-copy --pane-rows 12'
|
|
181
|
+
description = "open prompt editor"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Run the binding from a target pane. editprompt opens a regular bottom split for the editor; after content is sent, it focuses the target pane again. If an editor pane is already registered, the command focuses that pane instead. Run the same binding from the editor pane to return to the first available target pane without sending content.
|
|
185
|
+
|
|
186
|
+
`--pane-rows` sets the desired editor height. Herdr limits split ratios to 10–90%, so editprompt uses the requested row count when possible and clamps it to those limits for very short or tall panes. The editor process replaces the split pane's shell, so the pane closes when the editor exits.
|
|
187
|
+
|
|
188
|
+
Inside a Herdr pane, editprompt automatically selects the Herdr backend when `HERDR_SOCKET_PATH` and a pane ID are available. An explicit `--mux` option or `EDITPROMPT_MUX` value takes precedence, so the binding above keeps `--mux herdr` to make its intent clear.
|
|
189
|
+
|
|
172
190
|
### Editor Integration (Send Without Closing)
|
|
173
191
|
|
|
174
192
|
While editprompt is running, you can send content to the target pane or clipboard without closing the editor. This allows you to iterate quickly on your prompts.
|
|
@@ -186,7 +204,8 @@ editprompt input --auto-send -- "your content here"
|
|
|
186
204
|
|
|
187
205
|
editprompt input --auto-send --send-key "C-m" -- "your content here"
|
|
188
206
|
# Customize the key to send after content (tmux format example)
|
|
189
|
-
# WezTerm example: --send-key "\r"
|
|
207
|
+
# WezTerm example: --send-key "\r"
|
|
208
|
+
# Herdr example: --send-key "enter"
|
|
190
209
|
```
|
|
191
210
|
|
|
192
211
|
This sends the content to the target pane (or clipboard) while keeping your editor open, so you can continue editing and send multiple times.
|
|
@@ -197,6 +216,7 @@ This sends the content to the target pane (or clipboard) while keeping your edit
|
|
|
197
216
|
- `--send-key <key>`: Customize the key to send after content (requires `--auto-send`)
|
|
198
217
|
- tmux format: `Enter` (default), `C-a`, etc.
|
|
199
218
|
- WezTerm format: `\r` (default), `\x01`, etc.
|
|
219
|
+
- Herdr format: `enter` (default), `ctrl+a`, etc.
|
|
200
220
|
|
|
201
221
|
#### Neovim Integration
|
|
202
222
|
|
|
@@ -210,12 +230,16 @@ Send individual key inputs to the target pane without leaving your editor. Usefu
|
|
|
210
230
|
# Send a character key
|
|
211
231
|
editprompt press -- 1
|
|
212
232
|
|
|
213
|
-
# Send special keys (tmux
|
|
233
|
+
# Send special keys (tmux examples)
|
|
214
234
|
editprompt press -- Tab
|
|
215
235
|
editprompt press -- Up
|
|
216
236
|
editprompt press -- C-m # Enter
|
|
217
237
|
editprompt press -- C-c # Ctrl+C
|
|
218
238
|
|
|
239
|
+
# Herdr examples
|
|
240
|
+
editprompt press -- enter
|
|
241
|
+
editprompt press -- ctrl+c
|
|
242
|
+
|
|
219
243
|
# Send with delay
|
|
220
244
|
editprompt press --delay 500 -- Tab
|
|
221
245
|
```
|
|
@@ -228,12 +252,12 @@ editprompt press --delay 500 -- Tab
|
|
|
228
252
|
|
|
229
253
|
**Key notation** depends on your multiplexer:
|
|
230
254
|
|
|
231
|
-
| Key | tmux | WezTerm |
|
|
232
|
-
| ------------- | ------------- | ------------------- |
|
|
233
|
-
| Enter | `C-m` | `\r` |
|
|
234
|
-
| Tab | `Tab` | `\t` |
|
|
235
|
-
| Escape | `Escape` | `\x1b` |
|
|
236
|
-
| Arrow Up/Down | `Up` / `Down` | `\x1b[A` / `\x1b[B` |
|
|
255
|
+
| Key | tmux | WezTerm | Herdr |
|
|
256
|
+
| ------------- | ------------- | ------------------- | ------------- |
|
|
257
|
+
| Enter | `C-m` | `\r` | `enter` |
|
|
258
|
+
| Tab | `Tab` | `\t` | `tab` |
|
|
259
|
+
| Escape | `Escape` | `\x1b` | `esc` |
|
|
260
|
+
| Arrow Up/Down | `Up` / `Down` | `\x1b[A` / `\x1b[B` | `up` / `down` |
|
|
237
261
|
|
|
238
262
|
### Quote Workflow Setup
|
|
239
263
|
|
|
@@ -293,6 +317,16 @@ return {
|
|
|
293
317
|
3. Repeat to collect multiple quotes
|
|
294
318
|
4. All quotes are stored in a configuration file associated with the target pane
|
|
295
319
|
|
|
320
|
+
#### Collecting Quotes in Herdr
|
|
321
|
+
|
|
322
|
+
Pass selected text as an argument together with the target pane ID:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
editprompt collect --mux herdr --target-pane "$HERDR_PANE_ID" -- "selected text"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
This can be called from a script or editor integration that has access to the selected text. Herdr quote buffers are stored in editprompt's configuration, associated with the target pane.
|
|
329
|
+
|
|
296
330
|
#### Capturing Collected Quotes
|
|
297
331
|
|
|
298
332
|
Run this command from within your editor pane to retrieve all collected quotes:
|
|
@@ -315,6 +349,7 @@ This copies all collected quotes to the clipboard and clears the buffer, ready f
|
|
|
315
349
|
|
|
316
350
|
- **tmux**: Quotes are stored in pane variables, automatically cleaned up when the pane closes
|
|
317
351
|
- **WezTerm**: Quotes are stored in a configuration file associated with the pane
|
|
352
|
+
- **Herdr**: Quotes are stored in editprompt's configuration and associated with the pane ID
|
|
318
353
|
- Text is intelligently processed: removes common indentation, handles line breaks smartly
|
|
319
354
|
- Each quote is prefixed with `> ` in markdown quote format
|
|
320
355
|
- Multiple quotes are separated with blank lines
|