CLI Quick Start
Perfect for developers who want to translate files locally and integrate with their build process.
Welcome to Algebras! This guide will help you get up and running quickly with either our CLI tool or API. Choose the path that works best for your workflow.
Before you begin, you’ll need:
CLI Quick Start
Perfect for developers who want to translate files locally and integrate with their build process.
API Quick Start
Ideal for developers building applications that need translation services programmatically.
The Algebras CLI is perfect for translating localization files in your project. Here’s how to get started:
pip install git+https://github.com/algebras-ai/algebras-cli.gitalgebras initThis creates a .algebras.config file in your project root.
export ALGEBRAS_API_KEY=your_api_key_herealgebras add es fr dealgebras translate🎉 Success! Your files are now translated. Check the generated language directories.
Make your first translation request in just a few lines of code:
export ALGEBRAS_API_KEY=your_api_key_herecurl -X POST "https://platform.algebras.ai/api/v1/translation/translate" \ -H "X-Api-Key: $ALGEBRAS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "sourceLanguage": "auto", "targetLanguage": "es", "text": "Hello, world!" }'Response:
{ "status": "ok", "timestamp": "2025-01-12T22:31:48.856Z", "data": "¡Hola, mundo!"}🎉 Success! You’ve made your first translation!
Now that you have the basics working, explore these advanced features:
Solution: Run algebras init in your project directory.
Solution: Export your API key: export ALGEBRAS_API_KEY=your_key
Solution: Add the language: algebras add xx
Solution: Check that your API key is correct and properly set in the X-Api-Key header.
Solutions:
--ui-safe flag for UI-constrained translationsReady to dive deeper? Check out our CLI documentation or API examples for more advanced usage patterns.