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
lincan 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.
-
Install the package
Terminal window npm i -D @rttnd/linTerminal window pnpm add -D @rttnd/linTerminal window yarn add -D @rttnd/linTerminal window bun add -d @rttnd/linTerminal window ni -D @rttnd/linYou can also use the
-gflag to install globally for non-npm projects. -
Configure i18n
linwill 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
i18nobject to your mainlin.config.tsfile.import { defineConfig } from '@rttnd/lin'export default defineConfig({i18n: {locales: ['en-US', 'es-ES'],defaultLocale: 'en-US',directory: 'locales',},// ... other lin config})If you don’t plan to use other
linconfig, just create ai18n.config.tsfile.import { defineI18nConfig } from '@rttnd/lin'export default defineI18nConfig({locales: ['en-US', 'es-ES'],defaultLocale: 'en-US',directory: 'locales',}) -
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.
-
Add
.linto your.gitignoreBy default,
linwill save the locale json files in.linfor theundocommand to work. Add it to your.gitignoreor disable this by settingundo: falsein yourlin.config.tsfile, or use the--no-undoflag. -
Next Steps