Knowledge Base

Documentation to help you use the POEditor localization platform effectively

CLI quick start

Owner Admin

This article takes you from nothing to your first sync in about five minutes. At the end, your repository's language files are connected to a POEditor project: poeditor push sends new strings up, and poeditor pull brings translations down.

You need a POEditor project with at least one language, and a repository with your language files (for example locales/en.json).

Step 1: Install the CLI

Pick the instructions for your operating system.

macOS

If you use Homebrew, run:

brew install poeditor/tap/poeditor

Without Homebrew, run the install script:

curl -fsSL https://raw.githubusercontent.com/POEditor/poeditor-cli/master/install.sh | sh

Linux

Run the install script:

curl -fsSL https://raw.githubusercontent.com/POEditor/poeditor-cli/master/install.sh | sh

If you use Homebrew on Linux, you can run brew install poeditor/tap/poeditor instead.

On macOS and Linux, the script puts poeditor in /usr/local/bin if it can write there, and in ~/.local/bin otherwise. If that folder isn't on your PATH, the script tells you, so you can add it.

Windows

If you use Scoop, run:

scoop bucket add poeditor https://github.com/POEditor/scoop-bucket
scoop install poeditor

Without Scoop, run the install script in PowerShell:

irm https://raw.githubusercontent.com/POEditor/poeditor-cli/master/install.ps1 | iex

The script puts poeditor.exe in %LOCALAPPDATA%\Programs\poeditor and adds that folder to your user PATH. Open a new terminal window to use poeditor there.

Both install scripts download the latest release and check it against the release's checksums before installing it. To install a specific version, set the POEDITOR_VERSION environment variable (for example v0.1.0). To choose the folder, set POEDITOR_INSTALL_DIR.

Other ways

You can also download the file for your operating system from the latest release, unpack it and put poeditor in a folder on your PATH.

If you have Go 1.27 or later installed, you can build it yourself:

go install github.com/POEditor/poeditor-cli/cmd/poeditor@latest

Check that it works:

poeditor --version

Step 2: Log in

Go to your account's API access page and copy your API token. Then run:

poeditor auth login

Paste the token when asked (it isn't shown as you type). The CLI checks it with POEditor, tells you how many projects it can see, and saves it in your system's keyring.

If your projects are in more than one POEditor account, for example your own and a client's, you can add each one. The first account is called default. Give every other account a short name when you log in:

poeditor auth login --account client-a

Commands use the default account unless you add --account client-a. To see the accounts you've added, run poeditor auth list. For more, see CLI login and API tokens.

Step 3: Start using the CLI

You're ready. Every POEditor API call is a poeditor api command, so you can work with your projects straight from the terminal. A few examples:

# list your projects and their IDs
poeditor api projects list

# see a project's languages and how far each one is translated
poeditor api languages list --project 12345

# add French to the project
poeditor api languages add fr --project 12345

# list the project's terms with their French translations
poeditor api terms list --project 12345 --language fr

# add a term
poeditor api terms add save --project 12345 --context button

Replace 12345 with your project's ID from poeditor api projects list. Every command has --help, which lists its options.

Connect your repository to the project

To make it easier to sync your language files with a project, you can create a config file that says which files belong to which project. poeditor config init can create it for you. In the root folder of your repository, run:

poeditor config init

The wizard asks you to:

  1. pick the project from your list;
  2. give it a short alias, such as web, so you can write --project web instead of the ID;
  3. confirm the source language, which is the language your code is written in;
  4. confirm the language files it found, for example locales/{lang}.json, where {lang} stands for the language code. It then writes .poeditor.yml. Commit this file with your code. It holds no token, so it is safe to share with your team. For every option the file supports, see How to set up the .poeditor.yml file for CLI.

To check the file against your POEditor account, run:

poeditor config check

Send your strings to POEditor

poeditor push

The CLI uploads your source-language file. Every new term is added to the project together with its source text, so translators can start working.

$ poeditor push
uploaded       locales/en.json (en)  terms: 42 parsed, 42 added, 0 deleted · translations: 42 added, 0 updated
1 file uploaded: 42 terms added, 0 deleted

Bring translations into your code

When translators have done some work, run:

poeditor pull

The CLI downloads every language and writes it to its file, creating folders as needed.

$ poeditor pull
created        locales/fr.json
created        locales/de.json
unchanged      locales/en.json
3 files: 2 created, 0 updated, 1 unchanged

That's the whole loop: change strings in your code, poeditor push, let translators work in POEditor, then poeditor pull before a release.

How to log out or remove an account

To remove an account from the CLI, together with its saved token, run:

poeditor auth logout

If you've added more than one account, name the one to remove:

poeditor auth logout --account client-a

If you remove the default account, the first remaining one, in alphabetical order, becomes the default. To make another account the default, run poeditor auth default <name>.

Logging out doesn't change anything in POEditor. To stop the token from working at all, revoke or regenerate it on your account's API access page.

Additional help