# Output formats

Source: https://libtmux.org/en/py/stable/workspace/reference/output/

> Read JSON results, NDJSON events and diagnostics from the workspace command.

Choose the output supported by each tmuxp command:

| Command | Machine output |
| --- | --- |
| [`ls`](https://libtmux.org/en/py/stable/workspace/cli/ls/) | `--json` returns an object containing `workspaces`; `--ndjson` returns records |
| [`search`](https://libtmux.org/en/py/stable/workspace/cli/search/) | `--json` and `--ndjson`; read the command's empty-result caveats |
| [`debug-info`](https://libtmux.org/en/py/stable/workspace/cli/debug-info/) | `--json` |
| [`freeze`](https://libtmux.org/en/py/stable/workspace/cli/freeze/), [`convert`](https://libtmux.org/en/py/stable/workspace/cli/convert/), imports | YAML or JSON workspace document output, separate from a result protocol |

```console
$ tmuxp ls --json
```

Do not assume every command accepts a global JSON mode. Read the
[command reference](https://libtmux.org/en/py/stable/workspace/cli/) for flags, prompts and destinations, and
[exit codes](https://libtmux.org/en/py/stable/workspace/reference/exit-codes/) before interpreting an empty stream as success.

`--color auto|always|never`, `NO_COLOR` and `FORCE_COLOR` control human styling.
Use explicit output formats when a script reads the result.

[Command source](https://github.com/tmux-python/tmuxp/blob/618b398acc05506d3c682906c36cdeb29dcfa1ff/src/tmuxp/cli/__init__.py).
