This tool is for Phrase Strings only.
Installation
- macOS / Linux
- Windows
- Build from source
Authentication
For details on token types and how to generate them, see Authentication. The CLI looks for the token in this order:--access_tokenflagPHRASE_ACCESS_TOKENenvironment variable (recommended)phrase.access_tokenin.phrase.yml(discouraged)
.phrase.yml, especially if the file is committed to a repository:
Quick start
1. Initialize your project
Runphrase 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.
2. Upload locale files
--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
- Rails
- iOS
- Android
- Multi-platform
Full annotated example
phrase_configuration_overview.yml
phrase_configuration_overview.yml
Placeholders and globbing
Use these placeholders infile paths:
Globbing operators work in
push.sources paths:
pull.targets — use explicit paths with placeholders instead.
Push parameters
Key parameters forpush.sources[].params:
Pull parameters
Key parameters forpull.targets[].params:
Format options
Some file formats support additionalformat_options in the params section:
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:
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:
\:
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:
GitHub
GitHub
- A GitHub access token scoped to the repository (
public_repofor public repositories). - If SSO is enabled in GitHub, it must also be enabled for the access token.
- The
phrase_translationsbranch must not be protected. - The repository must not require signed commits.
- Read and write access to the repository are required.
GitLab
GitLab
- Read and write access to the repository are required.
- GitLab 9.5 or newer is required for API compatibility.
- Ensure
.phrase.ymlcontains at least one push source and one pull target with the correct file formats.
Bitbucket
Bitbucket
- Read and write access to the repository are required.
- Ensure
.phrase.ymlcontains at least one push source and one pull target with the correct file formats.