Skip to content
[ erkle ]
sign inSign up

How to connect AI coding agents on remote machines without a browser

An agent's usual sign-in opens a browser on the machine it runs on. On a CI runner, a cloud VM, a dev container, or a box you reach over SSH, there is no browser to open, so the agents on that machine use an API key instead.

The Erkle CLI makes that key from the machine itself. erkle login prints a link and a code that you approve on any device, such as your phone. Then erkle keys create makes a key limited to the projects that machine needs, read-only unless you say otherwise, that expires on its own. The agents read it from an environment variable, so it is never written into a config file.

// facts checked

build-box · ssh$ erkle logincodeKM7Q-R4TXremote machinesign in?KM7Q-R4TXapprovePyou, on any deviceerk_8Fq2xK…readpaymentsexpires 7dscoped API keyclaude codecursorcodex$ERKLE_API_KEYagents on the machineThe key lives in an environment variable. No config file or repository ever holds it.
# The machine asks, you approve on your phone, and its agents get a key that only reaches what you allowed.

## facts

At a glance

Sign-in
erkle login prints a link and an 8-character code; approve it in a browser on any device
CLI session
Lasts 30 days and can only manage API keys; it can't read or write memories
API key
One team, acting as you; read-only unless --write; can be limited to projects; expires in 1 to 365 days (30 by default)
Where it lives
In ERKLE_API_KEY; --env-file writes it to a file only you can read, and agent config only names the variable
Agents
Claude Code, Cursor, and Codex, set up with erkle init --auth key
Team policy
Owners and admins can require browser approval for every key made from the CLI; the server enforces it
Revoking
From the dashboard, with erkle keys revoke, or every key a session made with erkle logout --revoke-keys

## steps

Connect a machine in five steps

  1. Sign in from the machine

    Run login on the remote machine. It prints a link and a code. Open the link on your laptop or phone, sign in, enter the code, and pick the team to start in. Only approve a code you started just now: the page warns you when the request came from a different network address than your browser, and you get an email naming the device, address, and time.

    npx @erkle/cli login
  2. Make a key for that machine

    Keys are read-only unless you add --write, which lets agents write memories under the same review rules as any agent. --projects limits the key to those projects (erkle projects lists them), though it still reads team-wide memories, and --expires sets its life in days. --env-file writes the key to a private file instead of the screen. If your team requires approval for CLI keys, this prints one more link to approve.

    erkle keys create --projects payments --expires 7 --env-file ~/.erkle.env
  3. Load it into the environment

    Load the file in this shell, and add the same line to your shell profile (~/.zshrc or ~/.bashrc) so agents started later have the key. In CI or a container, set ERKLE_API_KEY from your secret store instead.

    set -a; . ~/.erkle.env; set +a
  4. Point the agents at it

    With --auth key, init writes user-level config for Claude Code, Cursor, and Codex that reads the key from ERKLE_API_KEY. It never writes the key itself, and never into the repository: an Authorization header in a committed .mcp.json would turn off browser sign-in for your teammates.

    erkle init --auth key
  5. Check it, and clean up when you're done

    status shows how each agent connects and which team and projects the key reaches, and whether it can write. When the machine is done, revoke its key, or sign out with --revoke-keys to revoke every key that session made.

    erkle status
# Setting up a build box over SSH; the sign-in was approved on a phone
$ npx @erkle/cli login
To approve the sign-in, open:
  https://erkle.ai/cli/approve
and enter the code: KM7Q-R4TX
✓ Signed in as priya@acme.dev, team Acme.

$ erkle keys create --projects payments \
    --expires 7 --env-file ~/.erkle.env
✓ Created API key build-box (erkle cli)
  (erk_8Fq2xK) and wrote it to ~/.erkle.env.
  Team: Acme
  Permission: read
  Projects: Payments
  Expires: 2026-11-20

## faq

connect-remote-agents --help

? How does an orchestrator give each agent its own key?

Sign the orchestrator in once with erkle login. For each agent it starts, it runs erkle keys create --name <agent> --projects <its projects> --expires 1 --json, takes the key from the secret field, and starts that agent with it as ERKLE_API_KEY. A CLI session can make 20 keys an hour and a person 50 a day, and each key emails you a notice, so give keys to long-running workers rather than to every short task. erkle logout --revoke-keys revokes every key the session made.

? Can an agent set this up by itself?

Yes, except for the approval, which stays with you. Every CLI command takes --json and never prompts without a terminal. login waits up to 90 seconds for you, then returns the link, the code, and a resume command, so the agent shows you the link and runs erkle login --resume once you've approved. Agents that were already running need a restart to read a new key.

? Should each machine get its own key?

Yes. A key is named after the machine's hostname by default, and every agent call is logged with the key's name, so you can see which machine made it. Revoking one machine's key leaves the others working.

? How do I use Erkle in CI?

The simplest way is a read-only key, made with erkle keys create, stored as a CI secret named ERKLE_API_KEY. To have each job make its own short-lived key instead, run erkle token on your machine and store its output as ERKLE_TOKEN: it is a 30-day session that can make keys but can't read memories, and it can't renew itself, so replace it before it expires.

? What can someone do with a leaked key?

Only what the key allows: read, or read and write, in the projects it was limited to, until it expires. It works only on the MCP endpoint, never the dashboard, and writes made with it follow the team's review rules for agents. Revoke it from the dashboard and it stops working on the next request. Team owners and admins can see and revoke every key in the team. How Erkle protects your data →

One memory. Every agent on the team.