---
title: "Output Formats"
description: "JSON output contracts and exit codes for integrating Merfolk into team workflows."
---

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

# Output Formats

## JSON output

Pass `--json` to any command to get structured output. JSON output is always valid and printed to **stdout**. Errors go to **stderr**.

### Diagram object

```json
{
  "id": "string",
  "title": "string",
  "content": "string",
  "createdAt": "ISO 8601 string",
  "updatedAt": "ISO 8601 string",
  "url": "https://app.merfolk.io/d/<id>"
}
```

### Comment object

```json
{
  "id": "string",
  "body": "string",
  "author": "string",
  "positionX": 0.0,
  "positionY": 0.0,
  "createdAt": "ISO 8601 string"
}
```

`positionX` and `positionY` are float percentages (0–100) of the diagram container's dimensions.

### Error object

```json
{
  "error": "human-readable message",
  "code": "ERROR_CODE"
}
```

## Table format

Without `--json`, commands print a human-readable table. Column widths adapt to terminal width. This format is not stable — do not parse it programmatically.

## Exit codes

| Code | Meaning                                           |
| ---- | ------------------------------------------------- |
| `0`  | Success                                           |
| `1`  | General error — details on stderr                 |
| `2`  | Authentication required — run `merfolk login`     |
| `3`  | Not found — the requested resource does not exist |

Source: https://docs.merfolk.io/reference/output-formats/index.mdx
