---
source: https://cli.eloqnt.dev/docs/cli/extract
docs_index: https://cli.eloqnt.dev/llms.txt
---

# eloqnt extract

Write the messages that your source code uses to your messages files.

```console
$ eloqnt extract

messages/
  en.json  Updated
  de.json  Updated

✔ Extracted 12 messages
```

For apps that use [`useExtracted`](https://next-intl.dev/docs/usage/extraction) from `next-intl`, `eloqnt extract` reads the messages from the files in [`srcPath`](https://cli.eloqnt.dev/docs/configuration#srcPath) and writes them to the source locale’s messages file.

If a new message is discovered, then target locales will register it as an empty string. If a message is no longer used in code, it will be removed from all messages files.

If a source file can’t be parsed, no messages files are written.

## Flags

| Flag | Type | Description |
| --- | --- | --- |
| `--config` | `string` | Path to the eloqnt config file (defaults to .eloqnt/config.{ts,mts,js,mjs}) |
| `--json` | `boolean` | Output the result as JSON |

---

For an index of every eloqnt/cli documentation page, see [https://cli.eloqnt.dev/llms.txt](https://cli.eloqnt.dev/llms.txt).
