1.0.21 • Published 4 months ago

@frontitude/cli v1.0.21

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
4 months ago

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

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:

  1. 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.
  2. 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:

NameDefaultDescription
--flattrue (Can’t be changed for now)The output file will be flat formatted, containing key-value pairs, where each value is a string.
--statusallAvailable statuses: draft/review/final/all.
--has-keyfalseBy 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-metadatafalseInclude metadata for each text, such as tags, status, note, mixed style indication, and more.
--include-translationsfalseInclude 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-runfalseDisplay the results in the CLI without creating or updating the files.
--access-tokenAuthenticate 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.

1.0.21

4 months ago

1.0.20

5 months ago

1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

6 months ago

1.0.9

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

7 months ago

1.0.12

8 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

2 years ago

0.9.6

2 years ago

1.0.3

1 year ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.5

2 years ago

0.8.4

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.9.2

2 years ago

0.8.3

2 years ago

0.9.1

2 years ago

0.8.2

2 years ago

0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago