# Commands and Keyboard Shortcuts

### Commands

Access all commands via the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`).

| Command                                | Description                               |
| -------------------------------------- | ----------------------------------------- |
| `Lenses: Connect to Instance`          | Connect to your Lenses.io API             |
| `Lenses: Sign in with OAuth (browser)` | Connect via OAuth 2.0 browser flow        |
| `Lenses: Search`                       | Open global fuzzy search                  |
| `Lenses: Switch Environment`           | Quick switch between environments         |
| `Lenses: Create Environment`           | Create a new environment                  |
| `Lenses: Create Topic`                 | Create a new Kafka topic                  |
| `Lenses: Save Query`                   | Save the current SQL query                |
| `Lenses: Compare Topic Configuration`  | Compare topic configs across environments |
| `Lenses: Compare Topic Schema`         | Compare topic schemas across environments |
| `Lenses: Compare Groups`               | Compare groups side by side               |
| `Lenses: Compare Roles`                | Compare roles side by side                |
| `Lenses: Refresh Health Status`        | Refresh health monitoring data            |
| `Lenses: Open SQL Query`               | Open a new SQL query editor               |
| `Lenses: Run SQL Query`                | Execute the current SQL query             |
| `Lenses: Sign Out`                     | Disconnect from the Lenses instance       |

***

### Keyboard Shortcuts

| Shortcut      | Action                        |
| ------------- | ----------------------------- |
| `Cmd+Shift+L` | Global Search                 |
| `Cmd+Shift+E` | Switch Environment            |
| `Cmd+Shift+Q` | Open SQL Query                |
| `Cmd+Enter`   | Run SQL Query (in SQL editor) |

***

### Settings

Configure the extension via VS Code Settings (`Cmd+,`).

#### General

| Setting                | Default | Description                                                |
| ---------------------- | ------- | ---------------------------------------------------------- |
| `lenses.apiUrl`        | `""`    | Base URL for your Lenses.io API                            |
| `lenses.oauthClientId` | `""`    | OAuth client ID (when dynamic registration is unavailable) |

#### Health Monitoring

| Setting                                       | Default  | Description                                    |
| --------------------------------------------- | -------- | ---------------------------------------------- |
| `lenses.health.pollingInterval`               | `30000`  | Health check interval (ms)                     |
| `lenses.health.consumerLagWarningThreshold`   | `10000`  | Consumer lag warning threshold                 |
| `lenses.health.consumerLagErrorThreshold`     | `100000` | Consumer lag error threshold                   |
| `lenses.health.notifications.enabled`         | `false`  | Enable toast notifications for critical issues |
| `lenses.health.notifications.errorOnly`       | `false`  | Only show error notifications                  |
| `lenses.health.notifications.cooldownMs`      | `300000` | Notification cooldown (5 min)                  |
| `lenses.health.notifications.showInStatusBar` | `true`   | Show unread notification count in status bar   |

#### Health Checks

| Setting                                  | Default | Description                |
| ---------------------------------------- | ------- | -------------------------- |
| `lenses.health.checks.consumerLag`       | `true`  | Monitor consumer lag       |
| `lenses.health.checks.connectorStatus`   | `true`  | Monitor connector status   |
| `lenses.health.checks.environmentStatus` | `true`  | Monitor environment health |

#### SQL Queries

| Setting                                  | Default | Description                                            |
| ---------------------------------------- | ------- | ------------------------------------------------------ |
| `lenses.sql.liveData.maxRecords`         | `5000`  | Maximum records for live data streaming (0 = no limit) |
| `lenses.sql.liveData.rateWarningEnabled` | `true`  | Show warning when message rate is high                 |
| `lenses.sql.acceptSelfSignedCerts`       | `false` | Trust self-signed TLS certificates for SQL connections |

#### Search Index

| Setting                                  | Default   | Description                                 |
| ---------------------------------------- | --------- | ------------------------------------------- |
| `lenses.search.index.enabledEntityTypes` | all types | Entity types to include in search index     |
| `lenses.search.index.autoIndexOnStartup` | `false`   | Automatically start indexing when connected |
| `lenses.search.cache.enabled`            | `true`    | Persist search index between sessions       |
| `lenses.search.cache.ttlHours`           | `24`      | Search index cache duration (hours)         |

#### Other

| Setting                        | Default | Description                                                 |
| ------------------------------ | ------- | ----------------------------------------------------------- |
| `lenses.yaml.schemaValidation` | `true`  | YAML schema validation for provisioning files               |
| `lenses.telemetry.enabled`     | `true`  | Anonymous usage telemetry (respects VS Code global setting) |
