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 languages to your project |
remove | Remove languages from your project |
translate | Translate source files to target languages |
update | Update existing translations |
status | Show project status and configuration |
configure | Configure CLI settings |
ci | CI-friendly command for automated workflows |
Initialize or regenerate your Algebras configuration.
algebras init [options]Options
Section titled “Options”--force- Force regeneration of configuration file
Examples
Section titled “Examples”# Initialize new projectalgebras init
# Regenerate existing configurationalgebras init --forceWhat it does
Section titled “What it does”- Creates
.algebras.configfile - Detects source files in your project
- Sets up default configuration
- Prompts for language selection
Add languages to your project configuration.
algebras add <language1> [language2] [language3] ...Examples
Section titled “Examples”# Add single languagealgebras add es
# Add multiple languagesalgebras add es fr de
# Add language with regionalgebras add pt_BR zh_CNSupported 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
remove
Section titled “remove”Remove languages from your project configuration.
algebras remove <language1> [language2] [language3] ...Examples
Section titled “Examples”# Remove single languagealgebras remove es
# Remove multiple languagesalgebras remove es frtranslate
Section titled “translate”Translate source files to target languages.
algebras translate [options]Options
Section titled “Options”--only-missing- Only translate missing keys--ui-safe- Ensure translations don’t exceed original text length--batch-size <number>- Number of translations per batch (default: 20)--max-parallel-batches <number>- Maximum parallel batches (default: 5)--glossary-id <id>- Use specific glossary for translation--prompt-file <file>- Use custom prompt from file--prompt <text>- Use custom prompt text
Examples
Section titled “Examples”# Basic translationalgebras translate
# UI-safe translationalgebras translate --ui-safe
# Use custom batch sizealgebras translate --batch-size 10
# Use glossaryalgebras translate --glossary-id glossary-123
# Custom promptalgebras translate --prompt "Translate to {target_language} maintaining a professional tone"
# Only missing translationsalgebras translate --only-missingupdate
Section titled “update”Update existing translations based on source file changes.
algebras update [options]Options
Section titled “Options”Same as translate command.
Examples
Section titled “Examples”# Update all translationsalgebras update
# UI-safe updatealgebras update --ui-safe
# Update with custom settingsalgebras update --batch-size 15 --max-parallel-batches 2status
Section titled “status”Show project status and configuration information.
algebras statusOutput
Section titled “Output”Shows:
- Configured languages
- Source files detected
- API configuration
- Recent translation history
- Configuration validation status
Example Output
Section titled “Example Output”Algebras CLI Status==================
Languages: en, es, fr, deSource Files: 3 files detectedAPI Provider: algebras-aiModel: gpt-4
Configuration: ✓ ValidLast Translation: 2025-01-12 14:30:00configure
Section titled “configure”Configure CLI settings and defaults.
algebras configure [options]Options
Section titled “Options”--batch-size <number>- Set default batch size--max-parallel-batches <number>- Set default max parallel batches--prompt <text>- Set default prompt--normalize-strings <true|false>- Enable/disable string normalization
Examples
Section titled “Examples”# 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 trueCI-friendly command for automated workflows.
algebras ci [options]Options
Section titled “Options”Same as translate command, plus:
--fail-on-error- Exit with error code on translation failures--quiet- Suppress non-essential output
Examples
Section titled “Examples”# CI translation with error handlingalgebras ci --fail-on-error --quiet
# CI update with custom settingsalgebras ci --only-missing --ui-safe --fail-on-errorGlobal Options
Section titled “Global Options”All commands support these global options:
--help- Show help message--version- Show version information--verbose- Enable verbose output--config <file>- Use custom config file
Examples
Section titled “Examples”# Show help for translate commandalgebras translate --help
# Use custom config filealgebras translate --config custom-config.yaml
# Verbose outputalgebras translate --verboseEnvironment Variables
Section titled “Environment Variables”The CLI respects these environment variables:
ALGEBRAS_API_KEY- Your API key (required)ALGEBRAS_BASE_URL- Custom API base URLALGEBRAS_BATCH_SIZE- Default batch sizeALGEBRAS_MAX_PARALLEL_BATCHES- Default max parallel batches
Command Workflow Examples
Section titled “Command Workflow Examples”Basic Translation Workflow
Section titled “Basic Translation Workflow”# 1. Initialize projectalgebras init
# 2. Add languagesalgebras add es fr de
# 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-missing --fail-on-error --quietTroubleshooting Commands
Section titled “Troubleshooting Commands”Check Configuration
Section titled “Check Configuration”algebras 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