Skip to main content
Paste this prompt into your coding agent, such as Claude Code, Codex, Cursor, or Gemini CLI:
Setup prompt
The prompt holds no key. You approve once in your browser. Your agent then asks where the agent you want to connect runs, connects it, and proves it with a real call. It never connects itself, so its own settings stay as they are. Self-hosting? Add your API address to the end of the prompt, for example My OneCLI API is at https://onecli.example.com. The rest of this page is written for the agent, so it also shows exactly what the agent will do. To run the steps yourself, use the Quickstart.

Instructions for the agent

You are setting up OneCLI for the person you are working with. If you are reading this page, you already have the instructions: start at Step 1. OneCLI gives an agent access to APIs without giving it a key. Your person keeps their apps and keys in a vault. Each agent connects to one vault. When an agent calls an API through the OneCLI gateway, the gateway adds the credential on the way out. You are your person’s manager. You sign in once, then connect the agent your person wants, where it runs. You never connect yourself: you hold only the key that onecli login saves. Follow these rules for the whole setup:
  • Never run onecli connect, onecli attach, onecli run, or onecli exec for yourself, and never add a proxy to your own settings.
  • Never ask your person for a key, a token, or a password. You do not need one.
  • onecli tokens create shows a connect token once. Pass it only to the place it is for. Never repeat it, log it, or save it.
  • Never print, log, or save a credential or the contents of agent.env. Where an agent is connected, never run commands that print the environment or HTTPS_PROXY, such as env or printenv: they hold that agent’s credential.
  • Run each command as written here. Do not preview, back up, or inspect around it.
  • Show your person every link the CLI prints, as a bare URL on its own line. Then wait for them. Do not guess that they approved.
  • Every onecli command you run prints JSON. Read the code and action fields of an error before you retry.
  • If you cannot run a command, give your person the exact command and wait. Do not claim it is done.
  • Do every step that applies, in order.

Step 1: Install or update the CLI

You need version 3.4.0 or later. If the command is not found, or the version is older, install the latest:
The script installs the latest onecli binary from GitHub Releases, and replaces an older one. Run onecli version again to confirm it is on your PATH. If your person named their own OneCLI address, set it in the shell of every onecli command you run. Skip this on OneCLI Cloud:

Step 2: Sign in

Check whether you are signed in already:
If it prints your person’s account, go to Step 3:
If it prints "code": "AUTH_REQUIRED", sign in. onecli login prints a sign-in link, opens it in the browser, and then waits up to 5 minutes for your person. Run it in the background so you can read the link while it waits:
Write the link and the short code in a message to your person now, before you wait: many agent apps fold a command’s output away, so they may not see it there. They sign in, or create an account, and approve. Then wait for the command to finish and read its result:
On success:
This saves a key for managing vaults and agents. It expires after 90 days. It is not an agent’s access to a vault: each agent gets its own in the next steps. If your shell cannot open a browser, add --no-open. The link works from any device.

Step 3: Ask where the agent runs

Ask your person one question, and wait for the answer:
To someone trying OneCLI for the first time, recommend the demo sandbox. Then follow their answer:

Step 4: Connect a free demo sandbox

The demo sandbox is a preview. It may change or be removed. Each person gets one, once, where their OneCLI offers it.
Start it:
OneCLI starts the box and connects it to your person’s Personal vault as the agent demo-sandbox. This takes a few seconds. Once it is connected:
If you get an error instead, tell your person what it means. Then go back to Step 3 and ask again, without the demo sandbox: For DEMO_SANDBOX_STARTING, do not ask again: a box is starting now. Wait 30 seconds, then run onecli demo start again. Once the box is connected, prove it with the same call, twice, inside the box. onecli demo run runs one shell command there and prints its output. Pass the command as one quoted string. First around OneCLI, with no credential:
Then through OneCLI. A login shell (sh -lc) reads the proxy settings that connecting wrote in the box:
The gateway added the Test key on the way out. Neither you nor the box held it. Tell your person that the box is theirs until ends_at, and that their dashboard lists it as demo-sandbox. You can run more commands in it with onecli demo run -- '<command>', and end it now with onecli demo end. Go to Step 7.

Step 5: Connect your own sandbox or server

List your person’s vaults:
Use the vault your person named. If they named none, use the one with "personal": true. Make a one-use connect token for the new agent. Name the agent so your person can tell their agents apart, and name the provider: e2b, daytona, docker, or what the place is.
The token works once, and expires after 15 minutes. Run install_command inside the place where the new agent runs, as the user the agent runs as. It needs sh and curl, and it connects that place, not yours: If you can reach that place yourself, such as a container on this machine, run the line there. Otherwise give your person the line and where to run it, then wait for them. Check that the new agent is connected:
Then prove it with the same call, twice, inside that place. First around OneCLI, which answers 401:
Then through OneCLI, which answers 200. A login shell reads the proxy settings that connecting wrote there. Start the agent from a login shell too, such as a new SSH session, so its calls go through OneCLI:
In a Docker container, run each one with docker exec <container> sh -lc '...'. If you cannot run commands there, give your person the two lines. Go to Step 7.

Step 6: Connect this machine

This choice comes last. An agent connected on this machine sends its calls through the gateway, so it stays apart from you: your person connects it, in a new terminal, and you do not. Run onecli vaults list to find the vault id, as in Step 5. Then give your person these lines, with their vault id, a name for the agent, and the agent they use (claude, codex, cursor, hermes, opencode, or openclaw):
The first line connects this machine as a new agent. --no-profile keeps the proxy out of their other shells, so it never reaches you. The second line proves it: it prints 200, because the gateway added the Test key. The third starts their agent with the proxy and the OneCLI certificate for that session only. Wait for your person, then run onecli agents list --mine to see the new agent. Go to Step 7.

Step 7: Offer a first real app

The Test key is only a demonstration. Ask your person which app they want their agent to use first, such as GitHub, Gmail, or Slack. Then give them the link that adds it to the agent’s vault, with the vault id and the app:
They connect the app in their browser, and the agent can use it from its next call. Never ask them for a key. On any other OneCLI, the dashboard address is origins.external in the answer of curl -s <your API address>/v1/instance. If they want no app now, tell them they can add one later from the vault’s page.

Report back

Finish with a report of four lines at most:
  • Where the new agent runs, its name, and its vault.
  • The two status codes of the proof.
  • The app you offered, with its link, or that none was asked for.
  • Any step you could not do, with the exact command your person should run.
Do not list files. If sign-in is still waiting for approval, say the setup is prepared but not verified.

After setup

You stay signed in for 90 days, so your person can ask you to connect more agents at any time: start again at Step 3. Each agent gets its own one-use token.

When something fails

Reference