@frontitude/cli
v1.5.0
Published
The Frontitude CLI enables product teams to integrate their code with Frontitude (frontitude.com), thus creating a single source of truth for their product copy, from design to development.
Downloads
4,836
Maintainers
Readme
Frontitude Developer CLI
The Developer CLI enables you to integrate your codebase with Frontitude to create a true single source for your UX content, from design to development.
Developers can use this tool to effortlessly pull the latest strings from your Frontitude workspace into the codebase, and push new keys from the codebase up to Frontitude as text components for the copy team to refine.
It works seamlessly with any i18n framework that supports the i18next standard, facilitating quick and easy integration with your existing code.
Requirements
- Enabled Developer CLI integration in your workspace settings
- Access token from your Frontitude workspace
- Installed Node.js >= 18 (For Node.js 14 LTS through 17, use CLI version 1.0.24)
Installation
You can install the Frontitude CLI globally via NPM or Yarn:
npm install -g @frontitude/cli
# or
yarn global add @frontitude/cliOr locally:
npm install --save-dev @frontitude/cli
# or
yarn add --dev @frontitude/cliWorking with multiple config files
By default the CLI reads frontituderc.json from the directory you run it in. The --config <path> flag points it at a different rc file instead — the path can be absolute or relative, and it works on every command (pull, push, init, …).
Relative filePath values inside the rc are resolved against the rc file's own directory, so --config behaves exactly as if you had changed into that directory before running the CLI. Each invocation uses exactly one rc file; to drive several, run the CLI once per file and let an npm script or a shell loop handle the orchestration.
Monorepo: one install, many packages
Install the CLI once at the repo root and give each package its own rc file (packages/<name>/frontituderc.json). A root npm script can then pull or push every package in one command:
{
"scripts": {
"i18n:pull:web": "frontitude pull --config packages/web/frontituderc.json",
"i18n:pull:mobile": "frontitude pull --config packages/mobile/frontituderc.json",
"i18n:pull:admin": "frontitude pull --config packages/admin/frontituderc.json",
"i18n:pull": "npm run i18n:pull:web && npm run i18n:pull:mobile && npm run i18n:pull:admin"
}
}Multiple config profiles in one project
The same mechanism lets a single project keep several strings files side by side — for example a workspace-level library alongside a project-scoped file, or one file per project. Create an rc file per profile and point --config at each in turn:
{
"scripts": {
"i18n:pull:library": "frontitude pull --config frontituderc.library.json",
"i18n:pull:app": "frontitude pull --config frontituderc.app.json",
"i18n:pull": "npm run i18n:pull:library && npm run i18n:pull:app"
}
}Sibling rc files in the same directory are fully independent — they can target different projects, the workspace library, or different output files without interfering with each other.
Documentation
Please refer to the Frontitude Developer Docs for detailed information on how to use the CLI and other developer tools.
Example repositories
- Frontitodo - A demo todo app, demonstrating string management with Frontitude's developer tools and how to integrate the CLI output with React-i18next. Follow the installation steps to see it in action, from design to development.
Contact us
We'd love to hear from you! For any feedback or support, contact us at [email protected].
