@frontitude/cli v1.0.21
Frontitude CLI
The Frontitude CLI enables you to integrate your code with Frontitude, thus creating a single source of truth for your product copy, from design to development.
With this CLI, developers can pull latest string (aka UX copy) versions from your Frontitude workspace into the codebase to stay up to date effortlessly, and integrate it with any i18n framework (e.g. i18next, react-i18next, etc.).
Requirements
- A (free) Frontitude account
- Enabled Developer CLI integration in your account settings
- Installed Node.js (>= 14 LTS)
Installation
You can install the Frontitude CLI globally via NPM or Yarn:
npm install -g @frontitude/cli
# or
yarn global add @frontitude/cli
Or locally:
npm install --save-dev @frontitude/cli
# or
yarn add --dev @frontitude/cli
Authentication
To connect the CLI with your Frontitude account, you will need to provide a valid authentication.
Choose one of the next options according to your use case:
- Personal access token (OAuth 2.0 authentication using Google/Microsoft Azure/SAML SSO) - Use this option when you want to try the CLI or pull copy changes manually.
- Workspace-level access token - Use this option when you want to use the CLI in your CI/CD pipeline.
Personal access token
Frontitude CLI supports OAuth 2.0 authentication (using Google/Microsoft Azure/SAML SSO) via your default browser to automatically generate your personal access token.
To initiate the authentication process:
frontitude login
To remove your generated personal access token:
frontitude logout
Workspace-level access token
Create your workspace-level access token from your account settings, under the Developer CLI integration. Once created, continue to run the next commands in the CLI.
To configure your workspace-level access token:
frontitude config set access-token <your-token>
To remove your workspace-level access token:
frontitude config del access-token
Getting started
To get started in no time, the init
command will walk you through the basic commands to help you set the string sources that you would like to connect to your codebase, and the output file location (existing or a newly created one).
To initialize the CLI, run the next command and follow its guidelines:
frontitude init
Usage
Connect string sources to your codebase
Connecting string sources (Frontitude projects or the copy library) to your codebase will let you to pull their latest copy into your codebase and stay up to date effortlessly.
To set the sources that you would like to connect to your codebase, run the next command and use the checkbox selection:
frontitude source set
To view the list of connected sources:
frontitude source list
Pull the latest copy into your codebase
After setting the sources that you would like to connect to your codebase, you will be able to pull their latest copy directly to the configured output file, that later can be consumed in your codebase using any i18n framework of your choice (e.g. i18next, react-i18next, etc.), or directly (using require/import).
To pull the latest copy from your connected sources:
frontitude pull
Options:
Name | Default | Description |
---|---|---|
--flat | true (Can’t be changed for now) | The output file will be flat formatted, containing key-value pairs, where each value is a string. |
--status | all | Available statuses: draft/review/final/all. |
--has-key | false | By default, all the copy is being pulled into the codebase, and copy without a key is set with Frontitude’s auto-generated id (non human-readable). Use this flag to pull only copy that has a key. |
--tags | '' | Pull copy by tags. Specify comma-separated tag names string to filter copy (AND relation). |
--include-metadata | false | Include metadata for each text, such as tags, status, note, mixed style indication, and more. |
--include-translations | false | Include latest translations. Each locale is saved to a dedicated file, in the same location as the source file. The locale will be concatenated to the file’s name as part of the extension. E.g. ./strings.es.json |
--dry-run | false | Display the results in the CLI without creating or updating the files. |
--access-token | Authenticate the pull request using this access token, taking precedence over any other configured access token. |
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 support@frontitude.com.
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
10 months ago
10 months ago
10 months ago
6 months ago
6 months ago
7 months ago
8 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago