Skip to main content
The VS Code CLI can be customized through command-line options, environment variables, and persistent configuration. This guide covers all available configuration options to optimize your CLI experience.

Configuration Overview

The CLI can be configured at multiple levels:
  1. Command-line options - Override settings per command
  2. Environment variables - Set persistent defaults
  3. Configuration files - Store preferences and credentials
  4. System integration - Shell aliases and path configuration

CLI Data Directory

The CLI stores its configuration, logs, and cache in a data directory.

Default Locations

For official VS Code builds:

Custom Data Directory

Override the default location:

Data Directory Structure

Environment Variables

The CLI respects several environment variables for configuration.

Core Configuration

string
Override the CLI data directory location.
string
Disable interactive prompts (useful for scripts).
string
Disable colored terminal output.

Authentication

string
Provide an access token for tunnel authentication.
string
Provide a refresh token for tunnel authentication.

Tunnel Configuration

string
Require a specific token for command shell connections.
string
Custom user agent string for tunnel service requests.

Logging Configuration

Log Levels

Control the verbosity of CLI output:

Log to File

Persist logs to a file for later analysis:
Ensure the user has write permissions to the log file location.

Viewing Logs

Editor Configuration

Multiple VS Code Instances

Run separate VS Code instances with different configurations:
Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
Usage:

Version Management

Configure which version of VS Code to use:

Show Current Version

Output:

Tunnel Configuration

Persistent Tunnel Settings

Configure tunnels to start with specific settings:

Tunnel Service Configuration

When installing as a service, the configuration is saved:

Authentication Configuration

Authentication tokens are stored securely in your system’s credential manager:
  • Secret Service (GNOME Keyring, KDE Wallet)
  • keyutils (kernel keyring)
Credentials are encrypted and tied to your user session.

Server Configuration

Server Data Directory

Customize where tunnel server data is stored:
This directory contains:
  • Server installations
  • Extension storage
  • Server logs
  • User data
  • Workspace storage

Extensions Directory

Use a custom location for server extensions:
Useful for:
  • Shared extension storage
  • Network-mounted extensions
  • Separate extension sets per project

Pre-installed Extensions

Automatically install extensions when starting a tunnel:

Connection Settings

number
default:"10800"
Time in seconds to wait for client reconnection before shutting down the server.

Web Server Configuration

Configure the local web server (serve-web command).

Network Settings

Security Configuration

Only use --without-connection-token on trusted networks or with additional security measures in place.

Server Paths

Shell Integration

Command Aliases

Create shortcuts for common operations:

Git Integration

Configure VS Code as your Git editor:

Shell Functions

Create more complex CLI operations:

Advanced Configuration

Automation Scripts

Create scripts for complex workflows:

Docker Integration

Run VS Code tunnel in a Docker container:

Troubleshooting Configuration

Best Practices

Security

  • Never commit access tokens to version control
  • Use environment variables for sensitive data
  • Rotate credentials regularly
  • Use connection tokens for web servers
  • Keep CLI updated for security patches

Organization

  • Use separate data directories for different projects
  • Create shell aliases for common operations
  • Document your configuration in version control
  • Keep extension lists backed up
  • Use descriptive tunnel names

Performance

  • Use appropriate log levels
  • Set reasonable reconnection times
  • Pre-install frequently used extensions
  • Prune unused tunnel servers regularly
  • Monitor resource usage

Maintenance

  • Regularly update the CLI
  • Clean up old log files
  • Review and update configurations
  • Test backup/restore procedures
  • Document custom scripts

Configuration Examples

Complete Tunnel Setup

Development Environment

Next Steps

Commands Reference

Explore all CLI commands

Remote Tunnels

Set up remote access

Installation

Install the CLI

Overview

Back to CLI overview