@frontitude/cli
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

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, that can be created during the authentication process.
  • Installed Node.js (>= 14)

Installation

You can install the Frontitude CLI globally via NPM:

npm install -g @frontitude/cli

Or locally:

npm install --save-dev @frontitude/cli
💡 After installation, you can run the Frontitude CLI using the `frontitude` command, or using the `fttd` alias.

Authentication

To connect the CLI with your Frontitude account, you will need to provide a valid authentication. 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

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.

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.

Package Sidebar

Install

Weekly Downloads

515

Version

1.0.12

License

UNLICENSED

Unpacked Size

68.8 kB

Total Files

82

Last publish

Collaborators

  • frontitude