Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Command DrawerNew to Visual Studio Code? Get it now.
Command Drawer

Command Drawer

Caerulea

|
3 installs
| (0) | Free
| Sponsor
Store and insert reusable terminal commands from command libraries.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Command Drawer

Command Drawer is a Visual Studio Code extension for keeping reusable terminal commands in portable .cmddrawer files. Import a command library once, then insert a shell-aware command into the active terminal or copy it from the Command Drawer sidebar.

Features

  • Imports JSON-based .cmddrawer command libraries.
  • Creates, edits, and removes drawers and commands directly from the sidebar.
  • Keeps imported and locally created drawers in VS Code's global extension storage, making them available in every workspace and VS Code window for the current profile.
  • Exports individual .cmddrawer files or every drawer in a ZIP archive.
  • Displays commands, descriptions, and tags in an Activity Bar view.
  • Resolves command variants for PowerShell, Git Bash, Bash, and Zsh.
  • Inserts text without executing it, so it can be reviewed before pressing Enter.
  • Opens a compatible terminal when a selected shell-specific variant cannot run in the active terminal.
  • Provides split-button menus for explicitly inserting or copying any available shell variant.

Usage

  1. Open Command Drawer from the VS Code Activity Bar.
  2. Select Import Drawer and choose a .cmddrawer file.
  3. Use the drawer's + menu to add, edit, or remove commands.
  4. Use the copy or right-arrow icon inside a command to copy or insert it.
  5. Open the small arrow beside either action to choose a specific shell variant.

Use a drawer's … menu to edit, remove, or export that drawer. The view title contains actions for creating and importing drawers, collapsing all sections, refreshing storage, and exporting every drawer as a ZIP archive.

The same import and refresh actions are available from the Command Palette as Command Drawer: Import Drawer and Command Drawer: Refresh Drawers.

Importing creates a managed copy of the source file. Editing the original file afterward does not update that copy; import it again to add the revised version. Refresh reloads the managed copies from extension storage.

Drawer file format

A drawer is a UTF-8 JSON file with the .cmddrawer extension:

{
  "schemaVersion": "1.0.0",
  "metadata": {
    "name": "sample-commands",
    "version": "0.0.1",
    "author": "Gabriel",
    "shortDescription": "A sample command drawer",
    "description": "Reusable commands for this project."
  },
  "commands": [
    {
      "id": "run-script",
      "name": "Run script",
      "shortDescription": "Runs the project script.",
      "description": "An optional longer explanation.",
      "tags": ["project", "python"],
      "command": {
        "powershell": "python .\\scripts\\run.py",
        "gitbash": "python ./scripts/run.py",
        "bash": "python ./scripts/run.py",
        "zsh": "python ./scripts/run.py",
        "default": "python scripts/run.py"
      }
    }
  ]
}

The extension includes a Python Starter drawer demonstrating shell-specific Python virtual-environment commands and a universal command.

Fields

Field Required Description
schemaVersion Yes Non-empty format version string. The current example format is 1.0.0.
metadata.name Yes Drawer name shown in the sidebar.
metadata.version Yes Drawer version string for its author and consumers.
metadata.author No Optional drawer author.
metadata.shortDescription Yes Brief summary shown in the sidebar.
metadata.description No Optional longer drawer description.
commands Yes Array of command definitions; it may be empty.
commands[].id Yes for imported files Unique command identifier. The extension generates and manages it automatically for commands created in the UI.
commands[].name Yes Command card title.
commands[].shortDescription No Optional brief summary displayed on the card.
commands[].description No Longer text displayed below the summary.
commands[].tags Yes Array of non-empty strings. Use [] when there are no tags.
commands[].command Yes A non-empty string or a shell-variant object containing one or more commands.

Supported variant keys are default, powershell, gitbash, bash, and zsh. Keys are lowercase and unrecognized keys cause the import to fail. A plain string is equivalent to a shell-independent default command:

{
  "id": "show-version",
  "name": "Show version",
  "shortDescription": "Prints the tool version.",
  "tags": [],
  "command": "my-tool --version"
}

JSON backslashes must be escaped. For example, a PowerShell path such as .\venv\Scripts\Activate.ps1 is written as ".\\venv\\Scripts\\Activate.ps1" in the file.

Shell resolution

For the main Insert and Copy actions, Command Drawer resolves a variant in this order:

  1. Use the active terminal's exact shell variant. Git Bash can also use a bash variant.
  2. Use default when it exists.
  3. Choose the first available shell variant in this order: powershell, gitbash, bash, zsh.

If step 3 selects a shell-specific command that is incompatible with the active terminal, Insert creates a terminal for that shell. Choosing a variant explicitly from a split-button menu follows the same compatibility rule. Copy never creates a terminal.

Shell detection is best effort and is based on the active terminal's configured shell path. A default or plain-string command can be inserted into any active terminal; if there is no compatible active terminal, VS Code creates one.

Storage and safety

Imported files and drawers created in the UI are stored for the current VS Code profile and remain available across workspaces and extension updates. Changes made through the sidebar are saved immediately. Importing the same source more than once currently creates multiple entries.

Treat shared drawer files as executable content: inspect commands before inserting or running them. Command Drawer inserts terminal text with execution disabled, but VS Code and your shell still have access to your local environment.

Current limitations

  • Refresh reads the managed storage copy; it does not synchronize the original import path.
  • Shell detection depends on terminal creation options and may not identify every profile or wrapper shell.
  • Git Bash discovery on Windows checks common Git installation paths and otherwise falls back to bash.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft