Run code blocks from Markdown files directly in the terminal with a single click
Run | Type | 50+ Languages | Multi-line Support | CodeLens & Preview
Install from VS Code Marketplace · Report Bug · Request Feature
When reading documentation or tutorials in Markdown files, you often need to copy commands and paste them into the terminal. This extension eliminates that friction by adding Run and Type buttons directly to your code blocks.
| Button | Action | Use Case |
|---|---|---|
| ▶ Run | Execute immediately | Quick command execution |
| ⌨ Type | Insert without executing | Review before running |
| View | How It Works |
|---|---|
| Editor | CodeLens buttons appear above each code block |
| Markdown Preview | Interactive buttons overlay on code blocks |
Execute multiple commands sequentially with automatic && chaining:
# Install dependencies
cd frontend && npm install && cd ..
# Download Go dependencies
go mod downloadComments and empty lines are automatically filtered.
- Current command being executed
- Progress indicator (e.g., 2/3)
- Smooth completion animation
| Category | Languages |
|---|---|
| Shell | bash sh zsh powershell cmd fish |
| Scripting | python javascript typescript ruby perl php lua |
| Compiled | go rust java kotlin swift c cpp csharp |
| DevOps | docker kubectl npm yarn git make curl |
| Database | sql mysql postgresql sqlite |
- Open VS Code
- Press
Cmd+Shift+X(macOS) orCtrl+Shift+X(Windows/Linux) - Search for "Markdown Run Terminal"
- Click Install
- Download the latest
.vsixfile from Releases - Install via command line:
code --install-extension md-run-terminal-x.x.x.vsixOr install in VS Code: Extensions → ... → Install from VSIX...
- Open any
.mdfile in VS Code - Look for Run and Type buttons on code blocks
- Click to execute!
```bash
echo "Hello, World!"
npm install
npm start
```All commands in a code block are joined with && and executed sequentially:
# This will run as: git clone ... && cd repo && npm install
git clone https://github.com/user/repo.git
cd repo
npm installOpen VS Code Settings (Cmd+, or Ctrl+,) and search for "Markdown Run Terminal":
| Setting | Default | Description |
|---|---|---|
md-run-terminal.reuseTerminal |
true |
Reuse existing terminal |
md-run-terminal.supportedLanguages |
[50+ languages] | Languages that show buttons |
| Language Type | Execution Method |
|---|---|
Shell (bash, sh, etc.) |
Direct execution with && joining |
Interpreted (python, js, etc.) |
Wrapped with interpreter |
Compiled (go, rust, etc.) |
Helpful compile suggestion |
Examples:
- Python:
python3 -c "print('hello')" - JavaScript:
node -e "console.log('hello')" - Go: Suggests
go run main.go
- VS Code 1.85.0 or higher
- Language runtimes for execution (Node.js, Python, Go, etc.)
- SQL blocks copy to clipboard (requires database client)
- Compiled languages need manual file save
Contributions welcome! Please submit a Pull Request.
- Fork the repository
- Create feature branch (
git checkout -b feature/Amazing) - Commit changes (
git commit -m 'Add Amazing') - Push (
git push origin feature/Amazing) - Open Pull Request
MIT License © 2026 LYH