Commands Overview
The VS Code CLI provides several powerful commands for managing your development environment:Opening Files and Folders
The default command (no subcommand) opens files and folders in VS Code.Basic Usage
Editor Options
Compare two files with each other
Add folder(s) to the last active window
Open a file at the specified line and character position
Force opening a new window
Force reusing an existing window
Wait for the files to be closed before returning. Essential for Git editor integration.
Set the display language (locale)
Enable proposed API features for specified extensions
Extension Management
Manage VS Code extensions from the command line.ext list
List all installed extensions:Options
Display version numbers alongside extension IDs
Filter extensions by category (e.g., themes, formatters, linters)
ext install
Install one or more extensions:Options
Extension identifier(s) in format
${publisher}.${name} or path(s) to VSIX file(s). Use @${version} to install specific version.Install the pre-release version of the extension
Update to the latest version even if already installed
Don’t install extension packs and dependencies
ext uninstall
Uninstall one or more extensions:One or more extension identifiers to uninstall
ext update
Update all installed extensions to their latest versions:Status Command
Print process usage and diagnostics information:Version Management
Manage and switch between different VS Code versions.version use
Switch to a different VS Code version:Options
Version to use:
stable, insiders, specific version number (e.g., 1.85.0), or absolute path to existing installationDirectory where the version can be found
version show
Display the currently configured VS Code version:Web Server
Run a local web version of VS Code accessible via browser.Options
Host to listen on
Port to listen on. Use
0 for random free port.Path to a socket file for the server to listen on
A secret that must be included with all requests for authentication
Path to file containing the connection token
Run without a connection token (only if connection is secured by other means)
Only use this option if you have other security measures in place, as it removes authentication.
Specifies the path under which the web UI and code server are provided
Directory where server data is kept
Use a specific commit SHA for the client
Accept the server license terms without prompting
Troubleshooting Options
These options help diagnose and fix issues:Disable all installed extensions
Disable specific extension(s)
Disable GPU hardware acceleration
Run CPU profiler during startup for performance analysis
Allow debugging and profiling of extensions
Like
--inspect-extensions, but pauses extension host at startTurn settings sync on or off
Shows all telemetry events the editor collects
Configuration Options
Set the root path for extensions
Specify directory for user data. Useful for running multiple isolated instances.
Set the editor version for this command. Can be persisted with
code version use.Legacy Command Support
The CLI maintains backward compatibility with legacy flags:While legacy flags are supported for backward compatibility, using the modern command syntax (
code ext ...) is recommended for new scripts.Exit Codes
The CLI returns standard exit codes:0- Success1- General error or installation not found- Other non-zero values indicate specific errors
Next Steps
Remote Tunnels
Learn about the powerful tunnel command for remote development
CLI Overview
Return to CLI overview and introduction