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

# cowboy check

> Compile an actor target offline, apply the chain's source rules, and price its off-chain calls

## Synopsis

```bash theme={null}
cowboy check [<target>] [--json | --watch]
cowboy check --code <path> [--json]
```

`cowboy check` is the one command that says whether an actor is deployable. It compiles the target (running the PVM continuation pass), lints the artifact against the determinism and sandbox rules the interpreter enforces, and reports what one off-chain `await` will cost. It opens no socket.

## Behavior

1. Discover the project from the current directory (not needed with `--code`).
2. Select what to check: the named target; the project's only actor; every target when the project has several and none is named; or, with `--code`, a standalone Python source file (`-` reads stdin).
3. Compile the selection and apply the source rules. Rules the compiler does not enforce (for example `import time`, allowed but superseded by the SDK) are reported as warnings located in the file the developer edits, not in the generated artifact.
4. Print `Actor target '<name>' is valid.` with the build identity, code hash, and artifact size.
5. For a target that reaches off-chain calls, print `Cost per off-chain call:` with the resource tier, the compressed delta size and cold-fetch units from the last build (or why they are unavailable), and the escrow formula. The compute term needs on-chain fee rates, so `check` prints the inputs and the formula; `cowboy deploy` prints the number.

Under `--json` the result carries `target`, `build_identity`, `artifact_bytes`, `artifact_code_hash`, `requirements`, `experimental`, `unresolved_requirements`, `offchain_price`, `offchain_calls`, `routes`, and always the project's full `targets` list. A project-wide check puts each result in `checked_targets`.

## Flags

| Flag | Default | Description |
| - | - | - |
| `<target>` | Inferred when the project has one actor | Actor target name; conflicts with `--code` |
| `--code` | None | Python source file to check instead of a project target |
| `--watch` | `false` | Recheck the project and refresh editor typings after relevant saves; conflicts with `--json` and `--code` |
| `--json` | `false` | Emit one versioned JSON result object |

## Example

```bash theme={null}
$ cowboy check
✓ Actor target 'demo' is valid.
  Build identity: a3626f6bf5...
  Code hash: 0x9c0d...
  Artifact bytes: 4120
```

```bash theme={null}
$ cowboy check --code handler.py
✓ handler.py passes the actor source rules.
```

## Edge Cases

* A project with no actor targets prints `No actor targets found.` and exits 0; under `--json` the `targets` array is empty.
* A rule violation fails with exit code 1 and every broken rule reported, not just the first.
* `check` never reads the chain: the off-chain price section shows inputs and a formula only.


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