Execute shell commands with selected text and view the output in hover tooltips.
- Execute custom shell commands (Bash or PowerShell) with selected text as input
- View command output in hover tooltips when you hover over the selected text
- Configurable command templates with placeholder syntax
- Support for both Bash and PowerShell
- Visual progress feedback during command execution
- Configurable timeout for command execution
- JSON File Support: Post JSON files to remote URLs with a play button in the editor
- View pretty-formatted, syntax-highlighted JSON responses in a side panel
- Select text in the editor (or place cursor on a word)
- Press
Ctrl+Shift+E(orCmd+Shift+Eon Mac) or use the command palette to run "Execute Command with Selection" - The command output will appear in a popup panel immediately
- Hover over the text to see a rich tooltip with a preview of the output
- Click the link in the tooltip to view the full output in a popup panel
Note: If no text is selected, the extension will automatically use the word under the cursor.
- Immediate popup: After command execution, output appears in a side panel
- Rich hover tooltip: Hover over the text to see:
- ✅/❌ icon indicating success or error
- The input text that was used
- The actual command that was executed
- Preview of the output
- Full output link: Click the link in the tooltip to open the complete output in a popup
Configure the extension in your VS Code settings:
The shell command template to execute. Use {{input}} as a placeholder for the selected text.
Default: echo {{input}}
Examples:
echo {{input}} | wc -w- Count words in selectionecho {{input}} | tr '[:lower:]' '[:upper:]'- Convert to uppercasecurl -s "https://api.example.com/lookup?q={{input}}"- API lookup
The shell type to use for command execution.
Options: bash, powershell
Default: bash
Command execution timeout in milliseconds.
Default: 30000 (30 seconds)
Remote URL to POST JSON files to. When configured, a play button (
Default: "" (empty, feature disabled)
Example: https://httpbin.org/post (free testing endpoint)
HTTP method to use when posting JSON.
Options: POST, PUT
Default: POST
Custom headers to include in the JSON POST request.
Default:
{
"Content-Type": "application/json"
}Example with authentication:
{
"Content-Type": "application/json",
"Authorization": "Bearer your-token-here"
}{
"commandOutputHover.commandTemplate": "echo {{input}} | wc -w",
"commandOutputHover.shellType": "bash"
}{
"commandOutputHover.commandTemplate": "echo {{input}} | tr '[:lower:]' '[:upper:]'",
"commandOutputHover.shellType": "bash"
}{
"commandOutputHover.commandTemplate": "echo -n {{input}} | base64",
"commandOutputHover.shellType": "bash"
}{
"commandOutputHover.commandTemplate": "curl -s 'https://api.dictionaryapi.dev/api/v2/entries/en/{{input}}' | jq -r '.[0].meanings[0].definitions[0].definition'",
"commandOutputHover.shellType": "bash"
}{
"commandOutputHover.commandTemplate": "('{{input}}').Length",
"commandOutputHover.shellType": "powershell"
}When you open a JSON file, you have two options:
Right-click the JSON file → "Reopen Editor With..." → "JSON API Tester"
This opens a split-view editor with:
- Left pane: JSON editor
- URL text box: Type your endpoint URL
- POST button: Click to send the request
- Right pane: Response viewer with syntax highlighting
Open JSON file normally and use the toolbar buttons:
▶️ Play Button: Posts to the default URL from settings- ✏️ Edit Button: Prompts you to enter a custom URL
- Right-click any
.jsonfile - Select "Reopen Editor With..." → "JSON API Tester"
- You'll see a split-view interface:
┌─────────────────────────────────────────────────────┐ │ [URL Text Box] [▶️ POST Button] │ ├──────────────────────┬──────────────────────────────┤ │ JSON EDITOR │ RESPONSE │ │ { │ ✅ HTTP 200 │ │ "key": "value" │ { │ │ } │ "result": "..." │ │ │ } │ └──────────────────────┴──────────────────────────────┘ - Type your URL in the text box at the top
- Edit your JSON in the left pane
- Click POST or press Enter in the URL box
- See the response in the right pane with syntax highlighting
Use a free testing endpoint like httpbin.org:
{
"commandOutputHover.jsonPostUrl": "https://httpbin.org/post",
"commandOutputHover.jsonPostMethod": "POST",
"commandOutputHover.jsonPostHeaders": {
"Content-Type": "application/json"
}
}{
"commandOutputHover.jsonPostUrl": "https://api.yourservice.com/endpoint",
"commandOutputHover.jsonPostMethod": "POST",
"commandOutputHover.jsonPostHeaders": {
"Content-Type": "application/json",
"Authorization": "Bearer your-api-token"
}
}Ctrl+Shift+E(Windows/Linux) orCmd+Shift+E(Mac) - Execute command with selection
You can customize the keyboard shortcut in VS Code's Keyboard Shortcuts settings.
- VS Code 1.80.0 or higher
- Bash (on Unix-like systems) or PowerShell (on Windows)
- Command output is limited to prevent memory issues
- Hover data is cleared after 1 hour or when the document is closed
- Document edits may affect hover positioning
- The play button appears for all JSON files, even when no URL is configured (click it to configure)
Be cautious when executing commands with untrusted input. The extension sanitizes input to prevent command injection, but you should still be careful with the commands you configure.
Initial release with core functionality:
- Command execution with selected text or word under cursor
- Hover tooltip display with command details
- Configurable command templates
- Support for Bash and PowerShell
- JSON file posting to remote URLs
- Pretty-formatted JSON response viewer