norcube langsync init
Create a .langsync.json in the project root so this codebase can sync with Langsync
Sets up Langsync inside the current project. Run this once per codebase; the resulting .langsync.json is committed alongside your source so every dev (and CI) syncs against the same backend namespaces.
The wizard:
1. resolves which org this project belongs to (--org flag, or the
existing org block in .langsync.json, or — for a fresh init —
a picker when you can access more than one org),
2. lists every namespace in that organization,
3. lets you pick one or more,
4. for each pick, asks where its translation files live on disk
(default: i18n/<namespace>), and
5. fetches the namespace's backend default language so sync knows
which local file to push from.The org choice is baked into .langsync.json so every sync, pull, or init re-run targets that org regardless of what "nrc org use" is set to globally. Override at any time with the --org flag.
Re-run any time to add a new namespace; existing entries are kept untouched (use --force to overwrite the file from scratch).
After writing the config, init runs a follow-up action controlled by --seed:
pull (default) — download the server's current state to disk.
Right when the team has been editing strings in
the web app and a fresh checkout needs them.
push-all — push every local <lang>.json file as the source
of truth. Human translations in non-default
languages are preserved; autotranslate only
fills cells the client didn't provide. Right
when this project has existing translation files
and you want them to be authoritative.
push-default — push only the default-language file; let AI
translate everything else from scratch. Right
when you have only the default lang locally and
want the LLM to seed the rest.
none — write the config and stop.Any seed mode only applies to newly-added namespaces; entries already in .langsync.json from a previous init are left alone. --force counts every picked namespace as new.
Usage
norcube langsync init [flags]Examples
norcube langsync init
norcube langsync init -n web -n marketing --dir i18n
norcube langsync init --force
norcube langsync init --seed push-all # use my local JSON files as the source of truth
norcube langsync init --seed push-default # only my default-lang file; AI does the rest
norcube langsync init --seed none # config only, do nothing else
norcube langsync init -n web --seed none -o json # the written config as JSONFlags
| Flag | Default | Description |
|---|---|---|
--dir | Parent directory for translation files (each picked namespace becomes <dir>/<namespace>); skips the per-namespace dir prompt | |
--force | Overwrite an existing .langsync.json instead of merging | |
--local-lang | Language code you write source-of-truth values in. Defaults to the namespace's server-side default. Pass e.g. --local-lang cs to write in Czech even if the namespace default is en-US (see apps/langsync/docs/sync-source-language.md). | |
-n, --namespace | Namespace name to include (repeat for multiple); skips the picker | |
--seed | pull | After writing the config: pull | push-all | push-default | none |
Every command also takes the global flags: --profile, --org, -o, --query, --debug and more.
See also
norcube langsync: Manage LangSync namespaces, terms, languages and translations