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

# Quick Start

> Get started with glot in 2 minutes

Get up and running with glot in just a few steps.

## Installation

Glot is distributed as an npm package called `glotctl`. The CLI command is `glot`.

<CodeGroup>
  ```bash npm theme={null}
  npm install -D glotctl
  ```

  ```bash pnpm theme={null}
  pnpm add -D glotctl
  ```

  ```bash yarn theme={null}
  yarn add -D glotctl
  ```

  ```bash bun theme={null}
  bun add -D glotctl
  ```
</CodeGroup>

Verify the installation:

<CodeGroup>
  ```bash npm theme={null}
  npx glot --version
  ```

  ```bash pnpm theme={null}
  pnpm exec glot --version
  ```

  ```bash yarn theme={null}
  yarn glot --version
  ```

  ```bash bun theme={null}
  bunx glot --version
  ```
</CodeGroup>

## Initialize Configuration

Create a `.glotrc.json` configuration file:

<CodeGroup>
  ```bash npm theme={null}
  npx glot init
  ```

  ```bash pnpm theme={null}
  pnpm exec glot init
  ```

  ```bash yarn theme={null}
  yarn glot init
  ```

  ```bash bun theme={null}
  bunx glot init
  ```
</CodeGroup>

This creates a default configuration:

```json theme={null}
{
  "primaryLocale": "en",
  "messagesRoot": "./messages",
  "sourceRoot": "./",
  "includes": [
    "src/app/[locale]",
    "src/components",
    "app/[locale]",
    "components"
  ],
  "ignores": [],
  "ignoreTestFiles": true,
  "ignoreTexts": [],
  "checkedAttributes": [
    "placeholder",
    "title",
    "alt",
    "aria-label",
    "aria-description",
    "aria-placeholder",
    "aria-roledescription",
    "aria-valuetext"
  ]
}
```

<Tip>
  Adjust the `includes` paths to match your project structure. Glot will only
  scan these directories.
</Tip>

## Run Your First Check

Check your project for all i18n issues:

<CodeGroup>
  ```bash npm theme={null}
  npx glot check
  ```

  ```bash pnpm theme={null}
  pnpm exec glot check
  ```

  ```bash yarn theme={null}
  yarn glot check
  ```

  ```bash bun theme={null}
  bunx glot check
  ```
</CodeGroup>

Or check for specific issue types:

| Type                                      | Description                                       |
| ----------------------------------------- | ------------------------------------------------- |
| [hardcoded](/detection/hardcoded-text)    | Untranslated text in JSX/TSX                      |
| [missing](/detection/missing-keys)        | Keys used but not defined in locale files         |
| [unused](/detection/unused-keys)          | Keys in primary locale not used in code           |
| [orphan](/detection/orphan-keys)          | Keys in non-primary locales but not in primary    |
| [replica-lag](/detection/replica-lag)     | Keys in primary locale missing from other locales |
| [untranslated](/detection/untranslated)   | Values identical to primary locale                |
| [type-mismatch](/detection/type-mismatch) | Type conflicts between locales                    |
| [unresolved](/detection/unresolved-keys)  | Dynamic keys that cannot be analyzed              |

<CodeGroup>
  ```bash npm theme={null}
  # Only hardcoded text
  npx glot check hardcoded

  # Only missing translation keys
  npx glot check missing

  # Multiple specific checks
  npx glot check hardcoded missing unused
  ```

  ```bash pnpm theme={null}
  # Only hardcoded text
  pnpm exec glot check hardcoded

  # Only missing translation keys
  pnpm exec glot check missing

  # Multiple specific checks
  pnpm exec glot check hardcoded missing unused
  ```

  ```bash yarn theme={null}
  # Only hardcoded text
  yarn glot check hardcoded

  # Only missing translation keys
  yarn glot check missing

  # Multiple specific checks
  yarn glot check hardcoded missing unused
  ```

  ```bash bun theme={null}
  # Only hardcoded text
  bunx glot check hardcoded

  # Only missing translation keys
  bunx glot check missing

  # Multiple specific checks
  bunx glot check hardcoded missing unused
  ```
</CodeGroup>

## Understanding the Output

Glot displays issues in a familiar format:

```
error: "Submit"  hardcoded-text
  --> ./src/components/Button.tsx:5:22
  |
5 |     return <button>Submit</button>;
  |                    ^

error: "Enter your email"  hardcoded-text
  --> ./src/components/Form.tsx:12:28
   |
12 |     <input placeholder="Enter your email" />
   |                        ^

✘ 2 problems (2 errors, 0 warnings)
```

Each issue shows:

* The problematic text in quotes
* The issue type (e.g., `hardcoded-text`)
* File path and location
* Source code context with a pointer

## Existing Projects

If your project already has many hardcoded strings, use the [baseline command](/commands/baseline) to suppress existing warnings and start fresh:

```bash theme={null}
npx glot baseline --apply
```

This inserts `// glot-disable-next-line` comments above each hardcoded text, so you can add glot to CI immediately and gradually fix existing issues over time.

<Tip>
  If your project uses dynamic translation keys like ``t(`items.${type}`)``, use [glot fix](/commands/fix) to auto-insert `glot-message-keys` declarations.
</Tip>

## Fixing Issues

Replace hardcoded text with translation function calls:

<CodeGroup>
  ```tsx Before theme={null}
  export function Button() {
    return <button>Submit</button>;
  }
  ```

  ```tsx After theme={null}
  import { useTranslations } from "next-intl";

  export function Button() {
    const t = useTranslations("common");
    return <button>{t("submit")}</button>;
  }
  ```
</CodeGroup>

Then add the key to your locale file:

```json messages/en.json theme={null}
{
  "common": {
    "submit": "Submit"
  }
}
```

## Add to package.json

For convenience, add glot commands to your `package.json`:

```json theme={null}
{
  "scripts": {
    "i18n:check": "glot check",
    "i18n:clean": "glot clean --apply"
  }
}
```

## Using with CI

Glot returns exit code 1 when errors are found (exit 0 for warnings only), making it ideal for CI pipelines. Add a step to your workflow:

```bash theme={null}
npx glot check
```

See [Check Command — Severity](/commands/check#severity) for which check types are errors vs warnings, and [Check Command — CI Examples](/commands/check#ci-examples) for full GitHub Actions examples.

## Next Steps

<CardGroup cols={2}>
  <Card title="Commands" icon="terminal" href="/commands/check">
    Learn all available commands
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration">
    Customize glot for your project
  </Card>
</CardGroup>
