TolkBot for coding agents

A translation CLI your coding agent can run.

Your agent adds strings to the base file, runs npx tolkbot translate --all and commits every language with the feature. Nothing prompts, every command answers in JSON, and validate checks the files offline.

14 days free. Starting takes a card. From $9 a month + VAT after that.

AGENTS.mdtolkbot init writes this
## Translations

TolkBot translates this project. Run its commands in the directory that holds tolkbot.json.

- Add new strings to the base locale file only. Never write the other locale files by hand.
- After changing strings, run npx tolkbot status and npx tolkbot translate --all, then npx tolkbot validate before committing.
- To correct a translation, run npx tolkbot set <key> --locale <locale> --value "<text>" --learn "<why>". TolkBot keeps the value and learns from the note.
- Leave every key alone that npx tolkbot status --keys lists as held by a person.
- More: https://docs.tolkbot.ai/docs/for-agents
$ npx tolkbot translate --allexit 0
{
  "srcLocale": "en",
  "languages": [
    {
      "dstLocale": "nb",
      "status": "succeeded",
      "keys": 11,
      "failed": 0,
      "written": { "files": 1, "keys": 11 },
      …
    }
  ]
}

What TolkBot does for an agent

Nothing prompts

Without a terminal each command takes its defaults, and init acts as if --yes was given. No command waits for input.

JSON on stdout, the rest on stderr

Every command with --json prints it unasked. Warnings and anything a child process prints go to stderr, so stdout always parses.

The rules stay with TolkBot

The agent never sees the glossary or the learnings. translate applies them, with translation memory, the same way the GitHub App does.

Corrections that stick

tolkbot set writes a value, checks its placeholders and records it as a person’s. --learn saves why, for every later translation.

A person's keys stay theirs

A key someone locked, or has a draft for in the dashboard, is left out of translate. status --keys lists them under heldByPerson.

Validate runs offline

validate needs no login and no network, so it runs in a sandboxed session and in CI, and exits 1 on a dropped placeholder.

Set it up

  1. Connect the repo

    Sign in with GitHub, start the trial and install the GitHub App on the repository.

  2. Log in and run init

    npx tolkbot auth login, then npx tolkbot init. It finds the framework and the locale files, and offers to add the block to AGENTS.md. In CI, set TOLKBOT_TOKEN.

  3. Let the agent run the loop

    status, translate --all, validate, then commit the locale files with the rest of the change.

Output an agent can act on.

Without a terminal, stdout holds the JSON result and nothing else. A failure goes to stderr in one shape, with a code that is added to and never renamed, and an exit code that says which kind of failure it was.

stderrexit 3
{
  "error": {
    "code": "not_authenticated",
    "message": "Not logged in.",
    "hint": "Run 'tolkbot auth login', or set $TOLKBOT_TOKEN for CI."
  }
}
ExitMeaningFor example
0Success
1It ran, and the result is a failurevalidation_failed
2Usage, or a choice to makeusage
3Not logged in, or not allowedtoken_expired
4Billingout_of_credits
5Could not reach TolkBotnetwork
Do I need the CLI if pull requests are automatic?
Not to get translations: the agent adds strings and pushes, and TolkBot opens the pull request. Run the CLI when the translations belong in the same pull request as the feature, or to check what the agent wrote.
Can the agent log in by itself?
It can start the login. Without a terminal, tolkbot auth login prints the URL and a verification code as plain lines for the agent to pass to you.
Can the agent overwrite a translation someone fixed?
Not through translate, which leaves out every key a person holds. A value written with tolkbot set is kept until its source text changes.

Let the agent add the keys. TolkBot keeps them consistent.

14 days free. Starting takes a card. From $9 a month + VAT after that.