Quick Command ToolbarA VS Code extension that adds custom command buttons to the status bar. Run shell commands in the terminal or built-in VS Code commands (the same ids used by the Command Palette and keyboard shortcuts) with one click—optionally as single or grouped steps—with Codicons, optional label color, and Global / Workspace / Local storage scopes. Features
InstallationFrom a
|
| Command | Description |
|---|---|
| QCT: Open Manager | Opens the manager list (scoped by Global / Workspace / Local tabs). |
| QCT: Add New Command | Opens the add form directly. |
| QCT: Edit Command | Reserved title; use Edit on a card in the manager. |
| QCT: Refresh Toolbar | Reloads status bar items from settings. |
Creating a command
- Run QCT: Open Manager or QCT: Add New Command (or Add Button in the manager header).
- Choose Single Command or Group Commands.
- Set Command Name and pick an Icon.
- For Single:
- Run as → Terminal (shell) — Enter a shell command (e.g.
npm run dev), optional terminal name, and optional Always create new terminal. - Run as → VS Code command (editor) — Enter the VS Code command id in the field (e.g.
editor.action.commentLine,editor.action.blockComment,editor.action.formatDocument). Keep the text editor focused when you click the status bar button so the command targets the right editor (same as using a keyboard shortcut bound to that command).
- Run as → Terminal (shell) — Enter a shell command (e.g.
- For Group: add one or more rows. Each row has Run as (terminal vs VS Code command), name, command line or command id, optional terminal (for terminal rows), and optional shortcut metadata. Toggle Execute all commands simultaneously if needed.
- Optional Color tints the status bar label; optional top-level Shortcut is stored as metadata (see Keyboard shortcuts).
- Save returns to the manager; the new id is derived from the command name unless you edit an existing entry.
VS Code command buttons (editor actions)
Use this when you want a status bar shortcut to the same actions normally triggered by keyboard shortcuts or the Command Palette:
| Goal | Example command id |
|---|---|
| Toggle line comment | editor.action.commentLine |
| Toggle block comment | editor.action.blockComment |
| Format document | editor.action.formatDocument |
To discover ids: File → Preferences → Keyboard Shortcuts, search for the action, right-click the binding → Copy Command Id (wording may vary by VS Code version), or check extension docs.
Delete in the manager asks for confirmation in a native modal (not the webview), then removes the button from the correct scope.
Finding command IDs
- Keyboard Shortcuts UI — search for the command and copy its id when available.
- Command Palette — some commands show their id in documentation; many built-in editor commands follow
editor.action.*.
Invalid ids show an error notification when the button is run.
Scopes (Global / Workspace / Local)
- Global — Stored in User settings (
qct.buttonsglobal value). - Workspace — Stored in the workspace settings file.
- Local — Stored for the first workspace folder (workspace folder settings).
The status bar shows all commands from the three buckets. The manager tabs filter the list so you only edit one bucket at a time.
Configuration
Settings key: qct.buttons — array of command objects.
| Property | Description |
|---|---|
id |
Unique string (required). |
label |
Status bar label (required). |
command |
For single mode: shell text when executionMode is terminal (default), or a VS Code command id when executionMode is vscode-command. May be empty for group mode. |
icon |
Codicon id (e.g. play, terminal). |
shortcut |
Optional text stored on the item (metadata). |
terminal |
Optional default terminal name (single / group fallback). |
cwd |
Optional working directory when creating a terminal. |
enabled |
If false, hidden from status bar. |
color |
Optional CSS color for status bar item text. |
commandType |
single or group. |
groupCommands |
Array of { name, command, terminal?, shortcut?, executionMode? } when commandType is group. Each row’s executionMode is terminal (default) or vscode-command. |
executeAllSimultaneously |
Boolean; group mode only. |
executionMode |
terminal (default) or vscode-command for single-mode buttons; group parent uses terminal in settings. |
alwaysCreateNewTerminal |
Boolean; single-command terminal path only. |
scope |
global, workspace, or local (logical tag; storage layer is chosen when saving). |
Other keys:
qct.defaultTerminal— Default terminal name when none is set on a command.qct.showInStatusBar— Reserved for future use (toolbar always uses status bar today).
Examples
Single command (terminal)
{
"id": "npm-dev",
"label": "Dev",
"command": "npm run dev",
"icon": "play",
"commandType": "single",
"executionMode": "terminal",
"scope": "workspace"
}
Single command (VS Code / editor)
Same kind of button as a keybinding: clicking runs the command in the active editor.
{
"id": "toggle-line-comment",
"label": "Line comment",
"command": "editor.action.commentLine",
"icon": "edit",
"commandType": "single",
"executionMode": "vscode-command",
"scope": "global"
}
Grouped commands
{
"id": "build-and-test",
"label": "Build & Test",
"command": "",
"icon": "tools",
"commandType": "group",
"executeAllSimultaneously": false,
"groupCommands": [
{ "name": "Build", "command": "npm run build", "executionMode": "terminal" },
{ "name": "Format", "command": "editor.action.formatDocument", "executionMode": "vscode-command" },
{ "name": "Test", "command": "npm test", "terminal": "Tests", "executionMode": "terminal" }
],
"scope": "workspace"
}
Keyboard shortcuts
The shortcut field in the UI is stored on the command object for display/reference. To bind keys in VS Code, use File → Preferences → Keyboard Shortcuts and assign keys to a command that runs your workflow, or use a generic task/run approach. (Dedicated qct.run.<id> commands are not generated in this version.)
Development / Packaging
npm install
npm run compile
npm run package
This runs TypeScript compile and produces quick-command-toolbar-<version>.vsix in the project root (version from package.json).
Publish to the Marketplace using vsce with your publisher token after vsce login.
File structure
quick-command-toolbar/
├── extension.ts # Main extension + webview HTML
├── package.json
├── tsconfig.json
├── resources/
│ ├── icon.png
│ ├── codicon.css
│ └── codicon.ttf
└── out/
└── extension.js # Compiled output
Troubleshooting
- Nothing in status bar — Run QCT: Refresh Toolbar or reload the window; ensure the command is enabled and you are in a scope that has entries.
- Save does nothing — Check the notification area for errors (duplicate
id, or settings write issues). Ensure a folder is open if you use Workspace or Local scope. - Icons — Use valid Codicon names (see Codicons).
- Wrong scope list — Remember: Global vs Workspace vs Local are separate lists; switch tabs in the manager to edit the right bucket.
- VS Code command does nothing — Focus the text editor (not the terminal or webview) before clicking the status bar button; many
editor.*commands only apply when an editor is active.
License
MIT — see LICENSE.md.