airglot
DocsPrivate beta
Docs menu

CLI reference

AirGlot has two command-line tools. Both have sync, pull and check; the web tool also has import.

ToolForInstall
airglotFlutter apps (ARB)dart pub global activate airglot
@airglot/cliWeb apps (JSON)npx @airglot/cli or npm install --save-dev @airglot/cli (Node 20+)

Both read airglot.yaml and take the token from the AIRGLOT_TOKEN environment variable.

Global options

OptionDoes
--project <dir>Runs in a subfolder of the repository. Goes before the command: airglot --project app pull.

sync

airglot sync [--commit <sha>]

Uploads the template, and for web apps its notes file when there is one. Needs the Sync scope. The commit defaults to GITHUB_SHA, BITBUCKET_COMMIT or CI_COMMIT_SHA. Prints the counts and any problems as warnings.

pull

airglot pull [--version <v>] [--force] [--no-platform-lists]

Writes a release's files, byte for byte, beside the template and records them in airglot.lock. Needs the Export scope.

OptionDoes
--version <v>Pulls that release instead of the latest.
--forceOverwrites pulled files that were edited since the last pull.
--no-platform-listsFlutter only. Leaves the iOS and Android language lists alone.

A release always holds every language the app has shipped, so pull keeps writing a language's file even when the latest publish left it out.

check

airglot check [--offline] [--missing fail|warn]

Checks pulled files against airglot.lock, lists template strings each language file lacks, then checks the template against AirGlot's sync rules without saving anything.

OptionDoes
--offlineSkips the template check. It's also skipped when AIRGLOT_TOKEN isn't set.
--missing failFails when strings are untranslated, for this run only.
--missing warnOnly warns, for this run only.

import

npx @airglot/cli import <locale>

Web CLI only. Uploads the existing translations for one language, such as fr. They show in Review as imported and wait for a reviewer; nothing is approved by an import. Needs the Sync scope. Prints a link to the language's guided review.

airglot.yaml

KeyToolsDoes
appbothRequired. The app id from the app's settings in AirGlot.
templatewebRequired. The source-language file or folder, relative to airglot.yaml.
formatwebicu or i18next. Guessed from the template when left out.
descriptionswebThe notes file. Defaults to the template's name with .meta.json.
missingbothwarn (default) or fail: what check does about untranslated strings.
hostbothOnly for a different AirGlot server. Defaults to https://app.airglot.com.

Flutter apps don't set template: the CLI reads arb-dir and template-arb-file from l10n.yaml.

Exit codes

CodeMeaning
0Success
1The command failed: server error, missing release, edited files, or problems
2Usage or configuration error: bad flags, no airglot.yaml, or no AIRGLOT_TOKEN