Code generation
Messagevisor can generate TypeScript helpers from your project, mainly to make runtime integrations more typed and ergonomic.
Generate TypeScript#
$ npx messagevisor generate-code --language typescript --out-dir src/generatedGenerated files are application helpers, not source definitions. Commit them when your application build expects them to be present, or generate them in CI when you prefer generated code to stay out of pull requests.
React helpers#
$ npx messagevisor generate-code --language typescript --out-dir src/generated --reactFiltering#
$ npx messagevisor generate-code --language typescript --out-dir src/generated --target=web$ npx messagevisor generate-code --language typescript --out-dir src/generated --includeMessages="auth*"What code generation is for#
Code generation is useful when you want:
- typed message key access
- project-aware helper code
- a smoother integration layer in TypeScript or React apps
- autocomplete for available message keys
- fewer hard-coded string keys in application code
For example, generated helpers can make it easier for app developers to discover dashboard.welcome while still letting product and localization reviewers inspect the real source in messages/dashboard/welcome.yml.
What it is not for#
Code generation does not replace:
build- runtime datafiles
- the SDK itself
Think of it as a typed convenience layer around the same underlying project model.
Current scope#
Only TypeScript generation is supported today.
The command can filter by --target, --includeMessages, and --excludeMessages, which is useful when one app only consumes a subset of a larger Messagevisor project.
For sets-based projects, pass --set=<set> to generate against the same authored tree that will be built and deployed.

