# warpstream cli

## warpstream cli

The `warpstream cli` subcommand can be used to interact with a WarpStream cluster. It provides similar capabilities as the Apache Kafka command line tools for administering a Kafka cluster.

The following table displays the available `warpstream cli` arguments. Be sure to start with the subcommand needed from the `-type` list below

| Argument                 | Description                                                                                                                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -bootstrap-host          | <p>Kafka bootstrap host<br>Default: localhost</p>                                                                                                                                                       |
| -bootstrap-port          | <p>Kafka bootstrap port<br>Default: 9092</p>                                                                                                                                                            |
| -client-id               | <p>Client ID to pass along to WarpStream<br>Default: kcmd</p>                                                                                                                                           |
| -config-name             | <p>name of configuration to update<br></p>                                                                                                                                                              |
| -config-value            | new configuration value to set for configuration specified by -config-name flag                                                                                                                         |
| -diagnose-retry-attempts | <p>number of retry attempts for diagnose-connection<br>Default: 2</p>                                                                                                                                   |
| -group                   | Group to perform an operation on                                                                                                                                                                        |
| -key                     | Key to use for the produced kafka records                                                                                                                                                               |
| -offset                  | Offset to consume from (used in conjunction with the `-fetch` subcommand) (optional)                                                                                                                    |
| -partition               | Partition to consume from (used in conjunction with the `-fetch` subcommand) (optional)                                                                                                                 |
| -partition-count         | Number of partitions to create (used in conjunction with the `-topic -create` subcommands) (optional)                                                                                                   |
| -password                | Password for SASL PLAIN authentication                                                                                                                                                                  |
| -records                 | Double comma (,,) separated strings to produce as records (used in conjunction with the `-produce` subcommand)                                                                                          |
| -scram                   | uses scram authentication instead of the default SASL PLAIN                                                                                                                                             |
| -timestamp list-offsets  | Timestamp to use for the list-offsets request type                                                                                                                                                      |
| -tls                     | Dial with TLS or not                                                                                                                                                                                    |
| -tlsClientCertFile       | path to X.509 certificate file in PEM format for the client                                                                                                                                             |
| -tlsClientPrivateKeyFile | path to the X.509 private key file in PEM format for the client                                                                                                                                         |
| -tlsServerCACertFile     | path to the X.509 certificate file in PEM format for the server certificate authority. Default will use the host's root certificate pool                                                                |
| -topic                   | Topic name                                                                                                                                                                                              |
| -topic-cleanup-policy    | <p>Kafka topic cleanup policy, one of: \[delete, compact]<br>Default: delete</p>                                                                                                                        |
| -type                    | Can be one of: produce, fetch, diagnose-connection, create-topic, list-topics, delete-topic, fetch-offsets, describe-groups, broker-metadata, commit-offsets, list-groups, describe-group, list-offsets |
| -username                | Username for SASL PLAIN authentication                                                                                                                                                                  |

### Examples

**Diagnose Connection**

```
warpstream cli diagnose-connection -bootstrap-host <bootstrap URL>
```

**Create a topic**

```
warpstream cli create-topic -topic <topic name>
```

**Adjust topic configuration**

```
warpstream cli alter-topic-config -topic <topic name> -config-name retention.ms -config-value 259200000
```

**Consume from a topic**

```
warpstream cli console-consumer -bootstrap-host <warpstream service> -topic <topic name>
```
