Overview
The Ditto CLI allows developers to access the Ditto API 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
To install the CLI as a development dependency:Note: npx comes with
npm
5.2
or higherAuthentication
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.Using an env variable for your API key
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_API_KEY
.Updating your API key
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.