Commands
The Algebras CLI provides several commands to manage your localization workflow. This reference covers all available commands and their options.
Command Overview
Section titled “Command Overview”| Command | Description |
|---|---|
init |
Initialize or regenerate configuration |
add |
Add a language to your project |
translate |
Translate source files to target languages |
update |
Update existing translations |
ci |
CI-friendly check command for automated workflows |
review |
Compare translated files against the source and flag issues |
status |
Show project status and translation progress |
healthcheck |
Validate translation quality (placeholders, formatting, tags) |
configure |
Configure CLI settings |
glossary push |
Upload glossary terms from a CSV/TSV/XLSX file |
Every command accepts a global -f/--config-file <path> option (before the subcommand) to use a config file other than .algebras.config, e.g. algebras -f .algebras-fr.config translate.
Initialize or regenerate your Algebras configuration.
algebras init [options]Options
Section titled “Options”--force- Force initialization even if a config file already exists--verbose- Show detailed information about locale detection--provider <provider>- Set the default provider (currently onlyalgebras-aiis supported)
Examples
Section titled “Examples”# Initialize new projectalgebras init
# Regenerate existing configurationalgebras init --force
# Initialize with verbose detection outputalgebras init --verboseWhat it does
Section titled “What it does”- Auto-detects locale files in your project (common
src/locales,i18n,public/locales,messages, etc. patterns) and infers languages from filenames/directories - Creates a
.algebras.configfile with the detected languages and source file mappings - Defaults to
algebras-aias the provider - Warns if
ALGEBRAS_API_KEYis not set
Language selection is automatic, not interactive — init does not prompt you to pick languages. Use algebras add afterward to add more.
Add a single language to your project configuration.
algebras add <language>add takes exactly one language code per invocation — to add several languages, run it multiple times.
Examples
Section titled “Examples”# Add a languagealgebras add es
# Add several languagesalgebras add fralgebras add deSupported Language Codes
Section titled “Supported Language Codes”Common language codes include:
es- Spanishfr- Frenchde- Germanpt_BR- Brazilian Portuguesezh_CN- Simplified Chineseja- Japaneseko- Koreanru- Russianar- Arabic
There is currently no algebras remove command — remove a language by deleting its entry from the languages list in .algebras.config.
translate
Section titled “translate”Translate source files to target languages.
algebras translate [options]Options
Section titled “Options”--language, -l <code>- Translate only the specified language--force[=<keys>]- Force translation even if files are up to date. Pass it bare to force everything, or with a comma-separated key list (e.g.--force "key1,key2") to force only those keys--only-missing- Only translate keys that are missing in the target files--ui-safe- Ensure translations don’t exceed the original text length--verbose- Show detailed logs of the translation process--batch-size <number>- Override the batch size for this run. Without this flag, the value comes frombatch_sizein.algebras.config(5 in a project created byalgebras init), falling back toALGEBRAS_BATCH_SIZE, then a hardcoded 20--max-parallel-batches <number>- Override the maximum number of parallel batches (default: 5)--glossary-id <id>- Use a specific glossary for translation--prompt-file <file>- Use a custom prompt loaded from a file--regenerate-from-scratch- Regenerate target files from scratch instead of updating them in place--sync-batch- Use the legacy synchronous batch translation endpoint instead of the default async submit+poll endpoint--no-cache- Bypass cached translations (API-side and local cache) and force fresh results
Examples
Section titled “Examples”# Basic translationalgebras translate
# Only one languagealgebras translate --language fr
# UI-safe translationalgebras translate --ui-safe
# Use custom batch sizealgebras translate --batch-size 10
# Use a glossaryalgebras translate --glossary-id glossary-123
# Custom prompt from a filealgebras translate --prompt-file custom-prompt.txt
# Force re-translation of specific keys onlyalgebras translate --force "common.title,common.subtitle"
# Bypass the translation cachealgebras translate --no-cacheupdate
Section titled “update”Update existing translations based on source file changes.
algebras update [options]Options
Section titled “Options”--language, -l <code>- Update only the specified language--full- Translate the entire file, not just missing/outdated keys--only-missing- Only translate keys that are missing, and skip git-based outdated-key validation--ui-safe- Ensure translations don’t exceed the original text length--verbose- Show detailed logs of the update process
If neither --full nor --only-missing is passed, update defaults to updating missing and outdated keys (using git to detect changed source lines). update does not accept translate’s batch-processing, glossary, or prompt options.
Examples
Section titled “Examples”# Update missing/outdated translationsalgebras update
# Full re-translation of every keyalgebras update --full
# Update only missing keys, skip git validationalgebras update --only-missing
# UI-safe updatealgebras update --ui-safeCI-friendly command that checks translation completeness without translating. It always uses git-based validation unless --only-missing is passed, and exits non-zero if issues are found — no separate --fail-on-error flag is needed.
algebras ci [options]Options
Section titled “Options”--language, -l <code>- Check only the specified language--verbose- Show detailed logs of the check process--only-missing- Only check for missing keys; skip git validation for outdated keys
Examples
Section titled “Examples”# Fail the build if translations are missing or outdatedalgebras ci
# Only check for missing keysalgebras ci --only-missingreview
Section titled “review”Compare each target language’s files against the source language and flag missing keys, extra keys, type mismatches, and suspiciously short/long translations (a simple length-ratio heuristic).
algebras review [options]Options
Section titled “Options”--language, -l <code>- Review only the specified language. If omitted and more than one target language is configured, you’ll be prompted to pick one.
Examples
Section titled “Examples”algebras review --language frstatus
Section titled “status”Show translation progress and configuration information.
algebras status [options]Options
Section titled “Options”--language, -l <code>- Show status only for the specified language
Output
Section titled “Output”For each configured target language, status prints the number of translated keys vs. expected keys (with percentage), any outdated keys, and the file completion count. It also validates your configured language codes against the API (when ALGEBRAS_API_KEY is set) and warns about codes the API doesn’t recognize.
healthcheck
Section titled “healthcheck”Validate translation quality — checks for placeholder/variable mismatches, unbalanced HTML/XML tags, formatting differences, and other structural issues between source and target strings. Exits with a non-zero status if errors are found, making it usable in CI alongside ci.
algebras healthcheck [options]Options
Section titled “Options”--language, -l <code>- Check only the specified language--format <console|json>- Output format (default:console)--verbose- Show detailed information
Examples
Section titled “Examples”algebras healthcheckalgebras healthcheck --language de --format jsonconfigure
Section titled “configure”View or change CLI settings stored in .algebras.config. Run with no options to print the current configuration.
algebras configure [options]Options
Section titled “Options”--provider <provider>- Set the API provider (currently onlyalgebras-ai)--model <model>- Set the model for the provider (stored in config; not used by thealgebras-aiprovider today)--path-rules <rules>- Set legacy path rules (comma-separated patterns)--batch-size <number>- Set the default batch size for translation processing--max-parallel-batches <number>- Set the default maximum number of parallel batches--glossary-id <id>- Set the default glossary ID for translations--prompt <text>- Set a default prompt for translations--normalize-strings <true|false>- Enable/disable string normalization (removes escaped characters like\')
Examples
Section titled “Examples”# Show current configurationalgebras configure
# Set batch sizealgebras configure --batch-size 15
# Set multiple optionsalgebras configure --batch-size 10 --max-parallel-batches 3
# Set default promptalgebras configure --prompt "Translate to {target_language} maintaining a professional tone"
# Enable string normalizationalgebras configure --normalize-strings trueglossary push
Section titled “glossary push”Upload glossary terms from a CSV, TSV, or XLSX file, creating a new glossary in the process.
File Format
Section titled “File Format”The file’s first column must be a Record ID (a unique identifier for the term), followed by one column per language, using the language code as the header. Each row is a term, with its translation in each language column:
Record ID,en,fr,de1,Submit,Envoyer,Absenden2,Cancel,Annuler,Abbrechen- Empty cells are skipped (not uploaded as blank terms)
- Rows with a missing Record ID, or with a different column count than the header, are skipped with a warning
- Terms longer than 1000 characters are truncated automatically;
--max-lengthapplies a stricter, configurable limit on top of that (default: 255) - TSV files use the same layout with tabs instead of commas
algebras glossary push <file> --name <name> [options]Options
Section titled “Options”--name <name>- Name of the glossary to create (required)--batch-size <number>- Number of terms to upload per request (default: 100)--debug- Log all requests before sending--rows-ids <ids>- Comma-separated list of row numbers or record IDs to include (upload a subset)--max-length <number>- Maximum allowed term length; longer terms are skipped (default: 255)
Examples
Section titled “Examples”# Upload a full glossaryalgebras glossary push terms.csv --name "Product Glossary"
# Upload only specific rowsalgebras glossary push terms.xlsx --name "Product Glossary" --rows-ids "1,2,5"
# Use the resulting glossary in translationalgebras translate --glossary-id <glossary-id-from-output>Environment Variables
Section titled “Environment Variables”The CLI respects these environment variables:
ALGEBRAS_API_KEY- Your API key (required for translation)ALGEBRAS_BASE_URL- Custom API base URL (default:https://platform.algebras.ai)ALGEBRAS_BATCH_SIZE- Default batch size, used when not set in config or via--batch-sizeALGEBRAS_MAX_PARALLEL_BATCHES- Default max parallel batches, used when not set in config or via--max-parallel-batches
Global Options
Section titled “Global Options”algebras --version- Show CLI versionalgebras <command> --help- Show help for any commandalgebras -f <path> <command>- Use a custom config file instead of.algebras.config
Note that --verbose is defined per-command (available on init, translate, update, ci, and healthcheck), not as a single global flag.
Command Workflow Examples
Section titled “Command Workflow Examples”Basic Translation Workflow
Section titled “Basic Translation Workflow”# 1. Initialize projectalgebras init
# 2. Add languagesalgebras add esalgebras add fr
# 3. Translate filesalgebras translate
# 4. Check statusalgebras statusAdvanced Workflow with Custom Settings
Section titled “Advanced Workflow with Custom Settings”# 1. Configure defaultsalgebras configure --batch-size 10 --max-parallel-batches 2
# 2. Translate with UI-safe modealgebras translate --ui-safe --glossary-id tech-terms
# 3. Update only missing translationsalgebras update --only-missingCI/CD Integration
Section titled “CI/CD Integration”# In your CI pipelinealgebras ci --only-missingTroubleshooting Commands
Section titled “Troubleshooting Commands”Check Configuration
Section titled “Check Configuration”algebras configurealgebras statusValidate Setup
Section titled “Validate Setup”algebras init --forcealgebras statusTest Translation
Section titled “Test Translation”algebras translate --verboseNext Steps
Section titled “Next Steps”- Advanced Features - Explore glossaries, batch processing, and Git integration
- Troubleshooting - Common issues and solutions
- Configuration - Detailed configuration options