---
title: "Discover, test and retest"
description: "The usable path from repository discovery to evidence from a CLI or cloud run."
canonical: "https://agenttwin.si/docs/workflow/"
---

# Discover, test and retest

The usable path from repository discovery to evidence from a CLI or cloud run.


<Steps>
  <Step title="Discover your repository">Run `npx agenttwin init`. Review detected dependencies and code paths. Launch an installed OpenCode session with `--agent opencode`, or give `.agenttwin/AGENT-TASK.md` to your coding agent. Supply missing inputs and expected outcomes.</Step>
  <Step title="Review your environment">Connect your dashboard account and run `npx agenttwin sync` with `AGENTTWIN_TOKEN` configured. Alternatively import discovery JSON. Inspect resource coverage and unsupported dependencies. No production account is copied.</Step>
  <Step title="Prepare actual application files">Choose a candidate in Workflows. Edit the exported preparation contract with the real built Node entrypoint, files, reviewed operation mappings, synthetic starting state, faults and assertions. Run `npx agenttwin prepare --file preparation.json` in the project.</Step>
  <Step title="Test your workflow">Review the files, fixtures and assertions. Run `npx agenttwin run --file path/to/agenttwin.world.json` from your repository; supported Node workflows use in-process service twins. Run `npx agenttwin sync` to see evidence on the website. Choose cloud execution explicitly when the workflow needs it.</Step>
  <Step title="Inspect the outcome">Open Runs to retrieve account-owned jobs, cancel active runs and inspect receipts. Check assertions, state, events and application logs. A receipt passing its assertions is evidence for those configured checks.</Step>
  <Step title="Fix and retest">Export the Fix &amp; retest task to your coding agent in the original repository. Make the justified code change, rebuild and review a new bundle, and execute in another fresh sandbox. Compare receipts; no automatic fix or deterministic model replay is promised.</Step>
</Steps>

Users with their own E2B account can configure direct CLI execution instead of the hosted API. The CLI is the default. Cloud execution is optional; PostgreSQL and Redis worlds currently require it. See the repository’s `packages/cli/README.md` for the preparation schema and commands.
