# Features

Use the extension to explore environments, manage Kafka resources, run SQL, and monitor health without leaving VS Code.

Start with [Install](/latest/vs-code-extension/install.md), then follow [Quick Start](/latest/vs-code-extension/quick-start.md). For language model tooling and command references, see [Overview](/latest/vs-code-extension/overview.md).

### Environments

#### Explore environments

View and search all your Kafka environments with status indicators.

<figure><img src="/files/tbjs0fBzjA1gqB2fnlEO" alt="Environments"><figcaption></figcaption></figure>

* Each environment shows a green or red indicator so you can see at a glance whether the Lenses agent is connected
* Click any environment name to explore its topics, schemas, and connectors

#### Create environments

Create new Kafka environments with a guided workflow directly from VS Code.

<figure><img src="/files/BYh5qnHvhVsexAh6U692" alt="Environment Creation"><figcaption></figcaption></figure>

1. Click the "+" icon on Environments or use Command Palette → **Lenses: Create Environment**
2. YAML editor for environment profile with full schema validation
3. After creation, deploy the agent: if your Lenses HQ is **local** (e.g. localhost or private network), you can run or paste a Docker command, **copy the agent key** for later, or skip. If you are connected to a **remote/cloud** HQ, the extension does not offer local Docker (it would not connect); you get a short explanation and can **copy the agent key** to deploy where your HQ can reach the agent.
4. When using local Docker from the extension, connection polling runs until the agent connects (or you cancel)
5. Transition to provisioning configuration once connected

The guided workflow walks you through environment definition and agent handoff; remote setups rely on copying the agent key into your own deployment process.

### Topics

#### Create topics

Create new Kafka topics directly from VS Code with full schema validation and autocompletion.

<figure><img src="/files/qgry4kYTyjeLkwSV1L21" alt="Topic Creation"><figcaption></figcaption></figure>

To create a new topic, just click the "+" icon next to the Topics section in the tree, or open the Command Palette and choose **Lenses: Create Topic**. You'll be taken to a YAML editor with instant schema validation and smart autocompletion to help you fill in details like partitions, replication, and any other Kafka topic settings you need. Once you hit "Create," your new topic will show up in the list right away—even before the backend has fully finished its setup. For best results, give it a moment before working with the topic, as it may take a little time (sometimes a few minutes) for everything to be ready behind the scenes.

#### Insert messages

Insert messages directly into Kafka topics with full schema validation and autocompletion.

<figure><img src="/files/4E1zprShht4VQAzOzSYr" alt="Topic Insert Messages"><figcaption></figcaption></figure>

To quickly add test messages to any topic, just right-click it and choose **Insert Messages**. You’ll get an easy-to-use JSON editor that checks your input in real time against the topic's schema. The editor can even generate sample messages for you, based on the topic’s AVRO or JSON schema. You can provide a key, value, and optional headers, then hit the Play button to send your messages. As soon as they’re inserted, you’ll jump straight to a pre-filled SQL query so you can view your new data right away. If there are any issues, errors are shown inline and connected to VS Code’s Problems panel, making fixes simple.

#### Query topic data

Browse and query topics with the integrated SQL editor.

<figure><img src="/files/OFpVLwTZ0vf7EBqH0UWU" alt="Topics"><figcaption></figcaption></figure>

**Data Snapshot** — Click directly on any topic or right-click and select **Data Snapshot** to query historical data with SQL:

<figure><img src="/files/ApLnnxC3USzDv7kX00LR" alt="SQL Query"><figcaption></figcaption></figure>

```sql
SELECT *
FROM my-topic
WHERE _meta.offset >= LAST_OFFSET() - 10
LIMIT 10;
```

Press `Cmd+Enter` to run the query or click the Play icon in the top right corner. Results appear in the bottom panel below the editor.

**Live Data** — For real-time streaming, right-click on a topic and select **Live Data**. This opens a streaming SQL query panel, continuously showing new records as they arrive.

```sql
SELECT *
FROM my-topic
```

* You can stop the stream whenever you like and resume later
* Add SQL filters to narrow down what you see in real time
* Keep an eye on high-throughput topics, as they can increase memory and CPU usage

Results appear in an interactive data grid in the bottom panel, showing all message fields with sorting and filtering. You can control live data behavior with the `lenses.sql.liveData.maxRecords` and `lenses.sql.liveData.rateWarningEnabled` settings.

#### Edit topic configuration

Edit topic configurations directly in VS Code's native JSON editor.

<figure><img src="/files/2HpgcnxOmhWzitQGiN5f" alt="Topic Config"><figcaption></figcaption></figure>

* JSON schema validation highlights errors inline as you type
* Hover over any property to see its documentation
* When you apply changes, only the values you actually modified are sent to the API

#### Manage schemas

View and manage topic schemas with version history.

<figure><img src="/files/PiAfIkYBKd2zrJg9ei1b" alt="Topic Schema"><figcaption></figcaption></figure>

* View both key and value schemas for any topic
* Browse through previous versions using the version dropdown
* Compare any two schema versions side by side to see what changed
* Edit schemas directly and apply updates from VS Code

### Schema Registry

#### Schema Registry

Browse and manage Schema Registry subjects for each environment, right next to its Topics node in the tree.

<figure><img src="/files/cYSURPo8dtxHKFdc7RrM" alt="Schema Registry"><figcaption></figcaption></figure>

* Click the **Schema Registry** node under any environment to load every subject; the inline icons let you create a new subject (`+`), refresh the list, or open a full listing webview (`$(table)`).
* Click any subject to view its latest schema directly in VS Code's native JSON editor — no extra panels, full syntax highlighting, foldable AVRO/JSON/Protobuf payloads. Inline CodeLens actions appear above the document to edit, refresh, browse version history, compare versions or environments, and toggle favourites.
* Click the **+** icon (or run **Lenses: Create Schema Subject**) to open a JSON-Schema-validated template document. Fill in `subjectName`, `format` (AVRO / JSON / PROTOBUF), and the `schema` itself; the editor autocompletes valid options and highlights mistakes inline. Saving the document registers the subject through the Lenses API and immediately opens it for review.
* Browse version history for any subject and compare versions side by side using VS Code's native diff editor. Cross-environment comparison lets you spot schema drift between staging and production.
* Delete subjects or individual versions from the tree context menu with confirmation prompts.
* Schema Registry subjects are included in the global search index — press `Cmd+Shift+L` to find any subject instantly across environments.

### Access control

#### Manage IAM entities

Manage identity and access directly from VS Code.

<figure><img src="/files/XKidvP1hbb3oSYtHQlLT" alt="IAM Users"><figcaption></figcaption></figure>

* **Users** — Create, view, and delete user accounts for your Lenses instance
* **Groups** — Organize users into groups and assign roles to control what each group can access
* **Roles** — Define fine-grained permissions that specify exactly which actions are allowed on which resources
* **Service Accounts** — Manage credentials for API and programmatic access

All IAM entities open in a JSON editor with full schema validation, so you get instant feedback if something is misconfigured. Role names and permissions autocomplete as you type, and changes you make are reflected in real time across any open tabs.

### Comparison and monitoring

#### Compare configuration

Compare entities across environments using VS Code's native diff editor.

<figure><img src="/files/iZSGEE3bsMvZImILxti7" alt="Config Comparison"><figcaption></figcaption></figure>

You can compare topic configurations and schemas (both key and value) across different environments to spot differences between staging and production. For global entities like groups and roles, compare any two side by side regardless of environment.

Start a comparison from the Command Palette or by right-clicking an entity in the tree view.

#### Monitor health

Monitor Kafka infrastructure health in VS Code's Problems panel.

<figure><img src="/files/HIo8gwFhqfpufCxBhKib" alt="Health Monitoring"><figcaption></figcaption></figure>

* Warns you when consumer lag crosses your configured thresholds, so you can catch slow consumers early
* Alerts you when a connector fails or enters an unhealthy state
* Flags environment connectivity issues if an agent goes offline
* Optionally shows real-time toast notifications for critical issues so you don't miss anything while coding

### Productivity

#### Use bookmarks and saved queries

Keep your frequently accessed topics and queries at your fingertips.

<figure><img src="/files/I3qq0gg0poSP8FKjpC70" alt="Favourites"><figcaption></figcaption></figure>

**Topic Favourites** — Right-click any topic and choose **Add to Favourites** to pin it for quick access. Clicking a favourited topic opens a pre-configured SQL query right away, and you can remove favourites with a single click when you no longer need them.

**Saved Queries** — Save any SQL query you want to reuse by pressing `Cmd+Shift+P` → **Lenses: Save Query**, or click the star icon in the SQL editor. Your saved queries appear in the sidebar so you can open them in a new tab with one click, and rename or delete them from the context menu.

All favourites and saved queries sync with your Lenses.io web app, so your workflow carries over seamlessly between platforms.

#### Search globally

Find any entity instantly with fuzzy search (requires initial indexing; very large environments may take longer to index). You can adjust search behavior, result limits, and other indexing options in the extension's settings.

Press `Cmd+Shift+L` (`Ctrl+Shift+L` on Windows/Linux) to open the search panel, then start typing. Results span all your environments, topics, users, and other entities, ranked by relevance. Click any result to navigate directly to that entity in the tree or open its document.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/vs-code-extension/features.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
