# Codex on Prized

> Set up Prized so Codex works on this project on a cloud box that stays on: the project is copied to the box once, with no sync, and Codex runs there in a session that keeps going with the laptop closed. People read https://prized.dev/codex.

These are instructions for you, Codex, on your person's computer, in the project they want on the box. Do the setup rather than explain it. Every docs page is listed at https://prized.dev/llms.txt; add `.md` to a docs URL for its Markdown.

## Rules

- Ask your person before you install software, before you copy their project or any credential to the box, and before anything that costs money. Copy, never move or delete.
- Never start a sync. The project goes to the box once, one way (`--copy-once`), and you never copy anything back to this computer unless they ask.
- Never switch the Prized account this computer is signed in to.
- Pass only the flags they said yes to. When a command fails with a hint, tell them the hint; never add a flag on your own.
- Never print, log or commit a credential, never put one in a command line, and never read `~/.config/prized`.
- Never quote a price from memory: read https://prized.dev/pricing.md.
- `prized` commands with `--json` print one JSON object with an `ok` field. Error and exit codes are at https://prized.dev/docs/cli.md.
- `prized` and the sign-up calls need the network and write outside this folder, and `prized box new --wait` and setup can take several minutes. If your sandbox blocks a command, ask your person to approve running it outside the sandbox, and give these commands a 10 minute timeout.

## 1. Install the CLI

If `prized version` fails, ask, then run `curl -fsSL https://prized.dev/install.sh | sh` (on Windows: `powershell -c "irm https://prized.dev/install.ps1 | iex"`). If `prized` is still not found, use the path the installer printed.

## 2. Sign in

Run `prized box ls --json`. If it works, this computer is already signed in: keep that account, and never run `prized login` to change it (your person does that themselves if they want another). If it fails with code `AUTH`, ask whether your person has a Prized account.

- They do: ask them to run `prized login` in another terminal and to tell you when it has finished.
- They don't: ask for their email address and follow https://prized.dev/auth.md, its From a shell part. Prized emails them a 6-digit code, they give it to you, and the CLI is signed in without the key ever showing in your output. On Windows without a POSIX shell (`sh`, `grep`, `sed`), ask them to run `prized login` instead.

Then run `prized box ls --json` again. If it fails with any other code, tell your person what it says.

## 3. A box

If `prized box ls --json` lists no box, ask, then run `prized box new --wait --json`. On the free credit that starts a Small; a bigger size needs a plan (https://prized.dev/dashboard/billing).

## 4. Ask

Run `prized setup --dry-run --json --non-interactive --copy-once .`. It changes nothing, here or on the box, and its `login` step names the account. If it exits 2 refusing this folder, run `prized setup --dry-run --json --non-interactive --no-project` instead for the account. Then ask these in one message:

1. The project: may you copy it to the box once, with no sync? Name the account and the box (several boxes: ask which, and add `--box <name>` to setup and to every `prized` command after it). If this folder is their home folder or Desktop, or has no `.git` or manifest, ask which project they mean and use its full path (`/…` or `./<folder>`, never a bare name) instead of `.`. Never copy a home folder or a folder inside `~/Prized`: tell them instead.
2. Codex's sign-in, MCP servers and settings: `--agent codex` copies them to the box. If they say no, pass `--no-agents`.
3. Their GitHub CLI token and git identity: `--gh`.
4. Their environment (not on Windows): run `prized env plan --json`, read them the groups it lists, and pass the ones they want as `--env <groups>`. Secrets (`.env` files included) and data are their own yes (https://prized.dev/docs/agent-setup.md).

## 5. Copy

Run setup once, with the flags they said yes to. Without their yes to the copy, still run it for the rest, with `--no-project` in place of `--copy-once .`:

```sh
prized setup --json --non-interactive --copy-once . <their flags>
```

It copies the project to `~/code/<name>` on the box (`.git` included; `node_modules`, virtualenvs, build caches and `.env` files stay here) and never overwrites a folder there that holds files. A yes to the copy and to Codex's sign-in is `prized setup --json --non-interactive --copy-once . --agent codex`. If setup exits 5 naming several boxes, ask which one and re-run with `--box <name>`.

Read `steps[]` in the JSON: the `project` step names the folder on the box it copied to; if it says anything else, tell them what it says. `skipped` names what wasn't granted, and `failed` carries a hint to relay. If the agents step reports codex as `manual`, there was no Codex sign-in here to copy; a ChatGPT sign-in always stays on this computer. Tell your person to sign Codex in on the box once: `prized ssh`, then `codex login --device-auth` there, and enter the code it prints at the page it names. Or, in their own terminal, `prized agents handoff codex` opens the sign-in page in their browser.

## 6. Check

`prized status --json` reports ok. If the project was copied, `prized exec --cwd code/<name> -- ls` lists it on the box. `prized agents ls --json` shows Codex installed and signed in on the box.

## 7. Report

Tell your person the account, the box's name, the project's folder on the box, what was copied, that their folder here is unchanged and nothing syncs back (work moves with git), and the command that starts Codex on the box in the project and opens it (the JSON's `agent.command` when setup gives one):

```sh
prized agents run codex --attach --dir code/<name>
```

Closing the terminal or the laptop leaves it running, and `prized ssh -s codex` takes them back. Run the project's commands there with `prized exec --cwd code/<name> -- <command>`. To hand Codex a task and walk away: `prized prompt --provider codex --cwd code/<name> --detach "<the task>"` (https://prized.dev/docs/remote-agents.md). A headless run keeps the box awake while it works, even while it waits on its model (on an updated box agent); one that prints nothing for 6 hours stops counting (https://prized.dev/docs/boxes.md).
