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.
-
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
-g
flag to install globally for non-npm projects. -
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 mainlin.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})If you don’t plan to use other
lin
config, just create ai18n.config.ts
file.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
.lin
to your.gitignore
By default,
lin
will save the locale json files in.lin
for theundo
command to work. Add it to your.gitignore
or disable this by settingundo: false
in yourlin.config.ts
file, or use the--no-undo
flag. -
Next Steps