New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

dire

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dire

Go-based CLI tool that automatically translates and maintains your i18n JSON files using translation and AI providers, glossary definitions, and translation memory

latest
Source
npmnpm
Version
0.4.7
Version published
Weekly downloads
655
-15.27%
Maintainers
1
Weekly downloads
 
Created
Source

Dire

Dire Logo

npm version Go License

Automated JSON i18n maintenance for developers

Dire (French for "to say", pronounced /diʁ/) is a Go-based CLI tool that automatically translates and maintains your i18n JSON files using translation and AI providers, glossary definitions, and translation memory

BYOK (Bring Your Own Key) - Use your own provider API keys for maximum control and cost transparency

Dire Demo

Features

  • Multi-provider support: DeepL, Google Translate, Azure AI Translator, Claude, OpenAI, Gemini, Mistral, and DeepSeek
  • Automatic translation reuse: sourcing from glossary definitions and translation memory
  • Translation rephrasing: generate alternative phrasings to improve quality
  • Completeness checking: lint translation files in CI/CD pipelines with --check flag
  • Cleanup orphaned keys: remove translations that no longer exist in your reference locale with --prune
  • Context-aware translations: provide domain-specific context for better results
  • Nested object support: handles complex JSON structures and deeply nested translations
  • High-performance: native Go binary with smart batching and concurrent processing

Installation

# Option 1: Install as project dependency
npm i dire

# Option 2: Install globally
npm i -g dire

# Option 3: Run without installing
npx dire

Quick Start

  • Initialize Configuration

    dire init
    

    This creates a .dire.toml file in your project root. Edit it to match your project structure. See CONFIGURATION.md for complete configuration reference.

    Note: The .dire.toml config file is optional. You can configure everything via CLI flags (see Configuration Override Flags). However, the TOML file offers quality-of-life features like glossary management and multiple pre-configured providers for quick switching.

  • Set Up API Keys

    See Supported Providers section below for setup details.

    Note: Dire automatically loads environment variables from any .env* files in your current directory (e.g., .env, .env.local, .env.production).

  • Run Translation

    dire
    

Common Commands

CommandDescription
direTranslate all missing keys in your i18n files
dire --keys <key>Translate specific key(s): dire --keys "auth.login,auth.register"
dire --sourcedApply only glossary and memory translations
dire --stubCreate placeholder translations (empty strings)
dire --pruneRemove orphaned keys from non-reference locales
dire --checkLint translation completeness for CI/CD

See COMMANDS.md for the complete command reference.

Supported Providers

Set your API key in any .env* file in your project root:

ProviderEnvironment Variable
DeepLDIRE_DEEPL_API_KEY
Google TranslateDIRE_GOOGLE_API_KEY
Azure AI TranslatorDIRE_AZURE_API_KEY
OpenAIDIRE_OPENAI_API_KEY
ClaudeDIRE_CLAUDE_API_KEY
GeminiDIRE_GEMINI_API_KEY
MistralDIRE_MISTRAL_API_KEY
DeepSeekDIRE_DEEPSEEK_API_KEY

Example .env file:

DIRE_CLAUDE_API_KEY=sk-ant-api03-your-key-here

Requirements

  • Node.js 20 or higher
  • API key for at least one supported provider (if using the translation features)

License

All rights reserved. This software is provided for use only and may not be copied, modified, or redistributed without explicit permission.

Keywords

i18n

FAQs

Package last updated on 25 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts