# MQ

URL: https://docs.hanzo.ai/docs/cli/mq

> The `hanzo mq` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/mq) · **CLI** · [MCP](https://docs.hanzo.ai/docs/mcp-tools/mq) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Queue and stream admin for your org: create them, watch them drain, ack what you pulled.

[API reference →](https://docs.hanzo.ai/docs/openapi/mq)

```bash
hanzo mq stream list
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command           | What it does                                                   |
| ----------------- | -------------------------------------------------------------- |
| `hanzo mq health` | Reports whether the message plane behind this surface answers. |
| `hanzo mq info`   | Returns the broker's identity and the org's stream count.      |

### Stream

| Command                                         | What it does                                                                                                                          |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `hanzo mq stream consumer create <stream>`      | Creates a durable pull consumer on a stream and returns it.                                                                           |
| `hanzo mq stream consumer get <stream> <name>`  | Returns one consumer's configuration and delivery state.                                                                              |
| `hanzo mq stream consumer list <stream>`        | Returns a stream's consumers, name-ordered, with delivery state.                                                                      |
| `hanzo mq stream consumer next <stream> <name>` | Pulls the consumer's next batch.                                                                                                      |
| `hanzo mq stream consumer rm <stream> <name>`   | Removes a consumer and its delivery state; unacknowledged messages stay in the stream.                                                |
| `hanzo mq stream create`                        | Creates a durable stream in the org's namespace and returns it.                                                                       |
| `hanzo mq stream get <name>`                    | Returns one stream's configuration and live state.                                                                                    |
| `hanzo mq stream list`                          | Returns the org's streams, name-ordered, with their live state.                                                                       |
| `hanzo mq stream message list <name>`           | Reads stored messages without a consumer: by sequence, by newest on a subject, or walking a subject forward from a sequence.          |
| `hanzo mq stream message rm <name> 1`           | Erases one message by sequence; the sequence gap remains.                                                                             |
| `hanzo mq stream purge <name>`                  | Removes messages from a stream, leaving its consumers in place.                                                                       |
| `hanzo mq stream rm <name>`                     | Removes a stream with all its messages and consumers.                                                                                 |
| `hanzo mq stream set <name>`                    | Reconfigures an existing stream; the path names the stream, and the immutable fields (storage, retention) must restate what they are. |
