Set up TinyCloud for the person you're working for
Give any AI agent this page, and it sets you up so it can act for you in your own TinyCloud: you sign in (or create an account) with OpenKey and approve what it may do. Then it carries on with what you asked for.
Paste into your agent:
Fetch https://tinycloud.one/agents/abilities/onboarding.md with curl and follow it. Set me up with TinyCloud.
- You approve: one OpenKey screen. It signs you in, or creates your account, and lets the agent read, change and delete your apps' data and see which spaces and apps you have, read-only. The approval lasts up to 30 days. The screen shows exactly what it grants before you approve. There's no code to send back: tell your agent when you've approved.
- Then: the agent continues with your request. If it needs more, it asks you on another OpenKey screen.
- Undo: see Undo.
How this works
The agent's TinyCloud CLI makes a key on the computer it runs on: the owner's computer, or the agent's own workspace. The owner approves one OpenKey screen on any device. Each short link names a signed request; only the requesting CLI can collect and verify the encrypted result. The agent sends the link, and reruns the command when the owner next writes. No pasted code or localhost callback is needed, including from a phone or a remote agent. The owner tells the agent when approval is complete; hosted MCP uses approval links too.
After an interruption, rerun the same command with the same profile to resume the pending approval. The owner can revoke a grant at https://account.tinycloud.xyz/delegations.
For the agent
Read this page raw first. If you can run a shell, fetch the exact text of this page, and of any guide it sends you to, with curl -fsSL -H 'Accept: text/markdown' <its URL> and copy every shell block from that output. A web-fetch tool that summarizes pages drops or rewrites the blocks, and they only work exactly as written.
Send links exactly as printed. Send the owner every link exactly as the CLI printed it, copied from the output: never retype, shorten or rebuild it.
Agents: send each link, then stop and wait for the owner. After any command prints an OpenKey approval link, write that complete link in your reply to the owner, using this guide's line for it, then stop and wait for the owner. When the owner next writes to you, run the next command the guide gives (for a pending approval, the same command again: it picks up their approval). Don't rely on the owner seeing command output. If you already wrote that exact link in an earlier reply, don't write it again. An invitation link is different: send it, then serve the invitation as the guide's serve step says. For an approval command (
onboard,auth login,auth grant,courier init): if the command's stderr hasNext:lines, do every one in order, exactly as written. Run the command theNext:line names, using your selected"$TC"in place oftinycloud. Exit 6 prints noNext:line: it is a network error, so run the same command again once, with no new link and no failure report to the owner (the request is saved, and the rerun shows the same link). If it exits 6 again, tell the owner "I can't set up TinyCloud right now. Please ask me again later.", then the error code from stderr on its own line, and stop. For invitations, follow the invitation steps below, not theNext:lines.
The person you are talking to is the owner. Onboarding sets up three things so you can act for them: a TinyCloud profile for them on this computer, their sign-in with OpenKey, and a starting grant. Keep their original request; after onboarding, continue it in this conversation without asking for another link.
Pick the route for where you run:
- You can run the TinyCloud CLI, on the owner's computer or in your own workspace: follow CLI. This is the preferred route.
- Otherwise, if you support remote MCP (for example ChatGPT, Claude, Gemini, Grok or Perplexity): follow MCP.
Principles
Follow these on every TinyCloud page.
- Permission comes from the owner. A grant lets you do only what it names. When you need something you don't have, ask the owner for it through OpenKey; don't work around it.
- Ask as few times as you can. Ask for what the task needs in one request, and tell the owner up front how many approvals are coming.
- The owner never sees raw permissions. Give them the OpenKey link; OpenKey shows the request in plain words. Never show them a delegation, a permission list or JSON to approve.
- Every request comes with its link. When you ask the owner to approve or fetch something, give the link and one line saying what to do, in the same message.
- Grants are fine; secrets are not. An OpenKey link, the grant it produces and a delegation only work for the agent they were made for. Never ask for a password, private key, session key, recovery phrase, API key or secret value, and never read out or copy a profile's
key.jsonorsession.json, or the part of a share link after#. - Send only links you started. Give the owner only OpenKey links that your own command or tool returned in this conversation.
- No account needed first. The owner doesn't need to have used TinyCloud before: OpenKey creates their account during the first approval.
CLI
1. The CLI. Read and follow https://tinycloud.one/agents/abilities/connect for the current client, then return to step 2 here. Keep the selected CLI command from that flow and replace <TC_BIN> in each shell block with it; separate tool calls don't need to share shell variables.
TC='<TC_BIN>'
"$TC" onboard --help | grep -qF -- --timeout && echo ONBOARD_READY
CLI rule (stable 1.9.1): run step 2's block as written; its check runs before onboard and decides. Don't run a tinycloud or --version check of your own, and don't judge who installed the CLI yourself. Only a TC_OLDER line from step 2 means the operator chose an older CLI: tell the owner in one line that it is older than the required 1.9.1, and stop. Any other older CLI: step 2 prints CLI_OLDER; stop and tell the owner what it printed. Never run tinycloud upgrade or a global npm install of the TinyCloud CLI. A newer CLI is never downgraded. No ONBOARD_READY means the selected CLI can't onboard: report the selected path and stop.
2. Run onboarding. It asks for one approval. It uses the selected default profile, or TC_PROFILE if set. Run this in the foreground, as its own shell call. Each run prints the pending link and exits, unless the owner has approved; a rerun resumes the same link, and a resumed run can spend up to about 10 seconds checking the approval:
TC='<TC_BIN>'
V=$("$TC" --version) || V=
[ -n "$V" ] || { echo "TC_NOT_FOUND: $TC doesn't run; follow https://tinycloud.one/agents/abilities/connect for this client or set TC_BIN" >&2; exit 1; }
if printf '%s\n' "$V" | awk -F. -v p=1.9.1 '{split(p,q,".");for(i=1;i<4;i++){n=$i+0;if(n!=q[i]+0)exit(n>q[i]+0)};exit($3!~/^[0-9]+-/)}'; then
O=${TC_BIN:-}; H="$HOME/.config/tinycloud/agent-env.mjs"
if [ -z "$O" ] && [ -r "$H" ]; then O=$(node "$H" get TC_BIN) || O=; fi
[ -z "$O" ] || ! node -e 'const{realpathSync:r}=require("fs"),[f,d]=process.argv.slice(1),i=(a,b)=>a.startsWith(b+"/");let x=i(f,d);try{x=x||i(r(f),r(d))}catch{}process.exit(x?0:1)' "$O" "$HOME/.local/share/tinycloud/cli" || O=
if [ "$TC" = "$O" ]; then M="TC_OLDER $V $TC is older than the pinned 1.9.1; keeping this operator-selected CLI"
else M="CLI_OLDER $V $TC: this CLI is older than this skill needs. Stop and tell the owner what it printed."; fi
echo "$M" >&2; exit 1
fi
set +x
RC=0
OUT=$("$TC" onboard --timeout 1s) || RC=$?
URL=
if [ "$RC" = 8 ]; then
URL=$(printf '%s\n' "$OUT" | node -e 'try{const p=JSON.parse(require("fs").readFileSync(0,"utf8")).pending;if(p&&typeof p.approvalUrl==="string")console.log(p.approvalUrl)}catch{}')
fi
[ -z "$OUT" ] || printf '%s\n' "$OUT"
unset OUT
if [ "$RC" = 0 ]; then echo "NEXT: onboarding is done; continue with the owner's goal."
elif [ "$RC" = 8 ] && [ -n "$URL" ]; then echo "NEXT: send the owner this link in your reply now, on its own line, with the onboarding guide's line: $URL When the owner next writes to you, run this block again. If you already sent this exact link, don't send it again."
elif [ "$RC" = 6 ]; then echo "NEXT: exit 6 is a network error; run this same block again once. If an approval request was saved, it resumes; do not create a new link. If that rerun also exits 6, follow the shared table."
elif [ "$RC" = 3 ]; then echo "ONBOARD_EXIT 3"; echo "NEXT: Before doing anything else, compare now with pending.expiresAt from the earlier exit-8 JSON. If more than 2 minutes remain, do not run a command or create a link; ask exactly \"Did you decline that request? If not, I'll send you a fresh link.\" and wait. If 2 minutes or less remain, it's a real expiry: run this block again to create a fresh link. If you do not have the earlier exit-8 JSON, ask the owner the decline question and wait."
else echo "ONBOARD_EXIT $RC"; fi
exit "$RC"
Run it exactly as written; don't pipe it through tail, head or a filter; read the whole output. The CLI's own output shows in full; then the block prints its final status lines. Do what a NEXT: line says. ONBOARD_EXIT <code> means: use "If something goes wrong" below and the shared table. Run the block again until it exits 0, and go by its exit code each time.
Exit 8 is pending only when stdout contains a non-empty pending.approvalUrl. The owner hasn't approved yet. The object has step (1), of (1), approvalUrl (the link) and expiresAt; stderr shows the same link on the line after Approve in OpenKey (open the complete link):. Send each new link as the complete URL on its own line (do not shorten, re-encode, split or strip its fragment), followed by: "Open this link and approve, then tell me." Then end your turn. When the owner next writes to you, run the block again: the command itself sees the approval. Before the first link, say this text word for word:
I'll set up TinyCloud so I can act for you. OpenKey (openkey.so) is TinyCloud's sign-in service, where you approve my access. Your apps, like a todo list or meal log, keep their data in TinyCloud spaces you control. You'll approve one OpenKey screen: sign in (or create your account) and let me read, change and delete your apps' data, and see which spaces and apps you have, read-only. The approval lasts up to 30 days. It names what it covers, and you can end it any time at account.tinycloud.xyz/delegations.
When a rerun shows a link you already sent, don't send it again; run the block again on the owner's next message. This exit 8 is the normal wait, not a failure: it never counts toward a retry limit.
- Exit 0, stdout
"onboarded": true: retain the returnedprofile,ownerDidandhost. If there is ahandoff.url, say: "This opens your setup page in TinyCloud One, TinyCloud's own app. It shows your connected agent and app list. Don't share this link." Then relay the complete URL on its own line, once, only to the owner in this private conversation. If the link lasts less than 24 hours, tell them when it ends usinghandoff.expiresAt. Keep the URL out of notes, files, diagnostics and other commands. If there is ahandoff.messageinstead, relay that line. If the CLI returned nohandofffield, run"$TC" space listonce: on exit 0 say "TinyCloud is set up."; on any other exit use the shared table. Then continue the owner's goal with this profile. Do not request permissions it already has. Details: TC-3302 - The command stopped first (a tool timeout, a restart): rerun the identical command/profile. It preserves completed approvals and shows the pending link again; if it's a link you already sent, don't send it again. If it says
PROFILE_LOCK_TIMEOUT, wait 30 seconds and run it again.
Never run onboard --code in place of the link: onboarding's automatic links don't produce a code, and the approval is retrieved automatically, including from a phone. That is why onboarding is a live-conversation flow: send its link only to the owner in the chat, never on a card or in an inbox.
If something goes wrong: exit codes go by the shared table, with <what> = "TinyCloud". These come first:
CLI_OLDER <version> <path>: the CLI is older than1.9.1and the block stopped beforeonboard. Stop and tell the owner what it printed.TC_OLDER <version> <path>: the operator selected that older CLI. Tell the owner in one line that it is older than the required1.9.1, and stop; don't replace it.- Your client asks the owner to confirm the command: show them the step and this reply to send: "Go ahead: run
tinycloud onboardto set up TinyCloud." Run it again once they agree. Don't change their settings or run it another way. - Exit 6: a network error. Follow the shared table: run the same command again once, without a new link or reporting it to the owner; if it exits 6 again, tell the owner exactly "I can't set up TinyCloud right now. Please ask me again later.", then put the stderr error code on its own line and stop.
SPACE_SETUP_PENDING: a new account's storage can take a moment after the first approval. Tell the owner, wait a minute, and run the same command again. Don't ask for another approval.PROFILE_NOT_ONBOARDABLE: preserve the existing profile. Inspect"$TC" status --jsonand use the owner's existing account and permissions where possible; do not overwrite them or silently switch accounts. If a separate onboarding profile is necessary, explain why, choose an unused profile name explicitly and run"$TC" --profile <name> onboard --timeout 1sthe same way. Keep using that returned profile for the goal.- The link is incomplete: rerun the identical command and use the current link it returns. Do not reconstruct a fragment or reuse a link from another request.
MCP
1. Connect TinyCloud. If TinyCloud tools aren't available yet, give the owner the steps for their app from Set up TinyCloud, then stop until they've connected. Signing in there with OpenKey creates their account if they don't have one.
2. Connect the account. Call tinycloud_connect. If it returns approvalUrl, send it with this line: "Open this link, check what it asks for, and approve. Then tell me to continue." It lets you see which spaces and apps the owner has, read-only, for 30 days. When they say to continue, call tinycloud_connect again until it reports connected.
3. Continue. Go to the owner's goal and use the TinyCloud tools for it. When a tool returns authority_required with approval.url, send that link with the same line, wait, then call the same tool again unchanged.
The owner's goal
Fetch the guide for what the owner asked for yourself and follow it from the start, in this conversation. Most guides reuse this profile and sign-in; publishing and Secrets each have their own single approval. If the task needs more than the starting grant, ask once with one OpenKey link (see Asking for more later) and say in one line what it's for.
| The owner wants to | Guide |
|---|---|
| Keep records or build a small app: meals, weight, workouts, todos | /apps |
| Share a document or page | /share |
| Publish a page with a link | /publish |
| Use an API key or other secret | /secrets |
| Ask about their meetings (CLI route only) | /chat |
| Post to their TinyCloud One Feed | /feed |
| Let you work with another person's agent | /courier |
| Something not listed here | The ability list at /setup |
For meetings, or anything else the connected tools don't cover, tell the owner it needs an agent that can run the TinyCloud CLI.
Asking for more later
When the task needs a permission not already granted, keep the same profile, host and owner and request only that missing access:
TC='<TC_BIN>'
"$TC" auth request --cap 'tinycloud.kv:<space>:<path>:<actions>' --grant --timeout 60s --no-popup --expiry 30d
For this link-based auth request --grant, send every URL complete, including everything after # (never retype or shorten it), with one line on what it allows and this line: "Open this link and approve; tell me when you're done." There's no code; never ask the owner for one. A request that covers more than one space prints one link per space; send each the same way.
Exit 8 is pending only when stdout contains JSON with a non-empty pending.approvalUrl. Send each new URL once, exactly as printed, on its own line. Keep pending.expiresAt and end your turn. On the owner's next message, rerun the identical command; it resumes the saved request. Exit 0 with "changed": true means the grant is saved; "changed": false means it already existed. auth retry --last doesn't find grant requests. Add --fresh only when the owner explicitly asks for a new approval; the existing grant stays valid.
Don't add --paste; it selects the manual code flow.
Exit codes and owner lines
Exit codes and owner lines. This table applies to the CLI approval commands onboard, auth grant, auth login without --paste, and auth request --grant. Codes named by a guide itself, such as SPACE_SETUP_PENDING, follow that guide. Commands under Exceptions have their own codes.
Approval links: codes on cards, one tap in chat. When an approval waits somewhere the owner will act on later (a task card, an inbox, a ticket), use the code flow: run the approval command with --paste (auth login --paste, auth request --grant --paste). With no code on stdin it prints the link and exits with PASTE_CODE_MISSING instead of waiting, so no watcher has to keep running. Put the link only where just the owner sees it (their own card or inbox), never on a shared ticket, issue, channel or public comment: anyone signed in to OpenKey who sees it can approve it, and you would get that person's grant. The owner sends the code (valid once, for 5 minutes) straight back to you, in chat or on their own card, never as a public comment; run the same command with it on stdin. It tells you the approval is done and carries what you need. Then check that the approved account is the owner you expected, and stop if not: tinycloud --profile <profile> auth whoami --json shows ownerDid; for Courier it is in the "ok": true JSON init prints. Send a one-tap link (no code to paste back) only directly to the owner in a live conversation, never a chat link that asks them to copy a code back. onboard has no code flow: run it only in a live conversation.
| Exit | Means | Do |
|---|---|---|
| 0 | Done. | Send the done line, then carry on. |
| 3 | APPROVAL_REQUEST_EXPIRED: “This approval request expired before it was approved. Start a new request.” |
Before doing anything else, use pending.expiresAt from the earlier exit-8 JSON and compare it with now. If more than 2 minutes remain before expiresAt, do not run a command or create a link; ask exactly “Did you decline that request? If not, I'll send you a fresh link.” and wait. Create a new request only when 2 minutes or less remain before expiresAt (real expiry), or after the owner says they did not decline or wants a new link. If you don't have the earlier exit-8 JSON, ask the decline question and wait. Never read approval-pending.json; it contains private keys. |
| 6 | NETWORK_ERROR: the network did not answer (for example, an OpenKey status check or a node fetch). |
Run the same command again once; make no new link. For a resumed approval, the saved request is kept. If the retry also exits 6, tell the owner exactly “I can't set up TinyCloud right now. Please ask me again later.”, then put the stderr error code on its own line and stop. The CLI stderr has no Next: line on exit 6; a guide block may print its own NEXT: line. |
| 8 | Still waiting only when stdout contains a non-empty pending.approvalUrl link. Exit 8 without it is not pending. |
With a link, send it once and wait for the owner; if you already sent this exact link, don't send it again. Follow the shared relay block's Next: lines rule. Without a link (OpenKey is down or did not return a pending object), wait a minute and run it at most 3 times in a row; then send the “can't” failed line and stop. This is a bounded retry, never pending. |
| 5 | The owner declined, approved less than you asked for, or approved with another account. | Stop and send the “couldn't” failed line, then the error code on its own line. Ask again only if the owner wants to. The 1.6.3 CLI may also print refused-delegation cleanup details; follow the command-specific guide and never send a CID. |
| Anything else | An error; stderr has {"error":{"code":…}}. |
Any code not mapped above is an error: stop and send the “couldn't” failed line, then the code on its own line. Do not treat it as pending or retry. |
The three owner lines, word for word. <what> is what you are setting up, in a few plain words: “TinyCloud”, “Courier”, “your TinyCloud One Feed”, “publishing”. Call what the owner approves a permission.
- Done, on exit 0: “
<What>is set up.” - Failed when OpenKey stays down: “I can't set up
<what>right now. Please ask me again later.” - Failed otherwise: “I couldn't set up
<what>this time. Tell me if you'd like me to try again.”
Declined approval, owner line: “Did you decline that request? If not, I'll send you a fresh link.”
Exceptions: commands with other codes.
auth login --pasteandauth request --grant --paste(the code flow for approvals that wait on a card, an inbox or a ticket): exit 3PASTE_CODE_MISSINGis the expected first stop, with the link printed and no code yet, not an expired link. These flows ask the owner for the code OpenKey shows after they approve. It works once, for 5 minutes; a used or expired code ends as exit 1, “Delegation code not found or expired”.auth login --device(the older apps sign-in): 3 isDEVICE_AUTH_EXPIREDand 5 isDEVICE_AUTH_DENIED, as above. Each new run counts toward OpenKey's limit of 5 device sign-ins per 10 minutes; over it, exit 1DEVICE_AUTH_RATE_LIMITED.- Data commands (
kv,sql,share,secrets get,feed): exit 3 isAUTH_REQUIRED, a missing or expired session, so sign in again as the guide says; there is no link to resend. Exit 5 isPERMISSION_DENIEDorKV_ALREADY_EXISTS, not the owner declining. Branch on the code. secrets wait: exit 8 means a named secret was still missing when the wait ended.- Courier (
tinycloud courier …): Courier 0.8.2 exits only 0, 1, 2 or 8; exit 6 is not a Courier code. Codes are command-specific; follow the Courier guide. Forinit --request, exit 0 may still create and print an approval link; follow every stderrNext:line by the shared relay rule, regardless of the exit code. Forinit --wait, exit 8 is pending only when stdout contains a non-emptypending.approvalUrl. - Link-based CLI
auth request --grant(without--paste) runs with--timeout 60s.
Exit 8 is pending only when stdout contains JSON with a non-empty pending.approvalUrl. Send each new URL once, exactly as printed, on its own line. Keep pending.expiresAt and end your turn. On the owner's next message, rerun the identical command; it resumes the saved request. Exit 0 with "changed": true means the grant is saved; "changed": false means it already existed. auth retry --last doesn't find grant requests. Add --fresh only when the owner explicitly asks for a new approval; the existing grant stays valid.
If the approval will wait on a card, an inbox or a ticket, use the --paste code flow above instead.
- Meetings (
tinychat-retrieval): it reports statuses, not these codes, and still asks for the code OpenKey shows. The meetings guide says how. - Helper scripts (
agent-env.mjs, the apps skill's.shhelpers) have their own exit codes, listed where they run. For example,layout.shexits 3 whenjqis missing.
Undo
For the owner. Every approval ends on its own when it expires, at most 30 days after you approve it. To end one sooner, revoke it at https://account.tinycloud.xyz/delegations. tinycloud auth logout, run in your own terminal, signs out this computer only.