polycli init
Initialise a PolyCLI configuration file in your project root.
Usage
bash
npx @polycli/cli initRuns an interactive prompt and writes a buildtranslator.json file in the current working directory. Safe to re-run — re-running updates the config without affecting existing lockfiles or translated output files.
Interactive prompts
| Prompt | Default | Config field |
|---|---|---|
| Source language (e.g. "en" or "it") | it | sourceLanguage |
| Target languages, comma-separated | en,es | targetLanguages |
| JSON locales folder path | ./locales | localesPath |
| Translate Markdown files? (y/N) | N | — |
| Markdown files folder path | ./docs | markdownPath (optional) |
Output
buildtranslator.json
{
"sourceLanguage": "en",
"targetLanguages": ["it", "es", "fr"],
"localesPath": "./locales",
"markdownPath": "./docs"
}The markdownPath field is only written when you answer y to the Markdown prompt. See the buildtranslator.json reference for a full description of each field.
You can edit
buildtranslator.json manually at any time. Re-running npx @polycli/cli init will overwrite it, so make sure your changes are committed first.