# Maindesk: start here (for AI agents)

Maindesk gives you and your human Linux, Windows and Mac computers in the cloud that you both use: you through MCP, a CLI or REST, your human in a browser at https://maindesk.smaverk.com/.
Heavy or long work runs there (tests, builds, other operating systems), keeps running after your session, and idle machines sleep after 10 minutes at no cost.

**Sign-up needs an invite code for now.** Your human gets it from the person who shared Maindesk with them; it is often part of that link (`https://maindesk.smaverk.com/?invite=<code>`). Ask your human for it and put it where the steps say `<invite code>`. If your human already has a Maindesk account, no code is needed: `maindesk connect` without `--email` gives a link they approve (MCP: `account()`; REST: `POST /v1/device`).

**Start here** (bun or node 18+; put your human's email in; nobody needs to be at the keyboard):
```
curl -fsSL https://maindesk.smaverk.com/install.sh?invite=<invite code> | sh && $HOME/.local/bin/maindesk connect --email you@example.com --invite <invite code> && $HOME/.local/bin/maindesk run -- uname -a
```
You get a key at once and can work right away on Linux. An account an agent makes is a trial until its human claims it (the claim link): Linux only, 150 desk minutes a day. Claiming opens Windows, the Mac and the full 1,500 desk minutes a day. `connect` writes .maindesk/config.json in this folder, .mcp.json and .claude/skills/maindesk/SKILL.md (keys private, 600), and $HOME/.maindesk/config.json only if there is none. Configs for every project (Codex and others) change only with `--client <name>`; `push` leaves on this computer the files that hold the key: the ones `connect` writes and any `.env` file with a Maindesk key.
It also prints a message for your human: they open the link once to create their Maindesk account (valid 30 minutes; `$HOME/.local/bin/maindesk claim` or GET /v1/claim gives it again). Until then, what only they can do (approvals, settings) says so with that link.
(Installer checksum: https://maindesk.smaverk.com/install.sh.sha256?invite=<invite code>.)

## Steps
1. Get the CLI: `curl -fsSL https://maindesk.smaverk.com/install.sh | sh` (or without installing: `bunx maindesk@https://maindesk.smaverk.com/cli/maindesk.tgz <command>`). It goes to $HOME/.local/bin and says when it replaces a maindesk that is there (the program only); elsewhere: `MAINDESK_CLI_DIR=<dir> MAINDESK_BIN_DIR=<dir>` before `sh`. `MAINDESK_HOME=<dir>` keeps the CLI's settings apart (another account on the same computer).
2. Connect in your project folder: `$HOME/.local/bin/maindesk connect --email <their email> --invite <invite code>` (key at once).
   With your human at hand and no email: `$HOME/.local/bin/maindesk connect --invite <invite code>` prints a link and a code; they open it, create their Maindesk account and tap Allow (the code on that screen matches). Without a terminal it does not wait: run `connect` again to pick up the key (the link works for 30 minutes).
   MCP instead (any client): add https://maindesk.smaverk.com/mcp (streamable HTTP) and call `account(email="<their email>", invite="<invite code>")` for a key, then send `Authorization: Bearer <key>`. `maindesk connect` writes it into this project's client files (`--client claude,codex,cursor,vscode,windsurf,cline,goose,opencode,zed` names others).
   REST instead: `GET https://maindesk.smaverk.com/v1/signup/challenge` (a small proof of work: find the nonce it describes), then `curl -X POST https://maindesk.smaverk.com/signup -H "Content-Type: application/json" -H "X-Maindesk-Pow: <challenge>:<nonce>" -d '{"email": "<their email>", "invite": "<invite code>"}'`
3. First command: `$HOME/.local/bin/maindesk run -- uname -a` (Linux, a few seconds). Windows: `$HOME/.local/bin/maindesk run --on windows --bg -- node -v` then `maindesk logs <job> --follow`: the first Windows start takes about 142 s the first time, 23 s from sleep (or pass --timeout 180). Send your folder: `maindesk push`.
4. Done for now: `$HOME/.local/bin/maindesk sleep --on all` puts every machine to sleep (they also sleep by themselves after 10 minutes).

Claude Code and Codex tasks can run on an LLM Gateway key instead of a plan: your human types it only on the desk (Agents, Use an LLM Gateway key on the web page), and it is saved there as ANTHROPIC_BASE_URL=https://api.llmgateway.io plus ANTHROPIC_AUTH_TOKEN. Claude Code uses those lines, Codex the same key and model through the gateway's Responses API.

## Costs
Time counts in desk minutes: Windows counts 3x and the large desk 2.5x: a desk minute is a minute of standard Linux. Daily stop: 1,500 desk minutes a day per account once claimed; 150 desk minutes a day and Linux only before. Plans: $9 a month: 2,400 desk minutes a month (40 desk hours), No Mac, Daily stop: 480 desk minutes; $39 a month: 9,600 desk minutes a month (160 desk hours), 90 Mac minutes a month, Daily stop: 1,920 desk minutes; $99 a month: 24,000 desk minutes a month (400 desk hours), 240 Mac minutes a month, Daily stop: 4,800 desk minutes. Past a plan: Linux $0.20/h, Windows $0.60/h, per second while awake, nothing asleep; Mac: $0.06 a minute while a job runs on a clean Mac, nothing between jobs. Billing is not live yet: nothing is charged.
Every result ends with a [cost] line; every error has a fix naming the next call.

More: https://maindesk.smaverk.com/llms.txt (full guide) · https://maindesk.smaverk.com/docs/api (REST) · https://maindesk.smaverk.com/.well-known/mcp.json (MCP server card)
