Skip to content

Getting Started

This guide will walk you through installing lin and setting it up for the first time.

TL;DR you need:

  • a project with i18n set up that lin can detect
  • configured LLM provider and model or use the defaults
  • API keys for your chosen LLM providers in your .env file (e.g., OPENAI_API_KEY)

For the complete config, see Configuration.

  1. Install the package

    Terminal window
    npm i -D @rttnd/lin

    You can also use the -g flag to install globally for non-npm projects.

  2. Configure i18n

    lin will try to automatically detect your i18n configuration from your existing project setup. See Integrations for the list of supported integrations.

    If your setup is not detected automatically, you can create a configuration file. You have two options:

    Add an i18n object to your main lin.config.ts file.

    import { defineConfig } from '@rttnd/lin'
    export default defineConfig({
    i18n: {
    locales: ['en-US', 'es-ES'],
    defaultLocale: 'en-US',
    directory: 'locales',
    },
    // ... other lin config
    })
  3. Configure LLMs

    You need to specify the model and the provider in your configuration. Make sure the corresponding API key is set in your env variables (e.g., OPENAI_API_KEY).

    These are the defaults:

    import { defineConfig } from '@rttnd/lin'
    export default defineConfig({
    options: {
    provider: 'openai',
    model: 'gpt-4.1-mini',
    }
    })

    See LLM Configuration.

  4. Add .lin to your .gitignore

    By default, lin will save the locale json files in .lin for the undo command to work. Add it to your .gitignore or disable this by setting undo: false in your lin.config.ts file, or use the --no-undo flag.

  5. Next Steps