# Convert workspace files

Source: https://libtmux.org/en/py/stable/workspace/cli/convert/

> Convert a complete workspace document between YAML and JSON.

Convert a workspace document between YAML and JSON while retaining its mapping
keys.

## Change the file format

Given [`workspace.yaml`](https://libtmux.org/en/py/stable/workspace/guides/installation/#create-the-input) from the [installation
walkthrough](https://libtmux.org/en/py/stable/workspace/guides/installation/):

```console
$ tmuxp convert \
    --yes \
    workspace.yaml
```

The destination has the same stem and opposite extension. `--yes` permits
replacement of an existing destination. The original input remains. YAML
comments and textual formatting do not round-trip through JSON.

The command resolves a file or saved workspace name.
[Discovery](https://libtmux.org/en/py/stable/workspace/guides/discovery/) describes that lookup.

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