Skip to main content
The Visual Studio Code CLI is available for Windows, macOS, and Linux. This guide will help you install and configure the CLI on your system.

Installation Methods

The CLI is included with VS Code installations. After installing VS Code, the code command should be available in your terminal.

Verifying Installation

If the command is not found, you may need to add it to your PATH:
The installer should add VS Code to your PATH automatically. If not:
  1. Open VS Code
  2. Press Ctrl+Shift+P to open the Command Palette
  3. Type “shell command” and select Shell Command: Install ‘code’ command in PATH

Building from Source

For developers who want to build the CLI from source:
Building from source requires Rust toolchain and additional dependencies.

Prerequisites

1

Install Rust

Install Rust using rustup:
2

Clone the repository

3

Navigate to CLI directory

4

Install platform-specific dependencies

Install OpenSSL:
5

Build the CLI

The compiled binary will be in target/release/code.
On Windows, OpenSSL is required for key exchange in tunnel forwarding. The CLI uses OpenSSL for cryptographic operations until all Chromium-based clients support ED25519 key exchange natively.Steps to install:
  1. Follow vcpkg setup instructions
  2. Add vcpkg directory to your PATH
  3. Run vcpkg install openssl:x64-windows-static-md
  4. Restart your terminal
  5. Run cargo build

Post-Installation Setup

Setting Default Data Directory

The CLI stores its data in a default directory. You can customize this:

Configuring Logging

Set up logging for debugging:

Verifying Installation

Run these commands to verify your installation:
Expected output:

Updating the CLI

Integrated CLI

When installed with VS Code, the CLI updates automatically when you update VS Code.

Standalone CLI

For standalone installations, use the update command:
The update command is only available in standalone CLI installations.

Troubleshooting

Solution:
  1. Verify VS Code is installed: Check if VS Code exists in your Applications/Program Files
  2. Add to PATH manually (see installation methods above)
  3. Restart your terminal after adding to PATH
  4. On macOS/Linux, make sure your shell profile is sourced: source ~/.bashrc or source ~/.zshrc
Solution:
  1. Ensure vcpkg is properly installed
  2. Verify OpenSSL package: vcpkg list | grep openssl
  3. Install the correct variant: vcpkg install openssl:x64-windows-static-md
  4. Restart your terminal and try building again
Solution:
  1. Make the binary executable: chmod +x /path/to/code
  2. Check directory permissions
  3. Don’t run with sudo unless necessary
Solution:
  1. Ensure you’re using the correct binary (check with which code)
  2. Update VS Code to the latest version
  3. Reinstall the shell command from VS Code’s Command Palette

Uninstallation

The CLI is removed when you uninstall VS Code. You may also need to:
  1. Remove the PATH entry from your shell profile
  2. Delete CLI data directory: ~/.vscode-oss/cli or ~/.vscode/cli

Next Steps

Commands Reference

Explore all available CLI commands

Remote Tunnels

Set up remote access with tunnels

Configuration

Configure the CLI for your needs

CLI Overview

Learn more about CLI features