> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ancha.io/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli version 0.1.4, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli@0.1.4` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# Results in your workspace

> Send the results of runs on your computer to your hosted workspace with ancha run --upload or ancha runs upload, what the upload holds and redacts, and how the console shows and deletes them.

A run's results normally stay in `.ancha/runs/` on the computer that ran it. `--upload` sends a finished run to your hosted workspace as well, where the console shows it to anyone with access to the workspace.

```bash theme={null}
ancha run --upload            # or ANCHA_UPLOAD=1 in the environment
ancha runs upload latest      # a run that already finished, or a run id
```

```text Output theme={null}
uploaded: https://app.ancha.io/runs/run_20261031-234205_e9f7049f942a39d5
```

Uploading needs a workspace: `ancha login` on your computer, or `ANCHA_SERVER_URL` and `ANCHA_API_KEY` in CI. The worlds of the run still ran wherever `ancha run` put them; a saved login keeps them on your computer. See [`ancha run`](https://docs.ancha.io/cli/run#results-in-your-workspace) and [`ancha runs`](https://docs.ancha.io/cli/runs).

## What is uploaded

| File | Contents |
| - | - |
| `summary.json` | The run's summary: verdict, pass rates, check tallies, failures, issues and coverage gaps. |
| `inputs.json` | The scenes and seeds the run used, and how the agent was executed. |
| `trial-<scene>-<n>/agent.log` | What the agent printed, the last 4 MB of it. |
| `trial-<scene>-<n>/trace.jsonl` | Every API call with request and response. |
| `trial-<scene>-<n>/state.json` | The final state of every tool. |
| `trial-<scene>-<n>/checks.json` | Each check's result with expected, actual and explanation. |

The upload also records the CLI version and, in a git repository, the commit the run tested.

## What is redacted

Before the files leave your computer, the values of the variables the agent got through `--pass-env`, `agent.pass_env` or `--inherit-env`, and the values in `.ancha/openrouter.env`, are replaced with `[redacted]` wherever they appear. The tools' fake credentials are not secrets and stay as they are. Your API key for the workspace is never part of a run.

## Limits

* The agent's log is cut to its last 4 MB per attempt.
* Each upload is at most 50 MB.
* A workspace keeps up to 500 MB of results. When it is full, an upload is refused with a hint, and the run keeps its own exit code; make room by deleting old runs in the console with **Delete run**.
* Uploading the same run again replaces its copy in the workspace.

## The Runs page

The **Runs** page of the console lists uploaded runs next to the runs the workspace ran itself, and it works while the workspace machine is asleep. Each run opens at `https://app.ancha.io/runs/<run id>` with its attempts, checks and evidence, read-only. **Delete run** removes an uploaded run from the workspace; the copy in `.ancha/runs/` on your computer is untouched. Uploading does not use the workspace's machine time.

## When an upload fails

A failed upload is a warning: `ancha run` keeps the run's own exit code and prints why the upload failed, and `ancha runs upload <run id>` tries again. Pass `--upload-required` to make a failed upload fail the command, for a CI job whose results must arrive. A run started with `--detach` uploads when it finishes; `ancha wait <run id>` and `ancha status <run id>` say where the results went.

## CI

Store the workspace URL and a key from **Settings** as secrets, run the worlds on the CI runner with `--local`, and upload the results:

```yaml .github/workflows/ancha.yml theme={null}
      - name: Run Ancha
        run: npx -y @ancha-labs/cli@0.1.4 run --local --upload --json
        env:
          ANCHA_SERVER_URL: ${{ secrets.ANCHA_SERVER_URL }}
          ANCHA_API_KEY: ${{ secrets.ANCHA_API_KEY }}
```

Leave out `--local` to run the worlds in the workspace instead; that uses its machine time. See [CI](https://docs.ancha.io/cloud/ci.md).


## Related topics

- [ancha run](https://docs.ancha.io/cli/run.md)
- [Hosted workspace](https://docs.ancha.io/cloud/overview.md)
- [ancha runs](https://docs.ancha.io/cli/runs.md)
- [CI](https://docs.ancha.io/cloud/ci.md)
- [Changelog](https://docs.ancha.io/changelog.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.