{"id":46434103,"url":"https://github.com/eetann/editprompt","last_synced_at":"2026-04-02T18:51:45.221Z","repository":{"id":299323145,"uuid":"1002350549","full_name":"eetann/editprompt","owner":"eetann","description":"Write CLI prompts in your favorite editor","archived":false,"fork":false,"pushed_at":"2026-03-30T05:11:46.000Z","size":293,"stargazers_count":37,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T06:04:05.495Z","etag":null,"topics":["cli"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/editprompt","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eetann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-15T09:27:19.000Z","updated_at":"2026-03-30T05:10:24.000Z","dependencies_parsed_at":"2025-06-16T00:41:47.060Z","dependency_job_id":"973a007f-74b5-4327-97d8-64a0df157c3b","html_url":"https://github.com/eetann/editprompt","commit_stats":null,"previous_names":["eetann/ccsender","eetann/editprompt"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/eetann/editprompt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eetann%2Feditprompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eetann%2Feditprompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eetann%2Feditprompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eetann%2Feditprompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eetann","download_url":"https://codeload.github.com/eetann/editprompt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eetann%2Feditprompt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli"],"created_at":"2026-03-05T19:37:24.779Z","updated_at":"2026-04-02T18:51:45.207Z","avatar_url":"https://github.com/eetann.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/editprompt\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/editprompt?color=CB0200\" alt=\"link to npm.js\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# 📝 editprompt\n\nA CLI tool that lets you write prompts for CLI tools using your favorite text editor. Works seamlessly with Claude Code, Codex CLI, Gemini CLI, and any other CLI process.\n\n![send without closing editor](https://github.com/user-attachments/assets/b0e486af-78d7-4b70-8c82-64d330c22ba1)\n\n\u003e [!IMPORTANT]\n\u003e **📢 Migrating from v0.8.1 or earlier?** Please see the [Migration Guide](docs/migration-guide-v1.md) for upgrading to v1.0.0's subcommand-based interface.\n\n## 🏆 Why editprompt?\n\n- **🎯 Your Editor, Your Way**: Write prompts in your favorite editor with full syntax highlighting, plugins, and customizations\n- **🚫 No Accidental Sends**: Never accidentally hit Enter and send an incomplete prompt again\n- **🔄 Iterate Efficiently**: Keep your editor open and send multiple prompts without reopening\n- **💬 Quote and Reply**: Collect multiple text selections and reply to specific parts of AI responses\n- **📝 Multi-line Commands**: Complex SQL queries, JSON payloads, and structured prompts\n\n## ✨ Features\n\n- 🖊️ **Editor Integration**: Use your preferred text editor to write prompts\n- 🖥️ **Multiplexer Support**: Send prompts directly to tmux or WezTerm sessions\n- 🖥️ **Universal Terminal Support**: Works with any terminal via clipboard - no multiplexer required\n- 📤 **Send Without Closing**: Iterate on prompts without closing your editor\n- 📋 **Quote Buffering**: Collect text selections and send them as quoted replies\n- 📋 **Clipboard Fallback**: Automatically copies to clipboard if sending fails\n\n## 📦 Installation\n\n```bash\n# Install globally via npm\nnpm install -g editprompt\n\n# Or use with npx\nnpx editprompt\n```\n\n### Neovim Plugin\n\nFor Neovim users, [editprompt.nvim](https://github.com/eetann/editprompt.nvim) provides easy integration. For manual configuration, see [docs/neovim.md](docs/neovim.md).\n\n## 🚀 Usage\n\neditprompt supports three main workflows to fit different use cases:\n\n### Workflow 1: Basic - Write and Send\n\n![wrihte and send prompt by editprompt](https://github.com/user-attachments/assets/6587b0c4-8132-4d5c-be68-3aa32a8d4df2)\n\nThe simplest way to use editprompt:\n\n1. Run `editprompt open` to open your editor\n2. Write your prompt\n3. Save and close the editor\n4. Content is automatically sent to the target pane or clipboard\n\nPerfect for one-off prompts when you need more space than a terminal input line.\n\n### Workflow 2: Interactive - Iterate with Editor Open\n\n![send without closing editor](https://github.com/user-attachments/assets/b0e486af-78d7-4b70-8c82-64d330c22ba1)\n\nFor iterating on prompts without constantly reopening the editor:\n\n1. Set up a keybinding to open editprompt with `resume` subcommand\n2. Editor pane stays open between sends\n3. Write, send, refine, send again - all without closing the editor\n4. Use the same keybinding to toggle between your work pane and editor pane\n\nIdeal for trial-and-error workflows with AI assistants.\n\n### Workflow 3: Quote - Collect and Reply\n\n![quote and capture with editprompt](https://github.com/user-attachments/assets/33af0702-5c80-4ccf-80d9-0ae42052e6fa)\n\n```markdown\n\u003e Some AI agents include leading spaces in their output,which can make the copied text look a bit awkward.\n\n\u003c!-- Write your reply here --\u003e\n\n\u003e Using editprompt’s quote mode or capture mode makes it easy to reply while quoting the AI agent’s output.\n\n\u003c!-- Write your reply here --\u003e\n```\n\nFor replying to specific parts of AI responses:\n\n1. Select text in your terminal (tmux copy mode or WezTerm selection) and trigger collect mode\n2. Repeat to collect multiple selections\n3. Run `editprompt dump` to retrieve all collected quotes\n4. Edit and send your reply with context\n\nPerfect for addressing multiple points in long AI responses.\n\n## ⚙️ Setup \u0026 Configuration\n\n### Basic Setup\n\n```bash\n# Use with your default editor (from $EDITOR)\neditprompt open\n\n# Specify a different editor\neditprompt open --editor nvim\neditprompt open -e nvim\n\n# Always copy to clipboard\neditprompt open --always-copy\n\n# Show help\neditprompt --help\neditprompt open --help\n```\n\n### Tmux Integration\n\n```tmux\nbind -n M-q run-shell '\\\n  editprompt resume --target-pane #{pane_id} || \\\n  tmux split-window -v -l 10 -c \"#{pane_current_path}\" \\\n    \"editprompt open --editor nvim --always-copy --target-pane #{pane_id}\"'\n```\n\n### WezTerm Integration\n\n```lua\n{\n  key = \"q\",\n  mods = \"OPT\",\n  action = wezterm.action_callback(function(window, pane)\n    local target_pane_id = tostring(pane:pane_id())\n\n    -- Try to resume existing editor pane\n    local success, stdout, stderr = wezterm.run_child_process({\n      \"/bin/zsh\",\n      \"-lc\",\n      string.format(\n        \"editprompt resume --mux wezterm --target-pane %s\",\n        target_pane_id\n      ),\n    })\n\n    -- If resume failed, create new editor pane\n    if not success then\n      window:perform_action(\n        act.SplitPane({\n          direction = \"Down\",\n          size = { Cells = 10 },\n          command = {\n            args = {\n              \"/bin/zsh\",\n              \"-lc\",\n              string.format(\n                \"editprompt open --editor nvim --always-copy --mux wezterm --target-pane %s\",\n                target_pane_id\n              ),\n            },\n          },\n        }),\n        pane\n      )\n    end\n  end),\n},\n```\n\n**Note:** The `-lc` flag ensures your shell loads the full login environment, making `editprompt` available in your PATH.\n\n### Editor Integration (Send Without Closing)\n\nWhile 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.\n\n#### Command Line Usage\n\n```bash\n# Run this command from within your editor session\neditprompt input -- \"your content here\"\n# Sends content to target pane and moves focus there\n\neditprompt input --auto-send -- \"your content here\"\n# Sends content, automatically submits it (presses Enter), and returns focus to editor pane\n# Perfect for iterating on prompts without leaving your editor\n\neditprompt input --auto-send --send-key \"C-m\" -- \"your content here\"\n# Customize the key to send after content (tmux format example)\n# WezTerm example: --send-key \"\\r\" (default for WezTerm is \\r, tmux default is Enter)\n```\n\nThis sends the content to the target pane (or clipboard) while keeping your editor open, so you can continue editing and send multiple times.\n\n**Options:**\n\n- `--auto-send`: Automatically sends the content and returns focus to your editor pane (requires multiplexer)\n- `--send-key \u003ckey\u003e`: Customize the key to send after content (requires `--auto-send`)\n  - tmux format: `Enter` (default), `C-a`, etc.\n  - WezTerm format: `\\r` (default), `\\x01`, etc.\n\n#### Neovim Integration\n\nFor Neovim users, we recommend using [editprompt.nvim](https://github.com/eetann/editprompt.nvim) for easy setup. For manual configuration, see [docs/neovim.md](docs/neovim.md).\n\n### Key Sending (press)\n\nSend individual key inputs to the target pane without leaving your editor. Useful for responding to AI agent selection prompts (e.g., choosing option 1, 2, 3, 4) without switching panes.\n\n```bash\n# Send a character key\neditprompt press -- 1\n\n# Send special keys (tmux format)\neditprompt press -- Tab\neditprompt press -- Up\neditprompt press -- C-m    # Enter\neditprompt press -- C-c    # Ctrl+C\n\n# Send with delay\neditprompt press --delay 500 -- Tab\n```\n\n**Key differences from `input`:**\n\n- No Enter key is automatically appended\n- Focus stays on the editor pane (no pane switching)\n- Designed for single key inputs, not text content\n\n**Key notation** depends on your multiplexer:\n\n| Key           | tmux          | WezTerm             |\n| ------------- | ------------- | ------------------- |\n| Enter         | `C-m`         | `\\r`                |\n| Tab           | `Tab`         | `\\t`                |\n| Escape        | `Escape`      | `\\x1b`              |\n| Arrow Up/Down | `Up` / `Down` | `\\x1b[A` / `\\x1b[B` |\n\n### Quote Workflow Setup\n\n#### Collecting Quotes in tmux Copy Mode\n\nAdd this keybinding to your `.tmux.conf` to collect selected text as quotes:\n\n```tmux\nbind-key -T copy-mode-vi C-e { send-keys -X pipe \"editprompt collect --target-pane #{pane_id}\" }\n```\n\n**Usage:**\n\n1. Enter tmux copy mode (`prefix + [`)\n2. Select text using vi-mode keybindings\n3. Press `Ctrl-e` to add the selection as a quote\n4. Repeat to collect multiple quotes\n5. All quotes are stored in a pane variable associated with the target pane\n\n#### Collecting Quotes in WezTerm\n\nAdd this event handler and keybinding to your `wezterm.lua` to collect selected text as quotes:\n\n```lua\nlocal wezterm = require(\"wezterm\")\n\nwezterm.on(\"editprompt-collect\", function(window, pane)\n  local text = window:get_selection_text_for_pane(pane)\n  local target_pane_id = tostring(pane:pane_id())\n\n  wezterm.run_child_process({\n    \"/bin/zsh\",\n    \"-lc\",\n    string.format(\n      \"editprompt collect --mux wezterm --target-pane %s -- %s\",\n      target_pane_id,\n      wezterm.shell_quote_arg(text)\n    ),\n  })\nend)\n\nreturn {\n  keys = {\n    {\n      key = \"e\",\n      mods = \"CTRL\",\n      action = wezterm.action.EmitEvent(\"editprompt-collect\"),\n    },\n  },\n}\n```\n\n**Usage:**\n\n1. Select text in WezTerm (by dragging with mouse or using copy mode)\n2. Press `Ctrl-e` to add the selection as a quote\n3. Repeat to collect multiple quotes\n4. All quotes are stored in a configuration file associated with the target pane\n\n#### Capturing Collected Quotes\n\nRun this command from within your editor pane to retrieve all collected quotes:\n\n```bash\neditprompt dump\n```\n\nThis copies all collected quotes to the clipboard and clears the buffer, ready for your reply.\n\n**Complete workflow:**\n\n1. AI responds with multiple points\n2. Select each point in copy mode and press `Ctrl-e`\n3. Open your editor pane and run `editprompt dump`\n4. Edit the quoted text with your responses\n5. Send to AI\n\n**How quote buffering works:**\n\n- **tmux**: Quotes are stored in pane variables, automatically cleaned up when the pane closes\n- **WezTerm**: Quotes are stored in a configuration file associated with the pane\n- Text is intelligently processed: removes common indentation, handles line breaks smartly\n- Each quote is prefixed with `\u003e ` in markdown quote format\n- Multiple quotes are separated with blank lines\n\n### Sending to Multiple Panes\n\nYou can send content to multiple target panes simultaneously by specifying `--target-pane` multiple times:\n\n```bash\n# Send to multiple panes with open subcommand\neditprompt open --target-pane %1 --target-pane %2 --target-pane %3\n\n# Register multiple target panes for use with resume and input modes\neditprompt register --target-pane %1 --target-pane %2\n```\n\nThe content will be sent sequentially to all specified panes. This is useful when you want to send the same prompt to multiple CLI sessions.\n\n### Prompt Stash\n\nStore prompts temporarily for later use, similar to `git stash`. This is useful when you want to save a prompt idea and use it later.\n\n```bash\n# Save a prompt to stash (must be run from editor pane)\neditprompt stash push -- \"your prompt here\"\n\n# List all stashed prompts (JSON output)\neditprompt stash list\n\n# Get the latest stashed prompt (outputs to stdout)\neditprompt stash apply\n\n# Get a specific stashed prompt by key\neditprompt stash apply --key \"2025-01-07T12:34:56.789Z\"\n\n# Remove the latest stashed prompt\neditprompt stash drop\n\n# Get and remove the latest stashed prompt (apply + drop)\neditprompt stash pop\n```\n\n**Note:** The stash commands must be run from within an editprompt editor session (where `EDITPROMPT=1` is set). Stash data is associated with the target pane and persisted using the Conf library.\n\n### Environment Variables\n\n#### Editor Selection\n\neditprompt respects the following editor priority:\n\n1. `--editor/-e` command line option\n2. `$EDITOR` environment variable\n3. Default: `vim`\n\n#### EDITPROMPT Environment Variable\n\neditprompt automatically sets `EDITPROMPT=1` when launching your editor. This allows you to detect when your editor is launched by editprompt and enable specific configurations or plugins. For Neovim integration examples, see [docs/neovim.md](docs/neovim.md).\n\n#### Custom Environment Variables\n\nYou can also pass custom environment variables to your editor:\n\n```bash\n# Single environment variable\neditprompt open --env THEME=dark\n\n# Multiple environment variables\neditprompt open --env THEME=dark --env FOO=fooooo\n\n# Useful for editor-specific configurations\neditprompt open --env NVIM_CONFIG=minimal\n```\n\n#### Target Pane Environment Variable\n\nWhen using the send-without-closing feature or dump, editprompt sets `EDITPROMPT_TARGET_PANE` to the target pane ID. This is automatically used by `editprompt input` and `editprompt dump` commands.\n\n### Logging Options\n\neditprompt uses structured logging via [LogTape](https://logtape.org/). The following flags are available on all subcommands:\n\n| Flag                | Description                                |\n| ------------------- | ------------------------------------------ |\n| `--quiet` / `-q`    | Suppress all log output                    |\n| `--verbose` / `-v`  | Enable debug-level log output              |\n| `--log-file \u003cpath\u003e` | Write logs to the specified file (appends) |\n\nYou can also configure logging via environment variables:\n\n| Environment Variable   | Description                                          |\n| ---------------------- | ---------------------------------------------------- |\n| `EDITPROMPT_LOG_FILE`  | Path to log file (same as `--log-file`)              |\n| `EDITPROMPT_LOG_LEVEL` | Log level (e.g. `debug`, `info`, `warning`, `error`) |\n\n**Log level resolution priority:**\n\n1. `--quiet` → suppresses all logs\n2. `--verbose` → sets level to `debug`\n3. `EDITPROMPT_LOG_LEVEL` → uses the specified level\n4. Default: `info`\n\n### Send-Key Delay\n\nWhen using `--auto-send` with `editprompt input`, a delay is inserted before sending the key to allow the target process to finish processing the content.\n\n| Environment Variable        | Description                                  | Default |\n| --------------------------- | -------------------------------------------- | ------- |\n| `EDITPROMPT_SEND_KEY_DELAY` | Delay in milliseconds before sending the key | `1000`  |\n\n**Auto-detection:** editprompt automatically adjusts the delay based on content:\n\n- **Content with image paths** → uses `EDITPROMPT_SEND_KEY_DELAY` (default: `1000` ms)\n- **Content without image paths** → uses `200` ms\n\nSupported image extensions: `.png`, `.webp`, `.avif`, `.jpg`/`.jpeg`, `.gif` (case-insensitive)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feetann%2Feditprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feetann%2Feditprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feetann%2Feditprompt/lists"}