> 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/devx/5.5/user-guide/cli/manage-kafka/consumers.md).

# Consumers

Commands for updating consumer groups offsets.

Flags `--group` and `--topic` are mandatory and specify the consumer group ID and topic name respectively.

To affect all topics use the **—all-topics** flag.

| Flag            | Description                                      |
| --------------- | ------------------------------------------------ |
| `-g, --group`   | Set the Consumer Group ID                        |
| `-t, --topic`   | Set the topic name                               |
| `--all-topics`  | Select implicitly all the topics                 |
| `--topics`      | The topic to reset offsets for                   |
| `--partition`   | Set the partition ID                             |
| `--to-earliest` | Reset partition offset to earliest offset        |
| `--to-latest`   | Reset partition offset to latest offset          |
| `--to-offset`   | Reset the partition offset to the provided value |

{% hint style="info" %}
update-single-partition accepts only one --topic flag while update-multiple-partitions may accept multiple.
{% endhint %}

## Update a single topic’s partition offset to the specified value

```bash
lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-offset <offset_id>
```

## Update to the earliest offset available <a href="#update-to-the-earliest-offset-available" id="update-to-the-earliest-offset-available"></a>

```bash
lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-earliest
```

## Update to the latest offset available <a href="#update-to-the-latest-offset-available" id="update-to-the-latest-offset-available"></a>

```bash
lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-latest
```

## Update given topics for all their partition offsets to the specified date time <a href="#update-given-topics-for-all-their-partition-offsets-to-the-specified-datetime" id="update-given-topics-for-all-their-partition-offsets-to-the-specified-datetime"></a>

```bash
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-datetime <datetime>
```

## Reset given topics for all their partition offsets to the earliest offset possible <a href="#reset-given-topics-for-all-their-partitions-offsets-to-the-earliest-offset-possible" id="reset-given-topics-for-all-their-partitions-offsets-to-the-earliest-offset-possible"></a>

```bash
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-earliest
```

## Reset given topics for all their partition offsets to the latest offset possible <a href="#reset-given-topics-for-all-their-partitions-offsets-to-the-latest-offset-possible" id="reset-given-topics-for-all-their-partitions-offsets-to-the-latest-offset-possible"></a>

```bash
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-latest
```

## Reset offsets for all topics of this consumer group <a href="#reset-offsets-for-all-topics-of-this-consumer-group" id="reset-offsets-for-all-topics-of-this-consumer-group"></a>

```bash
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --all-topics \
    --to-latest
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.lenses.io/latest/devx/5.5/user-guide/cli/manage-kafka/consumers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
