# Codex on Prized

> Set up Prized so Codex works on this project on a cloud box that stays on: the folder syncs both ways, the box's ports open on localhost, and the session keeps running 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 sync their files, before you copy any credential, and before anything that costs money. Copy, never move or delete.
- 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 `prized 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 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. Set up

Ask these in one message, then run setup once:

1. The project. If this folder is their home folder or Desktop, or has no `.git` or manifest, ask which project they mean and use its path instead of `.`; never sync a home folder. Then ask how:
   - `--project .` syncs this folder both ways, in place. The box wins conflicts.
   - `--project . --copy` syncs a copy under `~/Prized` and leaves this folder alone.
   - `--project . --clone` clones the repo onto the box over git, with no live mirror. A private GitHub repo needs `--gh` too.
   - None of them: leave the project flags out.
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 and data are their own yes (https://prized.dev/docs/agent-setup.md).

Then, with the flags they said yes to:

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

A yes to syncing this folder and to Codex's sign-in is `prized setup --json --non-interactive --project . --agent codex`. If setup exits 5 naming several boxes, ask which one and re-run with `--box <name>`.

Read `steps[]` in the JSON: `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.

## 5. Check

`prized status --json` reports ok. If the project syncs (not `--clone`), `prized sync flush <name>` completes. `prized agents ls --json` shows Codex installed and signed in on the box.

## 6. Report

Tell your person the box's name, the project's path on both sides, what was copied, and the command that starts Codex on the box and opens it (the JSON's `agent.command` when setup gives one):

```sh
prized agents run codex --attach
```

Closing the terminal or the laptop leaves it running, and the same command, or `prized ssh -s codex`, takes them back. To hand it a task and walk away: `prized prompt --provider codex --cwd <the project's path on the box> --detach "<the task>"` (https://prized.dev/docs/remote-agents.md). A headless run counts as use only while it keeps the CPU or network busy, so a long one can be paused mid-task; before one, ask, then turn auto-pause off with `prized box auto-pause <box> off` (the box then stays awake and bills by the hour).
