Skip to content

Configure the Cratis Direct Agent Runner

Use Cratis Direct’s Runners settings to enroll, name and manage the runner. The local page shows its state and lets you pause, resume or disconnect it. Start-up settings control its address, ports and local policy.

The runner serves a page at http://127.0.0.1:7190 on its own machine only. Run direct-runner open as the same user who runs the daemon, then open the one-time address it prints within a minute. Opening the bare address does not authenticate you. Never share the one-time address. The page shows these connection states.

State What you see What you can do
Not connected Not connected Restart with an enrollment code.
Enrollment needed Enrollment requires a maintainer-created code Use code enrollment, not browser approval. Any active member can create a code for a runner that runs only their own work.
Connecting Connecting to Cratis Direct… Wait. The runner retries with a growing delay of up to one minute.
Connected Runner, Organization, Workers, Work (taking work or paused), Images (how many are allowed), Credentials (the credential store) and the Cratis Direct address Select Pause or Resume for new work, or disconnect the machine.
Not a runner any more A message that the credential expired or was revoked Enroll again with a new code.

Disconnect this machine makes the machine forget its identity so you can connect it again from scratch. It is shown in every state except Not connected. It does not remove the runner in Cratis Direct. Remove it under Settings → Runners for that.

In Cratis Direct, open Settings → Runners. The built-in Cratis Direct cluster is always listed first, followed by every enrolled runner. Each row shows:

  • A green dot when the runner is connected, and its machine, operating system and how many of its workers run.
  • Meters for the runner’s CPU, memory and the disk its workers use, as it last reported them.
  • Who the runner runs for, a pencil to rename it and a bin to remove it.

By default a runner takes work for everyone in the organization. To limit it, select the audience on the runner’s row (for example Everyone), pick the people, and select Save. Only work those people ask for runs on the runner. Pick nobody to run everyone’s work again.

This is how you keep a personal machine for your own work, or put a shared build machine at a team’s disposal.

Select Add runner, choose the kind of machine, optionally enter a name, choose how long the code stays valid and select Create code. Cratis Direct shows the code once. Any active member of the organization can create a code. A runner enrolled with a member’s code runs work only for that member and is enrolled with the minimal capability set; only a maintainer can enroll a runner with more. The person who created the code must stay an active member; when they are removed, the runner stops receiving work.

Codes that nobody has used yet are listed with the time left. Maintainers see every waiting code under Waiting for a machine, with who created it; members see their own. Select Revoke to stop one from working.

Treat the code like a password. Both --enroll <code> and install --enroll <code> expose it in process arguments and may leave it in shell history. Do not paste real codes into shared terminals, logs or notes. The DIRECT_RUNNER__Runner__EnrollmentCode environment variable avoids command-line arguments, but is not secret storage and may be visible to processes with sufficient access. Remove it from the environment after use. Only install persists a newly supplied code in the owner-only runner.json; a foreground run does not.

Select the pencil on the runner’s row, enter the new name and save. The name is only a label in Cratis Direct.

Select the bin on the runner’s row and confirm. This revokes its authority to receive new work. Do not use removal as a way to stop containers already on the machine. The local page shows Not a runner any more when the daemon receives an authentication refusal.

The runner keeps its settings in runner.json in its folder (see Where the runner keeps its files). It creates the file the first time it starts, with the settings it started with, and reads it on every start after that. Edit the file and restart the runner to change a setting, or pass it once as an argument or environment variable and the runner saves it. Enrollment codes are the exception: foreground arguments and environment codes are not persisted, as described above. The settings listed below are optional.

{
"Runner": {
"DirectUrl": "https://cratis.direct",
"InterfacePort": 7190,
"RelayPort": 7191,
"MaximumConcurrentWorkers": 0
}
}
Setting Default What it does
DirectUrl https://cratis.direct The Cratis Direct to connect to. Set this before enrollment.
InterfacePort 7190 The port of the local page.
RelayPort 7191 The port worker containers call back to Cratis Direct through.
MaximumConcurrentWorkers 0 How many workers run at once. 0 chooses a quarter of the logical cores, and at least one.
PausedDuring No scheduled pauses Local-time windows when no new work starts, such as Mon-Fri 08:00-18:00. See Share your machine.
DockerEndpoint Docker’s platform default The Docker endpoint, when it is not the default one, such as unix:///home/me/.docker/run/docker.sock.
EnrollmentCode none A single-use code created under Settings → Runners → Add runner. Used when no identity is saved. Set it with --enroll <code> or DIRECT_RUNNER__Runner__EnrollmentCode. A saved code is removed after success or permanent refusal; transient failures are retried.
Workers:AllowedImages Empty Exact digest-pinned worker images allowed locally. Empty refuses all workers. Use the repeatable --allow-image <repository@sha256:digest> option or configure the array in runner.json.
StateDirectory ~/.cratis/direct The folder the runner keeps its files in. Set it as an argument or environment variable only, since the runner reads the file from there.
SecretStore Auto Where the runner keeps its credentials: Auto, Keychain or File. Auto uses the Keychain on macOS and an owner-only file on Linux. Keychain is only available on macOS; elsewhere the runner refuses to start.
Reserve:Memory 2GiB Memory the runner keeps free for you. See Keep room for your own work.
Reserve:Disk 5GiB Free disk space the runner keeps on the volume its workers use.
Reserve:ClearMargin 10% of each reserve, at least 0.5 GiB How far above a reserve free space must rise before new work starts again.
Capabilities None What the machine offers workers. See Declare capabilities.
LocalSources None Repositories workers can use from this machine. See Offer local sources.
Models None Model servers on this machine that the runner serves to Cratis Direct. See Serve local models.
Mode Full Full runs workers and serves models. ModelsOnly, also set with --models-only, only serves models and needs no Docker.

A setting comes from the first of these that has it:

  1. A command-line argument, --Runner:InterfacePort=7290.
  2. An environment variable. Prefix the name with DIRECT_RUNNER__ and replace each : with __, as in DIRECT_RUNNER__Runner__InterfacePort=7290.
  3. runner.json.
  4. The default.
Terminal window
direct-runner --Runner:InterfacePort=7290 --Runner:MaximumConcurrentWorkers=2

The runner prints the address of the local page on start; use direct-runner open for authenticated access. The local page binds to loopback. The relay also binds to Docker’s bridge address on Linux so containers can reach it. Change a port when something else on your machine uses it.

The runner stops starting new workers when free memory, or free disk space on the volume its workers use, falls below its reserve. It starts new work again only when both rise above the reserve plus the clear margin.

Write each value as a number of bytes, as GiB (4GiB) or as a percentage of the machine’s total (10%). A reserve is never more than half of the total, and the point where work starts again is never more than halfway from the reserve to the total. When a value is not valid, the runner uses the default or the limit instead and prints a warning.

{
"Runner": {
"Reserve": {
"Memory": "4GiB",
"Disk": "10%"
}
}
}

Capabilities tells Cratis Direct what workers can use on this machine. These are claims, not credentials: the runner never sends a key or token. Cratis Direct places work on the runner only within the capability ceiling it was enrolled with.

Field What it holds
Harnesses The worker harnesses this machine can run: claude, pi, copilot, codex or opencode. See How work picks a provider, a harness and a runner.
LocalModels Models served on this machine, each with a Model name and an Endpoint that workers in Docker can reach. The endpoint must be http or https, with no user name, password or query.
Credentials Which kinds of credential are available, each with a Provider (Anthropic, OpenAI, AzureOpenAI, OpenAICompatible, ZAI, OpenAICodex or Copilot) and a Mode (api-key, oauth or subscription).
{
"Runner": {
"Capabilities": {
"Harnesses": ["claude"],
"LocalModels": [{ "Model": "example-model", "Endpoint": "http://host.docker.internal:11434" }],
"Credentials": [{ "Provider": "Anthropic", "Mode": "api-key" }]
}
}
}

Each list holds at most 32 entries. When a value is not valid, the runner refuses to start.

LocalSources lists repositories workers can use from this machine. Only each source’s alias is sent to Cratis Direct; paths and addresses stay on the machine.

Field What it holds
Alias The name Cratis Direct sees: up to 64 lowercase letters, digits, ., _ or -. Each alias must be unique.
Kind path for a repository on this machine, or remote for a repository address.
Root For path: an absolute folder that holds the repository. It cannot be a drive root, your home folder, or inside the runner’s state folder.
Path For path: the absolute repository folder inside Root. It must contain its own .git folder: not a linked worktree, a repository using alternates, or a symbolic link.
Remote For remote: an https or ssh address with no user name, password or query.
{
"Runner": {
"LocalSources": [
{ "Alias": "website", "Kind": "path", "Root": "/home/me/code", "Path": "/home/me/code/website" },
{ "Alias": "tools", "Kind": "remote", "Remote": "https://git.example.com/team/tools.git" }
]
}
}

The list holds at most 32 sources. When a source is not valid, the runner refuses to start.

The default state folder is ~/.cratis/direct. On macOS and Linux, newly created state files and the folder are owner-only. Keep them private even though the identity file no longer contains credentials.

File What it holds
runner.json The settings above.
pause.json A manual pause and when it began. direct-runner resume removes it.
identity.json Identity metadata and a reference to its credential store, not the secret token.
identity.secrets Credentials when the file store is used (the Linux default). Treat it like a password.
interface.token Secret used to authenticate the owning user to the local page. Never share it.
audit.jsonl One line per worker launch decision: the time, the runner and session ids, whether the launch was allowed or refused and why, the image digest and the credential store kind. It never holds secrets. At 5 MiB it rotates to audit.1.jsonl and so on; the runner keeps five files.

On macOS, credentials default to the user’s Keychain. Failure to use it does not silently fall back to a file. Treat all credential-store contents as secrets.

An older identity in the platform’s configuration folder (~/Library/Application Support/direct-runner on macOS or ~/.config/direct-runner on Linux) is migrated when no identity exists in the state folder. Older inline credentials are migrated into the credential store; migration can fail if that store is unavailable.

Use Disconnect this machine to forget the identity and remove its stored credentials. Deleting identity.json alone is not credential cleanup. Enrolling again requires a new code and creates a new runner in Cratis Direct.