> ## Documentation Index
> Fetch the complete documentation index at: https://developer.dittowords.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Installation and authentication of the Ditto CLI

## Overview

The Ditto CLI allows developers to access the [Ditto API](/api-reference) directly from the command line. The Ditto CLI updates text directly in local development. Teams can also build workflows with the CLI, including utilizing it in CI/CD.

## Installation

<Info>
  **Node.js 20 or higher** is required as of version `5.6.0`, which includes
  packages that depend on Node 20+.
</Info>

To install the CLI as a development dependency:

<CodeGroup>
  ```bash npm theme={null}
  npm i --save-dev @dittowords/cli
  ```

  ```bash yarn theme={null}
  yarn add --dev @dittowords/cli
  ```
</CodeGroup>

After installation, you can get a list of the available commands by running the help command.

<Info>
  **Note:** [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with `npm` 5.2
  or higher
</Info>

```bash theme={null}
npx @dittowords/cli --help
```

## Authentication

The first time you run the CLI, you'll be asked to provide an API key. You can generate an API key in your [developer integrations settings](https://app.dittowords.com/developers/api-keys).

<AccordionGroup>
  <Accordion title="Using an env variable for your API key">
    By default, your API key is saved to `$HOME/.config/ditto`; the default path can be overwritten by specifying a custom one via the environment variable `DITTO_CONFIG_FILE`.

    The Ditto API key is read from the file at the path stored at `DITTO_CONFIG_FILE` unless it’s explicitly provided by the env var `DITTO_TOKEN`.
  </Accordion>

  <Accordion title="Updating your API key">
    We don’t recommend editing the authentication file by hand; if you need to remove a saved API key or swap one key with another, it’s better to fully delete the file and then re-run the CLI.

    To change your API key, delete the `$HOME/.config/ditto` file and you’ll be prompted for a new key the next time that the CLI executes.
  </Accordion>
</AccordionGroup>
