Skip to main content
ancha run starts your agent for you. When your own harness starts the agent, such as a test suite, an eval loop or a notebook, use the world lifecycle commands instead. ancha world up starts a fresh world and prints its tools’ URLs and fake credentials. Your harness runs the agent with them. ancha check grades the world with the scene’s checks and the same exit codes as ancha run. ancha world down removes the world.
The agent gets the tools’ variables, the task and the world’s ID. It never gets the URL or token that controls the world.

ancha world up

Pass at most one of --scene, --test and --world. With none, world up starts the scene that ancha.yaml names, when it names exactly one.
Output
With --json, the result is one object: Give the agent exactly the variables in env. See Environment variables. ancha schema world_up prints the JSON Schema of this output.

Where the world runs

world up chooses a server the way ancha run does: --server-url, then server.url in ancha.yaml, then ANCHA_SERVER_URL, then the workspace saved by ancha login. With none of these it starts a server on this computer, which stays up until ancha world down removes the last world or ten minutes pass without one. The first line says which:
--on local keeps the world on this computer whatever is configured. --on cloud puts it in your hosted workspace and exits 2 when no workspace is configured. A world in your workspace serves its tools at https://app.ancha.io/t/<workspace>/e/<envId>/<tool>. Your agent runs wherever your harness runs it. See Hosted workspace.

The lease

A world lives for --ttl after the last call from the agent or the last ancha world or ancha check command on it. The default is 30 minutes; the range is 1 second to 24 hours. Each of those renews the lease. After it expires, the world is gone and its commands fail with ENV_NOT_FOUND.

Saved worlds

--world <id> starts a world saved with ancha world create: its tools and starter data, with no task and no checks. ancha check then needs --test <file> to know which checks to apply.

ancha check

check evaluates the checks against the world as it is now: the final state of the tools and every call the agent made. It does not end the world, so you can run it before and after the agent, or after each step.
Output
A failed check shows what was expected and what the world held:
Output
The file’s pass list decides which checks are required. A check outside it is evaluated, printed with (not required), and does not change the verdict. Judge checks need OPENROUTER_API_KEY in the shell that runs ancha check and use judge.model from ancha.yaml. See Checks. With --json: ancha schema check prints the schema.

ancha world state

Prints the world’s current state, tool by tool, as JSON: Slack’s users, channels and messages, GitHub’s repositories, issues and pull requests, and so on for every tool in the world. The text output is the same JSON.

ancha world trace

Output
Each line is the sequence number, the simulated time, who made the call (agent, or the world itself), the tool, the method and path, and the status. Before any call it prints no calls yet. With --json, each entry also carries the response body and gap, which is true for a call to an endpoint the replica does not implement. Poll with --after <seq> to read only new entries.

ancha world down

Output
Removing a world that is already gone prints world b1p97rm9 was already gone and exits 0. With --json, removed is false.

Exit codes and errors

Live worlds belong to the project directory you ran world up from, so run the other commands from the same directory. ancha world list lists saved worlds, not live ones.