> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prismy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub & GitLab — prismy generate

> Generate translations locally when using Prismy's native Git integration

Use **`prismy generate`** when Prismy is integrated with GitHub or GitLab. Prismy syncs your translation files and triggers translations via PR comments; `generate` lets you create translations locally during development.

## When to use

* Prismy is connected to your GitHub or GitLab repo
* You want to generate translations locally before committing
* You're on a feature branch and want to preview translations

<Note>
  Using **Prismy Hosted** without native Git? Use [prismy push & pull](/tech/cli/prismy-hosted) instead.
</Note>

## Installation & auth

```bash theme={null}
npm install -g prismy-cli
```

Set your API key (from [Prismy Settings](https://app.prismy.io/settings)):

```bash theme={null}
prismy auth <your-api-key>
# Show current key
prismy auth --show
# Reset
prismy auth --reset
```

## Basic usage

```bash theme={null}
prismy generate
```

Or simply:

```bash theme={null}
prismy
```

The CLI will:

* Detect your repo from git remotes
* Compare the current branch with the main branch
* Find new translation keys in changed files
* Generate translations for all configured languages
* Update your local translation files

No manual config is required; the CLI uses your Prismy repository settings (main branch, file paths, languages).

## Options

| Option          | Short | Description                                       |
| --------------- | ----- | ------------------------------------------------- |
| `--base-branch` | `-b`  | Base branch to compare against (default: main)    |
| `--repo-name`   | `-r`  | Repository name (when git remote detection fails) |

Examples:

```bash theme={null}
prismy generate --base-branch develop
prismy generate --repo-name my-project
prismy generate -b develop -r my-project
```

## Typical workflow

```bash theme={null}
git checkout -b feature/new-translations
# ... add new translation keys in your code ...
prismy generate
git add .
git commit -m "Add translations for new features"
```

## Integration with GitHub/GitLab

1. **Development**: Use `prismy generate` locally to preview translations.
2. **Pull requests**: Prismy detects missing translations and can comment on PRs.
3. **CI**: Prismy syncs files; translations can be triggered via PR comments. No manual push/pull of files.

Reference: [prismy-cli docs — PRISMY\_GENERATE](https://github.com/TheCompanyX/prismy-cli/blob/main/docs/PRISMY_GENERATE.md)
