From 4fa468c691a349351105b85a6f55e2b226584a1c Mon Sep 17 00:00:00 2001 From: Hong Yi Chen Date: Tue, 28 Jul 2026 14:34:05 -0700 Subject: [PATCH 1/4] docs(cli): draft input and editing page Replace the cli/input-and-editing.mdx stub with full content covering editing basics, the slash command menu with argument hints, up-arrow prompt history, shell tab completions, mouse support, selection and clipboard behavior (incl. OSC 52 over SSH), image attachments, voice input, and the contextual keyboard hints plus the ? shortcuts menu. Dropped from the outline after verifying against warp master: Vim mode (not merged), inline-menu mouse clicks (not shipped), and configurable keybinding claims (the CLI does not load keybinding overrides yet). Co-Authored-By: Oz --- src/content/docs/cli/input-and-editing.mdx | 90 ++++++++++++++++++---- 1 file changed, 76 insertions(+), 14 deletions(-) diff --git a/src/content/docs/cli/input-and-editing.mdx b/src/content/docs/cli/input-and-editing.mdx index 0269b281..570ea155 100644 --- a/src/content/docs/cli/input-and-editing.mdx +++ b/src/content/docs/cli/input-and-editing.mdx @@ -1,47 +1,109 @@ --- title: "Input and editing in the {{WARP_CLI}}" description: >- - The {{WARP_CLI}} input editor: slash commands, history, completions, mouse - support, images, voice input, and Vim mode. + Compose prompts and commands in the {{WARP_CLI}} input editor with slash + commands, history, completions, mouse support, images, and voice input. --- import { VARS } from '@data/vars'; -{/* TODO(cli-input): draft per drafts/warp-cli-launch-plan.md — "cli/input-and-editing.mdx" section. Feature-doc content type. */} +The {VARS.WARP_CLI} input is a multiline editor for prompts and shell commands. It combines readline-style editing with inline menus for slash commands, history, and completions, plus mouse support, image attachments, and voice input. This page covers how to compose and edit input. For the complete list of flags, slash commands, and keyboard shortcuts, see the [{VARS.WARP_CLI} reference](/cli/reference/). -The {VARS.WARP_CLI} documentation for this page is in progress. +## Editing basics + +The input accepts multiple lines and soft-wraps long lines to your terminal width. It grows up to six rows tall, then scrolls. + +* **Submit** - Press `Enter` to send a prompt to the agent or run a shell command. +* **Insert a newline** - Press `Ctrl+J`, or `Shift+Enter` in terminals that support distinguishing it. `Alt+Enter` also works. +* **Edit with readline-style keys** - The editor supports familiar bindings such as `Ctrl+A` and `Ctrl+E` (start and end of line), `Ctrl+W` (delete the previous word), `Ctrl+K` and `Ctrl+U` (delete to the end or start of the line), `Ctrl+Y` (reinsert the last deleted text), and `Ctrl+Z` (undo). + +The full editing and selection table is in the [keyboard shortcuts reference](/cli/reference/#keyboard-shortcuts). ## Slash commands -{/* TODO(cli-input): slash command menu, filtering, argument hints; link to reference page for the full table. */} +Type `/` at the start of an empty input to open the slash command menu. The menu filters as you type, and entries for toggles and pickers show their current state, for example `/theme (currently auto: Dark)` or `/auto-approve (currently off)`. + +1. Type `/` followed by part of a command name. +2. Press `↑` or `↓` to change the selection. +3. Press `Enter` to run the selected command, or `Esc` to close the menu. + +When a command takes an argument, the input shows a ghost-text argument hint after the full command name, for example `/theme `. Type the argument after the command name, then press `Enter`. + +Your [skills](/cli/context/) also appear in the slash command menu, so you can invoke a skill by typing `/` followed by its name. + +The full command table is in the [slash commands reference](/cli/reference/#slash-commands). ## Prompt history -{/* TODO(cli-input): up-arrow history for prompts and shell commands. */} +Press `↑` with the cursor on the first row of the input to open your input history. + +* **What's listed** - In agent mode, the menu lists your previous prompts and shell commands together. Shell command entries carry a `!` prefix. In [shell mode](/cli/shell-commands/), the menu lists commands only. +* **Filter** - Keep typing to filter the list. +* **Preview and accept** - The highlighted entry previews directly in the input. Press `Enter` to keep it, then edit or submit it as usual. +* **Dismiss** - Press `Esc` to close the menu and restore what you were typing. Pressing `↓` past the newest entry does the same. ## Tab completions -{/* TODO(cli-input): completions for shell commands — confirm shipped before merge. */} +In [shell mode](/cli/shell-commands/), press `Tab` to complete the command you're typing, including file and directory paths. + +* If exactly one completion matches, the {VARS.WARP_CLI} applies it immediately. +* If several completions match, the {VARS.WARP_CLI} inserts the longest shared prefix and opens a completion menu. Press `Tab` or `↓` to move through the suggestions, `Enter` to accept the selected one, or `Esc` to dismiss the menu. ## Mouse support -{/* TODO(cli-input): text selection in the input, clicking inline menu rows, selection persistence. */} +The {VARS.WARP_CLI} runs in your terminal, but the input is fully mouse-aware: + +* **Position the cursor** - Click anywhere in the input to move the cursor there. +* **Select text** - Drag to select. Double-click selects a word, and triple-click selects a line. +* **Scroll** - Use the scroll wheel to scroll the input viewport or the conversation transcript. +* **Click controls** - Interactive elements such as the **Voice** footer entry and the attachment bar controls respond to clicks. ## Selection and clipboard -{/* TODO(cli-input): copying, opt-in auto-copy of highlighted input text. */} +* **Highlight to copy** - Finishing a mouse selection in the input or the [conversation transcript](/cli/agent-conversations/) automatically copies it, and the footer briefly shows "copied to clipboard". +* **Keyboard selection** - Extend the selection with `Shift` plus the arrow keys, or select everything with `Ctrl+Shift+A`. Copy with `Ctrl+Shift+C` and cut with `Ctrl+X`. +* **Paste** - Press `Ctrl+V` or `Ctrl+Shift+V` (also `Alt+V` on Windows). Your terminal's own paste shortcut works as well. + +:::note +Copying works over SSH: on remote sessions the {VARS.WARP_CLI} writes the clipboard through the OSC 52 escape sequence (including tmux passthrough), so your local clipboard receives the text when your terminal supports OSC 52. +::: ## Attach images -{/* TODO(cli-input): attaching images as context. */} +Attach images to a prompt so the agent can analyze them: + +* **Paste an image** - Copy an image to your clipboard and press `Ctrl+V`. +* **Paste or drop a file path** - Paste the path to an image file, or drag the file onto your terminal window so its path lands in the input. Absolute paths, paths relative to the working directory, and `~` paths all resolve. + +Supported formats are PNG, JPEG, GIF, and WebP. Attaching an image locks the input to agent mode, since images are sent to the agent rather than the shell. + +Attached images appear in an attachment bar above the input: + +1. Press `Tab` to focus the attachment bar. +2. Press `←` and `→` (or `Tab` and `Shift+Tab`) to move between attachments. +3. Press `Backspace` to remove the selected attachment. +4. Press `Esc` or `Enter` to return focus to the input. ## Voice input -{/* TODO(cli-input): /voice, `Ctrl+S`, configurable keybinding; cross-link voice docs. */} +Dictate prompts instead of typing them: -## Vim mode +1. Start listening with `Ctrl+S`, the `/voice` slash command, or by clicking **Voice** in the footer. The footer shows **Listening** while recording. +2. Speak your prompt. +3. Press `Enter`, or click the footer entry again, to stop recording. The footer shows **Transcribing**, and the transcribed text lands in the input so you can review and edit it before submitting. -{/* TODO(cli-input): vim input mode — confirm shipped before merge. */} +Press `Esc` while transcription is in progress to cancel it. `/voice` clears the input before recording; `Ctrl+S` keeps what you've already typed. + +Voice input in the {VARS.WARP_CLI} uses the same transcription service as the Warp app. See [voice input for agents](/agent-platform/local-agents/interacting-with-agents/voice/) for microphone setup, privacy, and usage limits. ## Keyboard hints and the shortcuts menu -{/* TODO(cli-input): ghost-text hints in the input, shortcuts menu. */} +The {VARS.WARP_CLI} surfaces its shortcuts contextually, so you rarely need to memorize them: + +* **Placeholder hints** - An empty input shows ghost-text hints for the current state, for example "Ask the agent anything • ? for shortcuts • ! for shell mode • / for commands" in agent mode, or "Run a shell command • ? for shortcuts • esc for agent mode" in shell mode. While a long-running command owns the input, the hint row shows "ctrl-c to interrupt". +* **Shortcuts menu** - Type `?` in an empty input to open a shortcuts overview. Its contents adapt to what you're doing: agent mode lists the menu triggers and input history, shell mode shows how to return to agent mode, and extra sections appear during multi-agent sessions or agent-controlled terminal use. Press `Esc`, or just start typing, to close it. + +## Related pages + +* [{VARS.WARP_CLI} reference](/cli/reference/) - Flags, environment variables, slash commands, and keyboard shortcuts. +* [Shell commands in the {VARS.WARP_CLI}](/cli/shell-commands/) - Shell mode, natural language detection, and long-running commands. +* [Agent conversations in the {VARS.WARP_CLI}](/cli/agent-conversations/) - The transcript, tool calls, and diffs. From b41deb92b1fd2e53fc5a9bc464ce689aedb21f44 Mon Sep 17 00:00:00 2001 From: Hong Yi Chen Date: Tue, 28 Jul 2026 14:45:20 -0700 Subject: [PATCH 2/4] docs(cli): use literal Warp CLI in frontmatter {{WARP_CLI}} tokens are not substituted in MDX frontmatter (Astro's content layer parses frontmatter outside Vite), so the built title and description showed the raw token. Body-prose {VARS.WARP_CLI} is unchanged. Verified the built dist/cli/input-and-editing now reads "Input and editing in the Warp CLI". Co-Authored-By: Oz <oz-agent@warp.dev> --- src/content/docs/cli/input-and-editing.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/cli/input-and-editing.mdx b/src/content/docs/cli/input-and-editing.mdx index 570ea155..52bc9851 100644 --- a/src/content/docs/cli/input-and-editing.mdx +++ b/src/content/docs/cli/input-and-editing.mdx @@ -1,7 +1,7 @@ --- -title: "Input and editing in the {{WARP_CLI}}" +title: "Input and editing in the Warp CLI" description: >- - Compose prompts and commands in the {{WARP_CLI}} input editor with slash + Compose prompts and commands in the Warp CLI input editor with slash commands, history, completions, mouse support, images, and voice input. --- import { VARS } from '@data/vars'; From 490a7e008c23933f9e0e580657e0a0250232a407 Mon Sep 17 00:00:00 2001 From: Hong Yi Chen <hongyigma@gmail.com> Date: Tue, 28 Jul 2026 14:58:37 -0700 Subject: [PATCH 3/4] docs(cli): absorb shell commands page into input page Consolidation: merge the verified content of cli/shell-commands.mdx (PR #403, branch hyc/launch-cli-cli-shell-commands) into cli/input-and-editing.mdx as a single "Input and shell commands in the Warp CLI" page. Adds shell mode, natural language detection, long-running and interactive commands, full-screen apps, and stopping/ exiting sections; merges the two history sections into one (adopting the verified submit-on-Enter semantics); rewires shell-mode links to in-page anchors. File rename to the new slug happens at integration. Co-Authored-By: Oz <oz-agent@warp.dev> --- src/content/docs/cli/input-and-editing.mdx | 87 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/src/content/docs/cli/input-and-editing.mdx b/src/content/docs/cli/input-and-editing.mdx index 52bc9851..e1558f25 100644 --- a/src/content/docs/cli/input-and-editing.mdx +++ b/src/content/docs/cli/input-and-editing.mdx @@ -1,12 +1,13 @@ --- -title: "Input and editing in the Warp CLI" +title: "Input and shell commands in the Warp CLI" description: >- - Compose prompts and commands in the Warp CLI input editor with slash - commands, history, completions, mouse support, images, and voice input. + Compose prompts, edit input, and run shell commands in the Warp CLI, + including menus, history, completions, images, voice, and interactive + commands. --- import { VARS } from '@data/vars'; -The {VARS.WARP_CLI} input is a multiline editor for prompts and shell commands. It combines readline-style editing with inline menus for slash commands, history, and completions, plus mouse support, image attachments, and voice input. This page covers how to compose and edit input. For the complete list of flags, slash commands, and keyboard shortcuts, see the [{VARS.WARP_CLI} reference](/cli/reference/). +The {VARS.WARP_CLI} is a full terminal as well as an agent: every session runs a real shell, so you can run commands in the same place you prompt the agent. The input is a multiline editor that combines readline-style editing with inline menus for slash commands, history, and completions, plus mouse support, image attachments, and voice input. This page covers composing and editing input and running shell commands. For the complete list of flags, slash commands, and keyboard shortcuts, see the [{VARS.WARP_CLI} reference](/cli/reference/). ## Editing basics @@ -32,18 +33,21 @@ Your [skills](/cli/context/) also appear in the slash command menu, so you can i The full command table is in the [slash commands reference](/cli/reference/#slash-commands). -## Prompt history +## Input history -Press `↑` with the cursor on the first row of the input to open your input history. +Press `↑` with the cursor on the first row of the input to open the history menu. -* **What's listed** - In agent mode, the menu lists your previous prompts and shell commands together. Shell command entries carry a `!` prefix. In [shell mode](/cli/shell-commands/), the menu lists commands only. +* **What's listed** - In agent mode, the menu combines your previous prompts and shell commands in one list, with commands marked by a `!` prefix. In [shell mode](#shell-mode), the menu lists commands only. * **Filter** - Keep typing to filter the list. -* **Preview and accept** - The highlighted entry previews directly in the input. Press `Enter` to keep it, then edit or submit it as usual. -* **Dismiss** - Press `Esc` to close the menu and restore what you were typing. Pressing `↓` past the newest entry does the same. +* **Preview** - Moving the selection previews each entry in the input and switches the input to the matching mode: recalled commands run as shell commands, and recalled prompts go to the agent. +* **Submit** - Press `Enter` to run the selected command or send the selected prompt. +* **Dismiss** - Press `Esc` to close the menu and restore what you had typed. Pressing `↓` past the newest entry does the same. + +Commands you run in the {VARS.WARP_CLI} are added to your command history. ## Tab completions -In [shell mode](/cli/shell-commands/), press `Tab` to complete the command you're typing, including file and directory paths. +In [shell mode](#shell-mode), press `Tab` to complete the command you're typing, including file and directory paths. * If exactly one completion matches, the {VARS.WARP_CLI} applies it immediately. * If several completions match, the {VARS.WARP_CLI} inserts the longest shared prefix and opens a completion menu. Press `Tab` or `↓` to move through the suggestions, `Enter` to accept the selected one, or `Esc` to dismiss the menu. @@ -102,8 +106,69 @@ The {VARS.WARP_CLI} surfaces its shortcuts contextually, so you rarely need to m * **Placeholder hints** - An empty input shows ghost-text hints for the current state, for example "Ask the agent anything • ? for shortcuts • ! for shell mode • / for commands" in agent mode, or "Run a shell command • ? for shortcuts • esc for agent mode" in shell mode. While a long-running command owns the input, the hint row shows "ctrl-c to interrupt". * **Shortcuts menu** - Type `?` in an empty input to open a shortcuts overview. Its contents adapt to what you're doing: agent mode lists the menu triggers and input history, shell mode shows how to return to agent mode, and extra sections appear during multi-agent sessions or agent-controlled terminal use. Press `Esc`, or just start typing, to close it. +## Shell mode + +The input is agent-first: by default, pressing `Enter` sends your text to the agent as a prompt. Use shell mode to run a command instead: + +1. Press `!` at the start of the input. The prompt marker changes from `>` to `!`, and the statusline below the input shows **Shell mode**. +2. Type a command and press `Enter`. The command runs in the session's shell, and the input returns to agent mode. + +To leave shell mode without running a command, press `Esc`, or press `Backspace` at the start of the input. Any text you typed stays in the input. + +In the transcript, each command you run is marked with a `!` prefix and a highlighted row background, so shell commands stay visually distinct from prompts and agent responses. Output streams in below the command as it's produced. + +In shell mode, press `Tab` to complete commands and paths; see [Tab completions](#tab-completions). + +:::note +Running a shell command cancels the agent's in-progress response, if there is one. +::: + +## Natural language detection + +Out of the box, the {VARS.WARP_CLI} never guesses what your input is: everything goes to the agent unless you enter shell mode. To type commands directly without the `!` prefix, turn on natural language detection: + +- **Toggle detection** - Run `/natural-language-detection` to turn detection on or off. The statusline confirms the change, and the setting persists across sessions. +- **Automatic classification** - With detection on, the {VARS.WARP_CLI} classifies your input as you type. When the input looks like a shell command (for example, `git status`), the input switches to shell mode, and `Enter` runs it as a command. Everything else is sent to the agent. +- **Biased toward the agent** - Short or ambiguous input stays in agent mode, and a single word switches to shell mode only when it matches a command available in your shell. + +The prompt marker and statusline always show the current mode before you press `Enter`. If detection classifies input differently than you intended, press `Esc` to switch back to agent mode, or press `!` at the start of the input to force shell mode. + +## Long-running and interactive commands + +When a command keeps running, such as a dev server, a package install, or an interactive prompt, the {VARS.WARP_CLI} hands input over to it: + +- **Input passthrough** - Keystrokes and pasted text are forwarded to the running process, so password requests, confirmation prompts, and other interactive programs work as they do in a plain terminal. +- **Interrupt hint** - While the command owns input, a dimmed `ctrl-c to interrupt` hint replaces the input. Press `Ctrl+C` to stop the command. +- **Type ahead** - If you start typing your next command before the current one finishes, the typed characters are carried into the input when the command completes, with the cursor at the end. This matches type-ahead behavior in shells like zsh and bash. + +One command runs in the session at a time. If the terminal is already busy, for example while the agent is running a command of its own, submitting a shell command shows a notice in the statusline and keeps your text in the input. + +## Full-screen terminal apps + +Commands that switch the terminal to the alternate screen, such as `vim`, `htop`, or `less`, take over the whole {VARS.WARP_CLI} view: + +- The app renders full-screen and receives keyboard, paste, scroll, and mouse input, so editors and other terminal UIs are fully usable inside the {VARS.WARP_CLI}. +- When the app exits, the transcript returns with your conversation intact. + +## Stopping commands and exiting + +`Ctrl+C` performs one contextual action per press: + +- **While a command is running** - `Ctrl+C` interrupts the running command, as in a plain terminal. It doesn't exit the {VARS.WARP_CLI}. +- **While the agent is responding** - `Ctrl+C` cancels the in-progress response. Text in the input is preserved. +- **At an idle prompt** - `Ctrl+C` clears the input if it has text. + +After a press at the prompt, the statusline shows `ctrl-c again to exit` for about one second. Press `Ctrl+C` a second time within that window to exit the {VARS.WARP_CLI}. This works even while the agent is responding; while a shell command is running, `Ctrl+C` keeps interrupting the command instead. + +There are two other ways to exit: + +- **`Ctrl+D`** - Exits immediately when the input is empty. +- **`/exit`** - Exits from the slash command menu. + +When you exit, the {VARS.WARP_CLI} prints a command you can use to pick the conversation back up later. See [Managing conversations](/cli/conversations/) for resuming and switching conversations. + ## Related pages * [{VARS.WARP_CLI} reference](/cli/reference/) - Flags, environment variables, slash commands, and keyboard shortcuts. -* [Shell commands in the {VARS.WARP_CLI}](/cli/shell-commands/) - Shell mode, natural language detection, and long-running commands. * [Agent conversations in the {VARS.WARP_CLI}](/cli/agent-conversations/) - The transcript, tool calls, and diffs. +* [Managing conversations in the {VARS.WARP_CLI}](/cli/conversations/) - Persistence, resuming, and switching conversations. From 438d0dec3ce49e45c31020ed6a76e6f1ec51bb76 Mon Sep 17 00:00:00 2001 From: Hong Yi Chen <hongyigma@gmail.com> Date: Tue, 28 Jul 2026 15:06:51 -0700 Subject: [PATCH 4/4] docs(cli): rename Warp CLI to Warp Agent CLI in frontmatter Launch name confirmed as Warp Agent CLI. Base branch merge picks up the WARP_CLI var change (e2aebe3c) for body prose; this updates the two literal frontmatter strings (title, description). Verified the built title reads "Input and shell commands in the Warp Agent CLI". Co-Authored-By: Oz <oz-agent@warp.dev> --- src/content/docs/cli/input-and-editing.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/cli/input-and-editing.mdx b/src/content/docs/cli/input-and-editing.mdx index e1558f25..4b3e7502 100644 --- a/src/content/docs/cli/input-and-editing.mdx +++ b/src/content/docs/cli/input-and-editing.mdx @@ -1,7 +1,7 @@ --- -title: "Input and shell commands in the Warp CLI" +title: "Input and shell commands in the Warp Agent CLI" description: >- - Compose prompts, edit input, and run shell commands in the Warp CLI, + Compose prompts, edit input, and run shell commands in the Warp Agent CLI, including menus, history, completions, images, voice, and interactive commands. ---