What can you do with the CLI?
What can you do with the CLI?
Perfect! Now I have a comprehensive overview. Let me create a summary of all the CLI commands available.
##Summary: What You Can Do With the GT CLI
The General Translation CLI provides several powerful commands for managing internationalization (i18n) in your project. Here's what's available:
###Core Translation Commands
-
gt init- Run the setup wizard to configure your project for General Translation- Detects your framework (Next.js, React, Python, etc.)
- Sets up gt.config.json file
- Optionally connects to Locadex AI Agent for automatic project setup
- Adds GT usage instructions to AI agent files
-
gt setup- Upload source files and setup the project for translation- Preprocesses shared static assets
- Prepares your project for the translation pipeline
-
gt translate- Translate your entire project using General Translation- Scans project for translations
- Submits to API for translation (if not already staged)
- Downloads completed translations
- Post-processes and mirrors assets to locale directories
-
gt stage- Submit project for translation with human approval required- Stages translations for review before downloading
-
gt download- Download translations that were originally staged- Retrieves translations pending from a staged request
-
gt enqueue- Enqueue translations for a given set of files- Submits specific files for translation
###Upload & Authentication
-
gt upload- Upload source files and translations to the General Translation platform- Supports multiple file formats (JSX, ICU, I18NEXT, etc.)
- Can specify custom data format per library type
-
gt auth- Generate General Translation API keys and project ID- Create development, production, or both types of keys
- Keys saved to .env.local file
###Configuration
gt configure- Configure your gt.config.json file- Interactive setup for project configuration
- Alternative to init if you just want to reconfigure
###Advanced Commands
-
gt save-local- Save local edits for all configured files by sending diffs- Sends changes without enqueuing translations
-
gt validate- Validate your project for errors (inline/dictionary content)- Optional: validate specific files
- Scans for dictionary and inline translation errors
-
gt generate- Generate a translation file for the source locale- Useful if you're handling your own translations
- Merges with existing translations
-
gt update-instructions- Update GT usage instructions in AI agent files- Use
--newflag to add instructions to all agent files (not just those with existing instructions) - Keeps agent instructions current with your GT setup
- Use
###Common Flags
Most commands support:
-c, --config <path>- Specify a custom config file path-s, --src <paths...>- Custom source code patterns- And other translation-specific flags
The CLI is designed to work seamlessly with different frameworks (Next.js, React, Node.js, Python, etc.) and automatically adjusts available commands based on your detected framework.
END OF POST