# `npx @sanity/cli blueprints logs`

Retrieve deployment logs for one remote Stack. Prefer bounded, one-shot queries for agent work.

## Query logs

Request structured output with an explicit limit:

```sh
npx @sanity/cli blueprints logs --limit 100 --json
```

Narrow a query with ISO 8601 timestamps:

```sh
npx @sanity/cli blueprints logs --since 2026-07-29T00:00:00Z --limit 100 --json
```

Use `--before` to page toward older entries. `--limit` must be between 1 and 500; without it the API's default page size applies. When entries are found, the JSON result contains `logs` and `hasMore`; an empty range returns no JSON payload.

Pass `--stack NAME_OR_ID` with `--project-id PROJECT_ID` or `--organization-id ORGANIZATION_ID` when overriding the locally configured target.

## Watch mode

`--watch` (`-w`, alias `--follow`) prints the 10 most recent entries, then polls for new ones until interrupted. It cannot be combined with `--json`, `--limit`, `--since`, or `--before`.

Use watch mode only when continuous monitoring is requested:

```sh
npx @sanity/cli blueprints logs --watch
```

If no expected logs appear, run `blueprints info --json` and verify the Stack ID and deployment status.
