# Chalk CLI Reference: Dev Tools
source: https://docs.chalk.ai/cli#dev-tools

Tools for local development and debugging, including [branch deployments](https://docs.chalk.ai/docs/branches) and topic simulation.

## `chalk topic push`
source: https://docs.chalk.ai/cli?command=topic_push

```bash
chalk topic push [flags]
```

Use the `topic push` command to push an message to one of your configured Kafka topics.

This command can be useful for testing streaming applications.

The `value` field accepts special template syntax to generate random values. The following template functions are available:

- `rand()`: Generate a random float between 0 and 1.
- `rand(max)`: Generate a random float between 0 and `max`.
- `rand(min, max)`: Generate a random float between `min` and `max`, inclusive.
- `randint()`: Generate a random integer between 0 and 1,000,000, inclusive.
- `randint(max)`: Generate a random integer between 0 and `max`, inclusive.
- `randint(min, max)`: Generate a random integer between `min` and `max`, inclusive.
- `randstr(length)`: Generate a random string of length `length`.
- `now()`: Generate the current datetime in ISO 8601 format.

For example, we might push a message of the form:

```
--value '{"ip": "121.32.randint(255).randint(255)"}'
```

which would generate messages like `{"ip": "121.32.43.232"}`.

**Flags**

- `--topic <topic>` (string)
  Name of the topic to push to.
- `--value <value>` (string)
  Value of the message to push to the topic.
- `--key <key>` (string)
  Key of the message to push to the topic.
- `--integration <integration>` (string)
  Name of the integration to use.
- `--format <format>` (string, default `json`)
  Format of the message. JSON or binary accepted.
- `--repeat <duration>` (string, default `-1ns`)
  Repeat sending the message. When `--repeat` is specified, the Chalk CLI will run your query every [`<duration>`](https://docs.chalk.ai/api-docs#Duration) period.

**Example**

```
$ chalk topic push --value '{"key": "value"}' --integration kafka --topic my-topic --key 1
✓ Asked Chalk to push message to topic
```

## `chalk diff`
source: https://docs.chalk.ai/cli?command=diff

```bash
chalk diff <source> <target>
```

Use the `chalk diff` command to compare two branches or deployments in your Chalk environment. If no source is provided, the most recent main deployment will be the source. If a branch is provided, the most recent deployment will be used. This command will compare the different deployments using the `diff` command-line tool.

**Arguments**

- `source` (string)
  The source branch or deployment ID to compare against. If not provided, the most recent main deployment will be used.
- `target` (string)
  The target branch or deployment ID to compare with the source. If branch provided, the most recent deployment will be used.

**Flags**

- `-u, --unified <unified>` (bool, default `false`)
  Show unified diff (-u flag for diff/git diff).

**Example**

```
$ chalk diff main new-branch
diff -r --color=always main/src/models.py new-branch/src/models.py
6a9,10
> new_feature: float
< old_feature: float
Only in new-branch/src: new_file.py
```

## `chalk source`
source: https://docs.chalk.ai/cli?command=source

```bash
chalk source <id>
```

Use the `chalk source` command to download the source code of a Chalk deployment. This command will fetch the source code from the Chalk server and extract it to a temporary directory.

**Arguments**

- `id` (string)
  The ID of the Chalk deployment to download the source code from. If not provided, the most recent main deployment will be used.

**Flags**

- `--directory <directory>` (string, default `.`)
  The directory to extract the source code to. If not provided, a temporary directory will be used.

**Example**

```
$ chalk source
```

## `chalk branch start`
source: https://docs.chalk.ai/cli?command=branch_start

```bash
chalk branch start [flags]
```

Use the `chalk branch start` command to start the branch server if it isn't already running. Both `chalk apply --branch` and `chalk query --branch` will automatically start the branch server if it isn't already running, so it isn't usually necessary to manually start the branch server.

**Example**

```
$ chalk branch start
✓ Branch server is ready
```

## `chalk branch delete`
source: https://docs.chalk.ai/cli?command=branch_delete

```bash
chalk branch delete <name> [flags]
```

Soft-delete a branch and archive its deployments in this environment. The branch is removed from branch lists and can no longer be queried. Its deployment history and source are no longer available. Recreating the name starts with fresh deployment history. Deleting a missing or already deleted branch succeeds.

**Example**

```
$ chalk branch delete my-branch
✓ Deleted branch "my-branch"
```

## `chalk graph`
source: https://docs.chalk.ai/cli?command=graph

```bash
chalk graph
```

Output feature and resolver metadata to a file

**Flags**

- `-o, --out <out>` (string)
  Filepath to output features.
- `--deployment <clnw7zjo1001f0xs64y5pb8ga>` (string)
  The id of the deployment.
- `--format <format>` (string)
  Output format for the graph.

**Example**

```
$ chalk graph --out fraud_features.bytes
```
