Skip to content

Config File Reference

The lokai.config.yaml file configures the LokAI CLI for your project, defining your workspace, project, locale directories, and sync behaviour.

Place lokai.config.yaml at the root of your repository (alongside your package.json or equivalent).

version: 1
workspace: your-workspace-slug
project: your-project-slug
apiUrl: https://api.lokai.cloud # optional — defaults to the LokAI cloud API
localesDir: ./locales # path to your local translation files
format: json # json | yaml | po | xliff
mainLanguages:
- en
targetLanguages:
- fr
- de
- es
- ja
- zh
pullOptions:
includeDraft: false # include draft (unreviewed) translations
flatten: false # flatten nested keys to dot-notation
pushOptions:
createMissing: true # create keys not yet in LokAI
updateExisting: false # overwrite source text for existing keys

Required · number

Config file schema version. Always set to 1.


Required · string

The slug of your LokAI workspace. Found in your workspace settings.


Required · string

The slug of the project within the workspace to sync keys with.


Optional · string · Default: https://api.lokai.cloud

Override the API base URL. Useful for self-hosted deployments or pointing at the development environment (https://api-dev.lokai.cloud).


Required · string

Path to the directory containing your local translation files, relative to the config file.


Required · string

File format used for import and export.

ValueDescription
jsonFlat or nested JSON
yamlYAML key-value files
poGNU gettext .po files
xliffXLIFF 1.2 / 2.0

Required · string[]

BCP 47 language codes for the main (source) languages of the project. These are human-owned — the CLI pushes them to LokAI and the LLM translates from them.


Required · string[]

BCP 47 language codes for languages owned by the LLM. The CLI pulls completed translations for these languages.


Optional · boolean · Default: false

When true, the CLI pulls translations with draft status in addition to approved ones.


Optional · boolean · Default: false

When true, nested JSON/YAML keys are flattened to dot-notation on pull (e.g. buttons.save instead of { buttons: { save: "..." } }).


Optional · boolean · Default: true

When true, local keys not yet present in LokAI are created automatically on push.


Optional · boolean · Default: false

When true, pushing will overwrite the source text of keys that already exist in LokAI. Use with caution — this will trigger re-translation for all affected keys.


version: 1
workspace: acme-corp
project: main-app
localesDir: ./src/locales
format: json
mainLanguages: [en]
targetLanguages: [fr, de, es]
version: 1
workspace: acme-corp
project: main-app
apiUrl: https://api.lokai.cloud
localesDir: ./src/locales
format: json
mainLanguages:
- en
- en-GB
targetLanguages:
- fr
- de
- es
- ja
- zh
pullOptions:
includeDraft: false
flatten: false
pushOptions:
createMissing: true
updateExisting: false