Merged
Conversation
d99d34d to
7a98e49
Compare
Add shell command execution directly from the chat input: - $ prefix: runs command, output added to agent context - $$ prefix: runs command in incognito mode (output not in context) Implementation: - WebSocket protocol: new shell_exec (client) and shell_result (server) message types - Server: spawns commands in thread workspace with 30s timeout, 1MB buffer - UI: monospace output rendering with exit code badges and incognito indicators - Visual indicator in input area showing mode explanation while typing - Runtime validation for new message types with tests Co-authored-by: Amp <amp@ampcode.com>
9cd6ee4 to
d85a3a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements PR 5 from the Amp CLI feature parity plan.
Inline Shell Mode (
$/$$)The Amp CLI supports
$prefix in the chat input to run shell commands with output added to agent context, and$$for "incognito" mode where output is shown but NOT added to context. Our app previously only had a full PTY terminal viaCtrl+T.How it works:
$ ls -la→ runs in thread workspace, shows output inline in chat$$ git status→ runs incognito (output dimmed, not in agent context)$/$$prefix, explaining the modeEditor Prompt (removed)
The Ctrl+G / $EDITOR prompt feature was planned but removed after multiple attempts (
Ctrl+G,Ctrl+E,Alt+E) all conflicted with browser or macOS default shortcuts. This is a limitation of the web environment vs the native CLI.Changes
shared/websocket.tsshell_execclient andshell_resultserver message typesshared/validation.tsshell_execmessagesshared/validation.test.tsshell_execvalidationserver/websocket.tssrc/utils/parseMarkdown.tsMessagetype with shell result fieldssrc/components/terminal/useTerminalWebSocket.tssendShellExec()+shell_resulthandlersrc/components/terminal/Terminal.tsx$/$$prefix detection inhandleSendMessagesrc/components/terminal/TerminalInput.tsxsrc/components/terminal/TerminalMessages.tsxsrc/styles/terminal.cssTesting
pnpm checkpasses (format, lint, typecheck, build)pnpm testpasses (227 tests)$ ls -laruns and shows output inline$$ git statusruns incognito (dimmed output)