Install the VS Code `code` command (PATH) on Windows, macOS, and Linux
Why extension install scripts need `code` in your terminal, how to register it from VS Code, and what to do when the command is not found.
Dev Setup generates a script that installs VS Code extensions in bulk. Those scripts call the `code` CLI, which only works after Visual Studio Code registers a shell command on your system. If you skip this step, the script may finish with errors like “code is not recognized.” This guide walks through the fix on each operating system.
What the `code` command does
The `code` executable is a small launcher shipped with VS Code. From a terminal you can open folders (`code .`), install extensions (`code --install-extension publisher.name`), and automate setup. Dev Setup’s PowerShell and Bash scripts rely on the install-extension form so you do not have to click through the Marketplace one extension at a time.
Register PATH from inside VS Code (all platforms)
- Open Visual Studio Code normally (not only the browser wizard).
- Open the Command Palette: Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS.
- Type “Shell Command” and choose “Shell Command: Install 'code' command in PATH” (wording may vary slightly by version).
- Restart the terminal panel in VS Code (Terminal → New Terminal) and run `code --version` to confirm.
A browser-based tool cannot change your computer’s PATH for security reasons. You must perform this step locally. After it works once, Dev Setup scripts usually run without changes.
Windows-specific notes
- If you installed VS Code per-user, the PATH entry is typically added under your profile.
- Corporate PCs sometimes block PATH changes—ask IT if the palette command fails silently.
- Use PowerShell or the VS Code integrated terminal when running the generated install script, not Command Prompt, unless you know `code` works there too.
macOS and Linux notes
- On macOS, if `code` still fails after the palette step, open a new Terminal.app window (old shells cache PATH).
- On Linux, some distributions package VS Code as `code` or `codium`; use the binary name your install provides.
- WSL users: run the install script inside the WSL terminal where you develop, and install the Remote - WSL extension when working across Windows and Linux filesystems.
After PATH works
Return to Dev Setup, complete the wizard, copy the script for your OS, paste it into the VS Code terminal, and press Enter. Extension installs may take a few minutes on first run. When finished, reload VS Code if prompted.