> For the complete documentation index, see [llms.txt](https://developer.frontitude.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.frontitude.com/developer-cli/commands.md).

# Commands

## Initialization

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 the instructions:

```bash
$ frontitude init
```

## Connect to data source

Connecting string sources (Frontitude **projects**, **project folders**, 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:

```bash
$ frontitude source set
```

To view the list of connected sources:

```bash
$ frontitude source list
```

## Pull

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](https://www.i18next.com/), [react-i18next](https://react.i18next.com/), etc.), or directly (using require/import).

To pull the latest copy from your connected sources:

```bash
$ frontitude pull
```

Options:

| Name                     | Default | Description                                                                                                                                                                                                                                                |
| ------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--nested`               | `false` | *Applicable for JSON format only.* By default, content is pulled in a flat format. Setting this option to `true` will output the content in a nested structure, where keys are broken into namespaces according to the workspace key convention delimiter. |
| `--status`               | `all`   | Available statuses: draft/review/final/all.                                                                                                                                                                                                                |
| `--has-key`              | `false` | Use this flag to pull only content that has been assigned keys. By default, content without keys is assigned auto-generated, non-human-readable IDs.                                                                                                       |
| `--tags`                 | `''`    | Pull content by tags. Specify comma-separated tag names string to filter copy (AND relation).                                                                                                                                                              |
| `--include-metadata`     | `false` | Wrap each text in an object carrying its tags, status, note, and source metadata. See [Metadata fields](#metadata-fields) below for the full list.                                                                                                         |
| `--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 any files.                                                                                                                                                                                     |
| `--access-token`         |         | Authenticate the pull request using this access token, taking precedence over any other configured access token.                                                                                                                                           |
| `--pages`                |         | Filter content by Frontitude pages from your connected projects. Specify a comma-separated page names string to filter content (OR relation). **Applicable only when the source is a project.**                                                            |
| `--screens`              |         | Filter content by Frontitude screens from your connected projects. Specify a comma-separated screen names string to filter content (OR relation). **Applicable only when the source is a project.**                                                        |

### Metadata fields

When `--include-metadata` is set, each text in the pulled JSON becomes an object instead of a bare string. The exact set of fields depends on the source the text was pulled from.

#### Texts pulled from a project or project folder

These texts are backed by a Figma design layer, so they carry the design-hierarchy and Figma identifiers. Every field below is always present; a field is `null` when the underlying source is empty (for example, a text that is not an instance of a library component has `parentComponentId: null`).

| Field               | Description                                                                                                                                                                          |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `value`             | The source-locale string for this text.                                                                                                                                              |
| `isMixedStyle`      | `true` when the source text mixes inline styles in Figma (bold runs, links, colored spans); `false` otherwise.                                                                       |
| `tags`              | Array of tag names applied to the text in Frontitude.                                                                                                                                |
| `status`            | Workflow status of the text: `New`, `Draft`, `Review`, or `Final`.                                                                                                                   |
| `note`              | Free-text note attached to the text in Frontitude.                                                                                                                                   |
| `updatedAt`         | ISO timestamp of the most recent revision to the text.                                                                                                                               |
| `lastEditedBy`      | Display name of the collaborator who authored the most recent revision.                                                                                                              |
| `frontitudeLink`    | Direct URL to open the text in the Frontitude editor.                                                                                                                                |
| `mergedTextId`      | Identifier used to group duplicate texts in the merged JSON output. For instances of a library component, equals `parentComponentId`; for any other text, a unique value of its own. |
| `projectId`         | Frontitude project the text belongs to.                                                                                                                                              |
| `figmaFileId`       | Figma file ID of the design file the project is linked to.                                                                                                                           |
| `pageId`            | Frontitude page the source text layer sits on.                                                                                                                                       |
| `figmaPageId`       | Figma page ID of the page the source text layer sits on.                                                                                                                             |
| `frameId`           | Frontitude frame the source text layer sits on.                                                                                                                                      |
| `figmaFrameId`      | Figma frame ID of the frame the source text layer sits on.                                                                                                                           |
| `figmaTextNodeId`   | Figma node ID of the source text layer itself.                                                                                                                                       |
| `parentComponentId` | ID of the Frontitude library component this text is an instance of, when the text is linked to a component.                                                                          |

#### Texts pulled from the copy library

Copy-library texts are not tied to a specific layer in a design, so they do not carry the Figma or design-hierarchy identifiers above. Instead they expose the library component's own identity.

| Field            | Description                                                                                                       |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| `id`             | ID of the library component.                                                                                      |
| `name`           | Full path of the component in the copy library.                                                                   |
| `value`          | The source-locale string for this text.                                                                           |
| `uniqueKey`      | The component's key, when one is assigned.                                                                        |
| `tags`           | Array of tag names applied to the component.                                                                      |
| `status`         | Workflow status of the text: `New`, `Draft`, `Review`, or `Final`.                                                |
| `note`           | Free-text note attached to the component.                                                                         |
| `updatedAt`      | ISO timestamp of the most recent revision.                                                                        |
| `lastEditedBy`   | Display name of the collaborator who authored the most recent revision.                                           |
| `frontitudeLink` | Direct URL to open the component in the Frontitude copy library.                                                  |
| `pluralId`       | Plural form id of the text's selected form (`zero`/`one`/`two`/`few`/`many`/`other`); empty for non-plural texts. |

#### Plural texts

In either shape, a plural text carries one additional field, `plurals`: an object mapping each plural form (`zero`, `one`, `two`, `few`, `many`, `other`) to its variant's value. The top-level `value` field holds the source/selected plural form's value.

## Push

{% hint style="info" %}
Available from CLI version 1.3.0 and above.
{% endhint %}

Push new strings from your local source-locale file into the Frontitude copy library. Only **new unique keys create new components**. Any key that already exists in Frontitude is skipped and left unchanged. No existing content is ever modified.

```bash
$ frontitude push
```

By default, the CLI shows a preview of what would be created and asks for confirmation before writing anything. To skip the prompt, pass `--non-interactive` or set `CI=true` in your environment.

To inspect what would be pushed without making any changes:

```bash
$ frontitude push --dry-run
```

Options:

| Name                | Default | Description                                                                                                                                                                 |
| ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--dry-run`         | `false` | Inspect what would be pushed without writing anything. Prints the list of new keys and the count of already-existing keys that would be skipped.                            |
| `--tag`             |         | Comma-separated tag names to apply to newly-created components (e.g. `--tag onboarding,checkout`). Existing components are not retagged.                                    |
| `--message`         |         | Attach a message to this push, visible in the Frontitude activity log. Use `@<email>` to notify a workspace teammate (e.g. `--message "@alice@example.com please review"`). |
| `--non-interactive` | `false` | Skip the dry-run preview and confirmation prompt. Auto-detected when stdin is not a TTY or `CI=true` is set.                                                                |
| `--access-token`    |         | Authenticate the push request using this access token, taking precedence over any other configured access token.                                                            |

## Using command aliases

To make it easier to run long commands in web projects, you can use the [scripts section in your package.json](https://docs.npmjs.com/cli/v11/using-npm/scripts).

Here’s an example of a command you can add:

```json
"scripts": {
  "pull-copy": "frontitude pull --has-key --tags=Repo1"
}
```

This allows you to run the following command to fetch content from Frontitude:

```sh
npm run pull-copy
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.frontitude.com/developer-cli/commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
