Skip to content

About

Official command-line client for POEditor: sync localization files with pull/push and script projects, terms and translations through the API. Linux, macOS, Windows.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

POEditor

POEditor CLI

Your POEditor projects, terms and translations, from the command line.
Sync localization files with pull and push, script everything else with poeditor api.

Install · Quick start · Commands · CI


poeditor is a single binary for Linux, macOS and Windows. It talks to the public POEditor API v2 with your API token, and keeps your repository's language files in step with POEditor:

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

Install

Homebrew (macOS and Linux):

brew install poeditor/tap/poeditor

Scoop (Windows; install Scoop first if scoop is not recognized):

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

Without a package manager, on macOS and Linux:

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

Windows (PowerShell):

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

The scripts install the latest release after checking it against the release's checksums. Set POEDITOR_VERSION (e.g. v0.1.0) to install another release, and POEDITOR_INSTALL_DIR to choose where the binary goes.

Or download the archive for your platform from the latest release, unpack it and put poeditor somewhere on your PATH.

With Go 1.27 or later, you can also build it yourself:

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

Check it works with poeditor --version.

Quick start

1. Log in. Create an API token on your POEditor account page, then:

poeditor auth login

The token is checked, then kept in your system keyring (macOS Keychain, Windows Credential Manager, libsecret on Linux). More accounts? See Accounts and tokens.

2. Describe your files. In the root of your repository:

poeditor config init

A short wizard picks the project, finds your language files (locales/{lang}.json, values-{lang}/strings.xml, …) and writes .poeditor.yml. Commit it: it holds no secrets. Everything it can contain is in .poeditor.yml.

3. Sync.

poeditor push      # upload the source-language files: new and changed terms
poeditor pull      # download every language into its file

See pull and push for what each one sends, --dry-run, and the upload limits.

Commands

Command What it does Docs
poeditor pull, poeditor push Sync the files listed in .poeditor.yml pull and push
poeditor config … Create, extend and check .poeditor.yml .poeditor.yml
poeditor auth … Log in, several accounts, tokens in CI Accounts and tokens
poeditor api projects … List, create, change, export and upload projects Projects
poeditor api languages … A project's languages and their progress Languages
poeditor api terms … List, add, change, delete and comment on terms Terms
poeditor api translations … Write, delete and machine-translate translations Translations
poeditor api contributors … Who has access, and to which languages Contributors

Every POEditor API v2 endpoint is one command, poeditor api <group> <action>: the API's terms/add_comment is poeditor api terms add-comment. Every command has --help.

Commands that work on a project take --project (-p): its id, or its alias from .poeditor.yml. --id, the API's own name for it, works too:

poeditor api terms list --project web
poeditor api terms list --id 12345

Output

Commands that show data print a table on a terminal, and tab-separated lines without a header when piped, so cut and awk work. --json prints JSON instead, in a stable shape of our own:

poeditor api languages list --project web
poeditor api terms list -p web --language fr --json | jq -r '.[] | select(.translation.content == "") | .term'

Commands that change something report on stderr, so stdout stays clean for scripts. Commands that delete anything ask for --yes instead of prompting, and without it change nothing and print the exact command to run.

CI

No login is needed in CI: set POEDITOR_TOKEN (or POEDITOR_TOKEN_<ACCOUNT> for a named account) and run the command.

# GitHub Actions
- name: install poeditor
  run: |
    curl -fsSL https://raw.githubusercontent.com/POEditor/poeditor-cli/master/install.sh | POEDITOR_INSTALL_DIR="$HOME/.local/bin" sh
    echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: poeditor config check && poeditor pull
  env:
    POEDITOR_TOKEN: ${{ secrets.POEDITOR_TOKEN }}

Setting POEDITOR_INSTALL_DIR and adding it to $GITHUB_PATH makes poeditor available to the later steps. To pin a release, so a new one can't change your build unannounced, add POEDITOR_VERSION=v0.1.0 next to POEDITOR_INSTALL_DIR.

poeditor config check exits with an error when .poeditor.yml points at a project, language or account that does not exist. A read-only token is enough for pull. More in Accounts and tokens.

Help and feedback

About

Official command-line client for POEditor: sync localization files with pull/push and script projects, terms and translations through the API. Linux, macOS, Windows.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages