# swarmops ws diff

> Release: 0.11.0 · Last changed: 2026-11-08 · Source: https://github.com/KeiaiLab/SwarmOps/blob/stable/docs/reference/commands/ws-diff.md

A workspace's edits against its head, as diff gives a diff.

```yaml
title: "swarmops ws diff"
description: "A workspace's edits against its head, as diff gives a diff."
group: "workspaces"
since: "0.3.0"
mutates: false
identity_required: false
mcp_tool: "ws_diff"
envelope_op: "ws_diff"
exit_codes: [0]
errors: []
syntax: "swarmops ws diff [OPTIONS] [PATH]..."
```

## Syntax

```text
swarmops ws diff [OPTIONS] [PATH]...
```

## Required arguments

None.

## Optional arguments

The command also takes the [global options](../cli.md#global-options).

### `--ws`

Syntax: `--ws <NAME>`.

The workspace, by its name in the store's registry (default: the one around the working directory).

### `--ws-path`

Syntax: `--ws-path <DIR>`.

The workspace's directory.

### `PATH`

Syntax: `<PATH>`.

Only these repository paths, and what is below them.

### `--format`

Syntax: `--format <FORMAT>`.
Default: `names`.

What to say of each file. Values: `names`: Its path and status; `stat`: Also whether it is binary and, for text, the lines it inserts and deletes; `unified`: Also its kinds, its blobs and, for text, its hunks.

### `--context`

Syntax: `--context <N>`.
Default: `3`.

The unchanged lines around each change in a unified hunk.

### `--limit`

Syntax: `--limit <N>`.
Default: `500`.

The most files to print.

### `--cursor`

Syntax: `--cursor <C>`.

Where the previous page stopped.

### `--max-bytes`

Syntax: `--max-bytes <N>`.
Default: `32768`.

The most bytes of unified text.

## Examples

### CLI

No recorded example yet.

### MCP

No recorded example yet.

## Return information

`result` is a `Diff` (`swarmops schema Diff` prints its JSON Schema).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string or null` | no | When `truncated`: where the next page starts. Opaque: pass it back as given, as the next request's `cursor`. |
| `files` | `array of FileDiff` | yes | The files. |
| `from` | `string` | yes | The changeset `from` named. |
| `to` | `string` | yes | The changeset `to` named. |
| `truncated` | `boolean` | yes | Whether more files follow this page. |

Envelope `op`: `ws_diff`.

Exit codes:

- `0`: Success.

## Errors

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as [`E_NOT_A_REPO`](../errors.md#e_not_a_repo), [`E_IO`](../errors.md#e_io) or [`E_STORE_CORRUPT`](../errors.md#e_store_corrupt); a command line the grammar refuses is [`E_INVALID_ARG`](../errors.md#e_invalid_arg) (exit 2).

## See also

- [`swarmops ws create`](ws-create.md)
- [`swarmops ws status`](ws-status.md)
- [`swarmops ws commit`](ws-commit.md)
- [`swarmops ws rebase`](ws-rebase.md)
- [`swarmops ws resolve`](ws-resolve.md)
- [`swarmops ws land`](ws-land.md)
- [`swarmops ws materialize`](ws-materialize.md)
- [`swarmops ws discard`](ws-discard.md)
- [`swarmops ws snapshot`](ws-snapshot.md)
- [`swarmops ws list`](ws-list.md)
- [`swarmops ws info`](ws-info.md)
- [`swarmops ws delete`](ws-delete.md)
- [`swarmops ws hook`](ws-hook.md)
- [CLI reference](../cli.md)
- [Error codes](../errors.md)
