eloqnt/cli
eloqnt review
Uses AICatch typos, grammar slips and inconsistent terminology in your source strings before they fan out into all your translations.
By default, a run reviews every string that doesn’t have a translation yet, which is the same set that a translation run picks up. To review a given string again, you can use the --id flag.
How it works
Each invocation passes through five steps:
Context enrichment
Your messages hold a set of strings, but they typically lack context on how they’re used:
messages/en.json
{"7HMn4v": "Invite to your team space",...}
Without additional information, it’s hard to tell:
- Where this string is used
- What kind of UI component it’s used for
- What "your team space" refers to
- If a term like "team space" matches the rest of your app
- If it matches the typographic guidelines of your app
If you have srcPath configured, the CLI will analyze your code and extract a simplified source outline that keeps the relevant parts around each string:
src/app/workspace/MembersHeader.tsx
⋮│ export default function MembersHeader() {│ const t = useExtracted();│ return (│ <header>⋮│ <Button>█ {t('Invite to your team space')}│ </Button>⋮
This provides clear answers to the first three questions raised above:
- It’s used in a component called
MembersHeader - It’s the label of a button
- "Your team space" is the workspace this page belongs to
Styleguides
Next, all applicable styleguides are attached to the request:
- Your global styleguide, defining the terminology of your project
- The styleguide of your source locale, holding explicit rules for your source strings
.eloqnt/styleguide.md
...## Terminology- "workspace": The place where a team keeps its projects...
.eloqnt/styleguide.en.md
...## Capitalization- Menu items, button labels, and alert titles use Title Case.- All other UI text uses sentence case.
With this, we can answer the remaining questions from above:
- The term "workspace" should be used instead
- As it’s a button label, it should be written in Title Case
It’s recommended to restrict yourself to mechanical rules in the styleguide of your source locale, like typography and capitalization. Instructions about tone could cause your source strings to be rewritten unexpectedly.
Review
With all context now available, the following is passed to an LLM:
- Your source strings
- Source outlines
- Styleguides
- General guidelines on what a review may change
The LLM is asked to only fix objective errors:
- Are there misspellings or typos?
- Are there grammatical errors?
- Does a string deviate from a styleguide term?
Since the UI component is available as context, your styleguide can scope certain rules to only affect a specific set of use cases.
Depending on your plan, the actual review work either happens on our hosted backend or is delegated to your own model.
Post-checks
Once the LLM returns, every suggested fix has to pass various quality checks, like:
- Does the fix actually change the string?
- Are there syntactical errors?
- Do arguments like
{name}still match the original?
If a fix doesn’t meet the bar yet, then the review step is retried with the findings attached, and with increased reasoning effort. A fix that still fails is discarded, and your string stays as it is.
Persistence
Finally, the fixes are written to your source messages:
messages/en.json
{- "7HMn4v": "Invite to your team space",+ "XnhtPl": "Invite to Your Workspace",...}
If you’re writing your strings inline with useExtracted from next-intl and have srcPath configured, then the call site in your code is fixed too:
src/app/workspace/MembersHeader.tsx
<Button>- {t('Invite to your team space')}+ {t('Invite to Your Workspace')}</Button>
If a fixed string already had translations, they’re removed as stale and the next eloqnt translate fills them back in.
Good to know
Usage with coding agents
If a coding agent writes your source strings, then point it to your styleguides and let it run eloqnt review before committing.
An instruction like this is typically enough:
AGENTS.md
## UI text- When writing UI text, follow `.eloqnt/styleguide.md` and `.eloqnt/styleguide.en.md`.- Before committing, run `npx eloqnt review`.
Alternatively, you can systematically review your source strings in a CI job (see GitHub Actions).
Flags
| --id | string | (Re-)review these message ids (comma-separated) |
| --config | string | Path to the eloqnt config file (defaults to .eloqnt/config.{ts,mts,js,mjs}) |
| --json | boolean | Output the result as JSON |