> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vers.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Logout

# vers logout

Log out from the Vers platform by removing your stored API key.

## Usage

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
```

## Examples

### Successful logout

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
Successfully logged out from Vers
```

### Already logged out

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
You are not currently logged in
```

## How it works

The `logout` command:

1. **Checks for existing API key**: Verifies if you're currently logged in
2. **Removes stored credentials**: Clears the API key from local storage
3. **Confirms logout**: Shows success message or current login status

## What happens after logout

* Your stored API key is removed from the local machine
* You'll need to run `vers login` again to use authenticated commands
* No data, projects, or VMs are affected - only local authentication

## Use cases

### Switch accounts

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
vers login --token different-api-key
```

### Security cleanup

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# When finished working on a shared machine
vers logout
```

### Troubleshoot authentication

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# Clear potentially corrupted credentials
vers logout
vers login
```

## Error handling

### Permission issues

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
Error: error removing API key: permission denied
```

### Check operation issues

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
Error: error checking for API key: [specific error]
```

## Prerequisites

* No special requirements - works whether logged in or not

## Common Patterns

### Rotate credentials

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout && vers login
```

### Clean a shared machine

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
vers logout
rm -f ~/.versrc
```

## See Also

* [vers login](/cli-reference/login) - Authenticate with the platform
* [vers status](/cli-reference/status) - Check current authentication status
