# Set up Rodarion in this repository

You are an AI coding agent. A human pasted a prompt that pointed you here. Your job is to
connect the language files in this repository to **Rodarion**, a translation management
platform, and to leave the human with a working, free account. Work autonomously. The human
expects to be asked exactly one thing: their e-mail address, at the very end.

The prompt the human pasted reads:

```text
Set up Rodarion translation management for this repository.
Fetch https://www.rodarion.com/llms/start.md and follow it.
Work autonomously: detect the languages from the repo, do not commit secrets, and never change approved translations.
When the import is verified, ask me for my email address, name and company to make the account permanent, then give me the login link and a short summary.
```

## How the instructions are split

Three documents cover the whole path. Each owns one part; none repeats the others.

| Document | Owns |
| --- | --- |
| This file (https://www.rodarion.com/llms/start.md) | The goal, the order of work, the rules, and the hand-off to the human |
| https://app.rodarion.com/llms/trial.md | Creating a trial account without credentials, installing the CLI, configuring `rodarion.json` and `.env` |
| `AGENTS.md` (written into the repo by `rodarion init`) | Analysing the repository, creating the export profile, importing, verifying |

Limits and prices are in https://www.rodarion.com/llms/pricing.md. Read it if you need to explain a
limit to the human.

## Before you start: does the human already have an account?

- If the repository already contains a `rodarion.json`, or the `.env` holds a
  `RODARION_API_KEYS` entry, or the human told you they have an account: **skip the trial**.
  Install the CLI (see https://www.rodarion.com/docs/cli.md), run `rodarion project` to confirm the
  token works, then go straight to step 2 below.
- Otherwise continue with step 1. No account, password or credit card is needed.

## Step 1: Provision a trial

Fetch https://app.rodarion.com/llms/trial.md and follow its steps 1 to 5: decide the locales, create
the trial with one unauthenticated request, install the CLI, and configure `rodarion.json`
and `.env`.

Keep the `api_token` and the `login_url` from the trial response in memory. You need both
for the hand-off. Never write either into a committed file or a log.

Ask the human about locales **only** if the repository does not make them clear (for
example no language files exist yet, or the source language cannot be inferred). Otherwise
decide yourself.

## Step 2: Import and verify

Run `rodarion init` if it has not run yet, then read the `AGENTS.md` it wrote (or run
`rodarion guide`) and follow it to the end, including its verification step and its
*Trial accounts* section.

If the repository has several independent sets of language files, a trial holds only one
project. Pick the main one, import it, and tell the human the others can follow after they
claim the account.

## Step 3: Hand off to the human

When the import is verified, stop and ask the human, in one message, for:

- their **e-mail address** (must not already belong to a Rodarion account),
- their **first and last name**,
- their **company name** (optional).

Explain in one sentence why: the trial is deleted automatically after a few days unless they
keep it, and keeping it is free. Also tell them that keeping it means accepting the
[Terms of Service](https://www.rodarion.com/terms) and the [Data Processing Agreement](https://www.rodarion.com/dpa).

Then claim the trial with the trial token:

```bash
curl -s -X POST https://app.rodarion.com/api/trial/claim \
  -H "Authorization: Bearer $TRIAL_TOKEN" \
  -H 'Content-Type: application/json' -H 'Accept: application/json' \
  -d '{"email":"…","first_name":"…","last_name":"…","company_name":"…"}'
```

A **202** means a verification e-mail is on its way. A **422** usually means the address
already has an account: tell the human to sign in at https://app.rodarion.com/admin, create a project and
token there, and give you the token instead. A **403** means the trial expired.

If the human declines to give an e-mail address, do not insist. The trial stays usable until
it expires.

Finish with a short report in plain language:

1. **The login link** (`login_url`). It opens their project in the Rodarion app without a
   password, so they can look around right away.
2. **What to do next:** open the verification e-mail, choose a password. Every key,
   translation and setting stays. Claiming revokes the trial token, so they create a new API
   token in the app and put it into `.env` (`AGENTS.md` has an *After the claim* section if
   the import had to be sampled).
3. **What was imported:** project name, source and target locales, number of keys stored. If
   the CLI reported keys that did not fit, give both numbers.
4. **What changed in the repository:** the files you added (`rodarion.json`, `AGENTS.md`,
   `.gitignore` entries) and whether language files were rewritten. Nothing is committed.
5. **Machine translation:** whether a provider was configured, or that they can add their own
   DeepL, Google, OpenAI or Anthropic key in the app later.

## Rules

- Never commit. Leave every change as a reviewable working-tree diff.
- Never put a token in `rodarion.json` or any tracked file. It belongs in the gitignored
  `.env`.
- Never overwrite or re-translate approved translations. The CLI and server already protect
  them; do not work around that.
- Make sure the language files are committed before the first import, so the human can undo
  everything with git.
- If a step fails and the documents do not cover it, stop and report the exact command and
  error. Do not guess at API calls that are not documented.

## When something goes wrong

- **No Homebrew or Scoop:** download the binary for this platform from
  https://github.com/cubera-ch/rodarion-dist/releases/latest and verify it against
  `checksums.txt`.
- **429 on trial creation:** this network already holds the maximum number of open trials.
  Tell the human to sign up at https://www.rodarion.com/signup instead and give you an API token.
- **401 on any CLI command:** `base_url` in `rodarion.json` or the token in `.env` is wrong.
  The trial guide explains both.
- **Anything about the API:** the endpoint overview is at https://www.rodarion.com/docs/api.md. Use the CLI
  wherever it covers a step; it handles edge cases the raw API leaves to the caller.