CLI referenceverbatra init

verbatra init

Create a verbatra config and .env example for this project.

Scaffold a project: init writes a verbatra.config.ts and a .env.example naming your provider's API key variable (never a key value), and makes sure .gitignore covers .env, .env.local, and .verbatra-local/. When stdin is a terminal and --yes is absent, it prompts for anything you did not pass as a flag; otherwise it takes the defaults, so it runs unattended in CI.

Synopsis

verbatra init [flags]

Flags

FlagArgumentDefaultEffect
--cwd<path>current directorywrite the config and env files to this directory
--provider<id>none (required)provider to scaffold: anthropic, openai, gemini, or deepl; prompted for when omitted interactively
--source<locale>enthe source locale your strings are written in
--targets<locales>decomma-separated target locales to translate into
--path<pattern>locales/{locale}.jsonlocale file pattern; must contain the {locale} token
--yesnoneoffskip prompts and accept the defaults
--forcenoneoffoverwrite an existing verbatra.config.ts or .env.example

The format is not a flag: init detects it from your dependencies (i18next, vue-i18n, next-intl, or @ngx-translate/core). With no single unambiguous match it falls back to i18next-json and leaves a TODO comment listing every supported format. Without --force, an existing verbatra.config.ts or .env.example is skipped, never overwritten, and the command still succeeds.

Examples

# create config + .env example, prompting for the rest
verbatra init --provider gemini

# non-interactive, accept all defaults
verbatra init --provider deepl --yes

Exit codes

CodeMeaning
0files written, or safely skipped because they already exist
2a missing or unknown --provider, an invalid scaffold, or a usage error
Edit on GitHub