> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/mullvad/mullvadvpn-app/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Command-line interface for managing Mullvad VPN daemon

The Mullvad CLI (`mullvad`) is a command-line interface for managing the Mullvad VPN daemon. It provides complete control over VPN connections, relay selection, tunnel configuration, and account management.

## Binary Name

The CLI tool is named `mullvad` (or `mullvad.exe` on Windows).

## Basic Usage

```bash theme={null}
mullvad [COMMAND] [OPTIONS]
```

### Getting Help

Display general help information:

```bash theme={null}
mullvad --help
```

Get help for a specific command:

```bash theme={null}
mullvad [COMMAND] --help
```

For example:

```bash theme={null}
mullvad relay --help
mullvad tunnel set --help
```

### Version Information

Check the CLI version:

```bash theme={null}
mullvad --version
```

View detailed version information:

```bash theme={null}
mullvad version
```

## Quick Examples

### Connection Management

Connect to VPN:

```bash theme={null}
mullvad connect
```

Connect and wait until connected:

```bash theme={null}
mullvad connect --wait
```

Disconnect from VPN:

```bash theme={null}
mullvad disconnect
```

Check connection status:

```bash theme={null}
mullvad status
```

Get verbose status information:

```bash theme={null}
mullvad status --verbose
```

### Account Management

Log in to your account:

```bash theme={null}
mullvad account login [ACCOUNT_NUMBER]
```

View current account information:

```bash theme={null}
mullvad account get
```

Log out:

```bash theme={null}
mullvad account logout
```

### Relay Selection

List available relays:

```bash theme={null}
mullvad relay list
```

Set relay location by country:

```bash theme={null}
mullvad relay set location se
```

Set relay location by city:

```bash theme={null}
mullvad relay set location se got
```

View current relay constraints:

```bash theme={null}
mullvad relay get
```

## Available Command Categories

The Mullvad CLI provides the following command categories:

### Core Commands

* `connect` - Connect to a VPN relay
* `disconnect` - Disconnect from the VPN
* `reconnect` - Reconnect to any matching VPN relay
* `status` - Return the state of the VPN tunnel

### Account Management

* `account` - Control and display information about your Mullvad account
  * Create accounts
  * Login/logout
  * View account details and device information
  * Manage devices

### Relay Configuration

* `relay` - Manage relay and tunnel constraints
  * List available relays
  * Set location constraints (country, city, hostname)
  * Configure relay providers and ownership
  * Update relay list
  * Override relay options

### Tunnel Settings

* `tunnel` - Manage tunnel options
  * MTU configuration
  * Quantum-resistant key exchange
  * DAITA (Defense Against AI-Guided Traffic Analysis)
  * Allowed IPs
  * Key rotation interval

### Network Settings

* `dns` - Configure DNS servers to use when connected
* `lan` - Control the allow local network sharing setting
* `split-tunnel` - Configure split tunneling (platform-specific)

### Security & Privacy

* `lockdown-mode` - Control whether to block network access when disconnected from VPN
* `auto-connect` - Control the daemon auto-connect setting
* `anti-censorship` - Manage use of anti-censorship methods for WireGuard

### Advanced Configuration

* `api-access` - Manage Mullvad API access methods
  * Configure proxy and bridge servers
  * Manage SOCKS5 and Shadowsocks proxies
* `custom-list` - Manage custom relay lists
* `beta-program` - Receive notifications about beta updates

### Data Management

* `factory-reset` - Reset settings, caches, and logs
* `reset-settings` - Reset settings only, but remain logged in and keep logs and caches
* `import-settings` - Apply a JSON patch generated by 'export-settings'
* `export-settings` - Export a JSON patch based on the current settings
* `log` - Manage logs and tracing

### Debugging

* `debug` - Debug commands used for internal testing (hidden)

## Output Formats

Many commands support different output formats:

### Verbose Mode

Use the `-v` or `--verbose` flag for detailed output:

```bash theme={null}
mullvad status --verbose
mullvad account get --verbose
```

### JSON Output

Some commands support JSON output with the `-j` or `--json` flag:

```bash theme={null}
mullvad status --json
```

### Debug Output

For debugging purposes, use the `-d` or `--debug` flag:

```bash theme={null}
mullvad status --debug
```

## Interactive Features

### Wait Flags

Connection commands support `--wait` (or `-w`) to block until the operation completes:

```bash theme={null}
mullvad connect --wait
mullvad disconnect --wait
mullvad reconnect --wait
```

### Status Listening

Monitor tunnel state changes in real-time:

```bash theme={null}
mullvad status listen
```

### Confirmations

Destructive operations like factory reset require confirmation unless you use `-y` or `--assume-yes`:

```bash theme={null}
mullvad factory-reset --assume-yes
mullvad reset-settings -y
```

## Shell Integration

### Shell Completions

On Unix systems (Linux and macOS), you can generate shell completion scripts:

```bash theme={null}
mullvad shell-completions bash
mullvad shell-completions zsh
mullvad shell-completions fish
```

## Communication with Daemon

The CLI communicates with the `mullvad-daemon` system service using a management interface. The daemon must be running for the CLI to function. If you encounter connection errors, ensure the daemon is running:

* **Linux**: `systemctl status mullvad-daemon`
* **macOS**: Check if the daemon process is active
* **Windows**: Check if the Mullvad service is running in Services

## Exit Codes

The CLI returns standard exit codes:

* `0` - Success
* Non-zero - Error occurred

This makes the CLI suitable for use in scripts and automation.

## Next Steps

* [Installation Guide](/cli/installation) - Install and set up the CLI
* [Command Reference](/cli/commands) - Detailed documentation for each command
* [Examples](/cli/examples) - Common usage scenarios and scripts
