Skip to content

CLI

A reference guide for all CLI options. Note that all sub commands can be ran with the --help option to display more information about the command.

Installation

You can install the CLI globally using your JavaScript package manager. Or use your package manager to run it directly.

To install globally you can use:

Terminal window
npm install -g @stringtale/cli

To run Stringtale directly:

Terminal window
npx @stringtale/cli

Basic usage command

You can use the Stringtale CLI as follows.

Terminal window
stringtale [command] [options]

Commands

login

Authenticates the Stringtale CLI with the dashboard. The CLI stores your unencrypted session token in ~/.config/stringtale/token.json.

init

Automatically integrates Stringtale into a new or existing project. It wil offer to select an existing project in Stringtale or create a new one. After selecting which framework you use it will take the required steps to integrate Stringtale within your project. For more information see our getting started guide.

pull

Pull in text edits from Stringtale to your local source code. You can use this if your code isn’t hosted by GitHub or you don’t want to use the GitHub action.

codemod (prior to v0.6.0 wrap)

Automatically wraps all plain text in your source code in <Value> tags so they can be edited once Stringtale is actived.

logout

Signs out Stringtale and deletes your local token from ~/.config/stringtale/token.json.

Options

Options can be used to modify the behaviour of the command. The list below is not exhausting, but rather a list of common options that are used with most commands.

-e option

The -e option can be used as a boolean in conjuction with any of the other commands. When used the .env file from the current working directory will be loaded and used to authenticate.

--help option

The -help option can be used as a boolean in conjuction with any of the other commands. Doing so will print additional information for options that can be used with that command.

Environment variables

STRINGTALE_API_KEY

The STRINGTALE_API_KEY is a project based API key. It can be used to pull in text edits from Stringtale to your local source code. You can use this with the CLI if your code isn’t hosted by GitHub or you don’t want to use the GitHub action.