> For the complete documentation index, see [llms.txt](https://docs.lenses.io/latest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lenses.io/latest/k2k/1.2/k2k-standalone-tool.md).

# K2K Standalone Tool

Describes the high level usage of the K2K Standalone Tool

The K2K Tool (`k2k-tool`) is an administration tool for managing K2K committed offsets.\
It provides a CLI and a web interface for managing K2K committed offsets.

The K2K is bundled in the same container as K2K, so it is available in any K2K deployment.

{% hint style="danger" %}
Warning: Setting offsets should only be used when the K2K application has been stopped.&#x20;

If the K2K application is running, the offset reset might not be applied as the application will continue to commit offsets, potentially overwriting the reset operation.
{% endhint %}

#### Pipeline Definition Files

The YAML definition used by `k2k-tool` is a **subset** of the full K2K YAML configuration format.&#x20;

This means the same configuration file used for running K2K can be used with `k2k-tool`. \
The tool will only read the fields it needs and ignore the rest.&#x20;

You can mount the same file used by K2K and expect it to work without modification.

The following configuration objects are required in the YAML configuration for `k2k-tool` to function:

* `name`
* `source.kafka`
* `target.kafka`
* `replication`&#x20;

### K2K CLI Commands

<table><thead><tr><th width="158.1666259765625">command</th><th>description</th></tr></thead><tbody><tr><td><code>server</code></td><td>Start the K2K-Tool web app. Starts an HTTP server that provides a web interface and API endpoints for managing K2K pipelines. </td></tr><tr><td><code>describe</code></td><td>Describes the current state of the consumer group(s) present in the K2K pipeline definition file(s).</td></tr><tr><td><code>set</code></td><td>Sets the committed offset(s) for a consumer group to a specific value. </td></tr><tr><td><code>reset</code></td><td>Sets all committed offsets for a consumer group to the earliest value.</td></tr></tbody></table>

#### **Examples:**

```bash
# Start server with a single pipeline file
k2k-tool server -f /path/to/pipeline.k2k.yml

# Start server watching a directory
k2k-tool server -d /pipelines

# Start server with a pipeline defined over multiple files and custom port
k2k-tool server -f /path/to/pipeline1.k2k.yml,/path/to/pipeline2.k2k.yml -p 9090

# Describe consumer groups from a single pipeline file
k2k-tool describe -f /path/to/pipeline.k2k.yml

# Set offset for a specific topic, partition, and offset
k2k-tool set -f /path/to/pipeline.k2k.yml -o "my-topic:0:100"

# Set offset for all partitions of a topic
k2k-tool set -f /path/to/pipeline.k2k.yml -o "my-topic:*:100"

# Reset offsets to earliest for a pipeline
k2k-tool reset -f /path/to/pipeline.k2k.yml
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lenses.io/latest/k2k/1.2/k2k-standalone-tool.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
