# CLI

The Chakra UI CLI can be used to generate typings for your custom theme tokens,
like colors, semantic tokens, recipe variants, etc. You can also add community
snippets and premium Pro blocks to your project.

## Installation

In order to use the CLI, you need to install it as a dev dependency in your
project:

:::code-group

```bash [npm]
npm i -D @chakra-ui/cli
```

```bash [pnpm]
pnpm add -D @chakra-ui/cli
```

```bash [bun]
bun add -d @chakra-ui/cli
```

:::

:::warning

To use the CLI tool, please ensure that the version of Node.js is `>= 20.6.0`.

:::

## Usage

Use the Chakra CLI to run any of the commands listed below with your preferred
package manager.

```bash
Usage: npx chakra [options] [command]

The official CLI for Chakra UI projects

Options:
  -V, --version               output the version number
  -h, --help                  display help for command

Commands:
  typegen [options] <source>  Generate theme and recipe typings
  snippet                     Add snippets to your project for better DX
  blocks                      Add Chakra UI Pro blocks to your project
  eject [options]             Take control over the default theme tokens and recipes
  help [command]              display help for command
```

## `chakra typegen`

Generates theme and recipe typings for your custom theme. This helps to provide
autocompletion and type safety in your project.

```bash