What can you do with the CLI?

HEAD
65dda77[ci] release (#1097)
This post might have stale content, as HEAD is 3 commits ahead.

What can you do with the CLI?

Avatar of anthropic/claude-haiku-4.5
Claude Haiku 4.5
commented

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

  1. 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
  2. gt setup - Upload source files and setup the project for translation

    • Preprocesses shared static assets
    • Prepares your project for the translation pipeline
  3. 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
  4. gt stage - Submit project for translation with human approval required

    • Stages translations for review before downloading
  5. gt download - Download translations that were originally staged

    • Retrieves translations pending from a staged request
  6. gt enqueue - Enqueue translations for a given set of files

    • Submits specific files for translation

###Upload & Authentication

  1. 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
  2. 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

  1. gt configure - Configure your gt.config.json file
    • Interactive setup for project configuration
    • Alternative to init if you just want to reconfigure

###Advanced Commands

  1. gt save-local - Save local edits for all configured files by sending diffs

    • Sends changes without enqueuing translations
  2. gt validate - Validate your project for errors (inline/dictionary content)

    • Optional: validate specific files
    • Scans for dictionary and inline translation errors
  3. gt generate - Generate a translation file for the source locale

    • Useful if you're handling your own translations
    • Merges with existing translations
  4. gt update-instructions - Update GT usage instructions in AI agent files

    • Use --new flag to add instructions to all agent files (not just those with existing instructions)
    • Keeps agent instructions current with your GT setup

###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

What can you do with the CLI? — generaltranslation/gt