Skip to main content
This tool is for Phrase Strings only.
The Phrase Strings CLI is a self-contained binary for macOS, Linux, and Windows. It provides command-line access to the full Phrase Strings API and makes it easy to sync locale files between your project and Phrase.

Installation

For a direct binary, download the archive for your platform from the phrase-cli releases page:

Authentication

For details on token types and how to generate them, see Authentication. The CLI looks for the token in this order:
  1. --access_token flag
  2. PHRASE_ACCESS_TOKEN environment variable (recommended)
  3. phrase.access_token in .phrase.yml (discouraged)
Avoid putting the token in .phrase.yml, especially if the file is committed to a repository:
You can also pass it directly as a flag:

Quick start

1. Initialize your project

Speed up setup with our AI agent skillThe phrase-strings-config skill follows the Agent Skills open format and works with any compatible AI coding agent. It can detect your project’s i18n setup and generate .phrase.yml automatically. Install it from the Phrase skills repository.
Run phrase init in your project root. The interactive wizard asks for your token, project ID, file format, and locale file path, then creates a .phrase.yml config file.
If your account is on the US datacenter, pass the host flag:
You can also skip the wizard entirely with flags:

2. Upload locale files

Use --wait to block until processing completes (recommended in CI):

3. Download locale files

Configuration

phrase init creates a .phrase.yml file in your project root. You can place it in the current working directory, your home directory, or point to it with the --config flag or the PHRASEAPP_CONFIG environment variable.

Global settings

Framework examples

Full annotated example

Placeholders and globbing

Use these placeholders in file paths: Globbing operators work in push.sources paths:
Note: globbing is not supported in pull.targets — use explicit paths with placeholders instead.

Push parameters

Key parameters for push.sources[].params:

Pull parameters

Key parameters for pull.targets[].params:

Format options

Some file formats support additional format_options in the params section:
For the full list of supported format_options per file format, refer to the Help Center format articles.

Core commands

Docker

Mount your project directory so the CLI can read .phrase.yml and write locale files:
For interactive commands like init, add the -it flag:

Advanced

Monorepos: Place one .phrase.yml in each package and run the CLI from the corresponding folder, or use the --config flag to point CI jobs to different config files. Rate limiting: When the locale download rate limit is reached, the CLI automatically waits and resumes. You’ll see: rate limit exceeded, download will resume in x seconds. Proxy: Set the HTTPS_PROXY environment variable:
Windows shell escaping: When passing JSON on the command line, use double quotes and escape inner quotes with \:

Git integration

When using the CLI with a Git provider (GitHub, GitLab, Bitbucket), ensure the following prerequisites are met in addition to having .phrase.yml committed to the repository:
  • A GitHub access token scoped to the repository (public_repo for public repositories).
  • If SSO is enabled in GitHub, it must also be enabled for the access token.
  • The phrase_translations branch must not be protected.
  • The repository must not require signed commits.
  • Read and write access to the repository are required.
  • Read and write access to the repository are required.
  • GitLab 9.5 or newer is required for API compatibility.
  • Ensure .phrase.yml contains at least one push source and one pull target with the correct file formats.
  • Read and write access to the repository are required.
  • Ensure .phrase.yml contains at least one push source and one pull target with the correct file formats.

GitHub Actions

To automate pushes and pulls in CI, use the Phrase Strings GitHub Action, which installs the CLI and exposes it to your workflow steps.

Phrase Strings CLI on GitHub