# topic offsets

Show partition offsets for a topic

Package: @cookiemonsterdev/kafka-cli 1.12.1
Canonical: https://cookiemonsterdev.github.io/kafka/docs/cli/reference/commands/topic/offsets/
Source revision: b112a684d2b3cdc7deadb3513041fcdbdc1c18b5

<!-- Generated by scripts/generate-cli-docs.mjs. Do not edit by hand. -->

```sh
kafka topic offsets <topic>
```

Show partition offsets for a topic

## Arguments

| Argument | Description |
| -------- | ----------- |
| `topic`  | topic name  |

Shared options and defaults: [connection profiles, JSON output, logging and help](https://cookiemonsterdev.github.io/kafka/docs/cli/reference/global-options/).

## Defaults

The selected offset query controls whether the result is a single offset or low/high offsets per partition.

## Flags

| Flag                 | Description                                                                             |
| -------------------- | --------------------------------------------------------------------------------------- |
| `--brokers <string>` | comma-separated broker list, e.g. localhost:9092                                        |
| `--time <string>`    | resolve offsets as of "earliest", "latest", "max-timestamp", or a millisecond timestamp |

## Examples

```sh
kafka topic offsets orders --brokers localhost:9092
kafka topic offsets orders --time earliest --brokers localhost:9092
kafka topic offsets orders --time 1735689600000 --brokers localhost:9092
```

## Output

Illustrative, abbreviated output. Empty arrays show the result envelope; actual entries, identifiers, optional fields and broker errors depend on the request and cluster.

With `--json`:

```json
{
  "partitions": [
    {
      "partition": 0,
      "offset": "42"
    }
  ]
}
```

Declared exit codes: `0`, `1`, `2`. See the exit-code reference for meanings.

## Related commands

[Browse the command group](https://cookiemonsterdev.github.io/kafka/docs/cli/reference/commands/#topic) · [Exit codes](https://cookiemonsterdev.github.io/kafka/docs/cli/reference/exit-codes/)
