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

# guild agent logs

> Display build and validation step logs for an agent version.

`guild agent logs` retrieves and displays the build and validation step logs for an agent version. Use it to inspect TypeScript compiler output and other validation details without running a full `guild agent save --wait` cycle.

## Synopsis

```bash theme={null}
guild agent logs [identifier] [version-id]
```

## Arguments

| Argument       | Description                                                                                                     |
| -------------- | --------------------------------------------------------------------------------------------------------------- |
| `[identifier]` | Agent ID or full name (e.g., `owner~agent-name`). If omitted, reads from `guild.json` in the current directory. |
| `[version-id]` | ID of the version whose logs to display. If omitted, uses the latest version.                                   |

## Options

| Option   | Description                                              |
| -------- | -------------------------------------------------------- |
| `--json` | Output raw JSON instead of formatted text (global flag). |

## Output

Each build and validation step is printed with its status. SUCCEEDED displays in green, FAILED and ERRORED in red, RUNNING in yellow, and other statuses in dim text. Log content for each step follows its header line.

```text theme={null}
build  SUCCEEDED
────────────────────────────────────────────────────────────
validate  FAILED

src/index.ts(12,5): error TS2345: ...
src/index.ts(27,3): error TS7006: ...
```

If the version has no recorded steps, the command prints `No steps found`.

## Errors

| Condition                  | Exit code | Resolution                                                   |
| -------------------------- | --------- | ------------------------------------------------------------ |
| Not authenticated          | `1`       | Run `guild auth login`.                                      |
| Agent or version not found | `1`       | Run `guild agent list` or `guild agent versions <agent-id>`. |
| Cannot connect to server   | `1`       | Check your connection and run `guild doctor`.                |

## Examples

Inspect logs for the latest version of the agent in the current directory:

```bash theme={null}
guild agent logs
```

Inspect logs for a specific agent:

```bash theme={null}
guild agent logs owner~my-agent
```

Inspect logs for a specific version:

```bash theme={null}
guild agent logs owner~my-agent <version-id>
```

<Tip>
  Run `guild agent logs` after a failed `guild agent save --wait` or `guild agent revalidate` to re-inspect step details without triggering a new save.
</Tip>
