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
## facts
At a glance
- Sign-in
erkle loginprints 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-filewrites 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 witherkle logout --revoke-keys
## steps
Connect a machine in five steps
Sign in from the machine
Run
loginon 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 loginMake 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.--projectslimits the key to those projects (erkle projectslists them), though it still reads team-wide memories, and--expiressets its life in days.--env-filewrites 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.envLoad it into the environment
Load the file in this shell, and add the same line to your shell profile (
~/.zshrcor~/.bashrc) so agents started later have the key. In CI or a container, setERKLE_API_KEYfrom your secret store instead.set -a; . ~/.erkle.env; set +aPoint the agents at it
With
--auth key,initwrites user-level config for Claude Code, Cursor, and Codex that reads the key fromERKLE_API_KEY. It never writes the key itself, and never into the repository: an Authorization header in a committed.mcp.jsonwould turn off browser sign-in for your teammates.erkle init --auth keyCheck it, and clean up when you're done
statusshows 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-keysto revoke every key that session made.erkle status
$ 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 →
## more-guides
One memory that every teammate's Claude Code, Cursor, and Codex searches, with review before it spreads.
Write a rule once at the scope it's true for, and every agent in those repositories finds it.
A new teammate's agent searches what the team already approved, from the first task.
Proposals, a secret guard, versions, and permissions, so one agent's guess never becomes the team's rule.
see also: How Erkle protects your data · The CLI on GitHub