---
url: https://docs.mochiexec.io/guides/editing.md
description: >-
  Add and edit executables and workspace settings from the Mochi CLI or desktop
  app, without losing the comments and formatting in your flow files.
---

# Editing Executables

flow files are YAML you keep in your repo, and you can always edit them by hand. Mochi adds
edits that **preserve everything they don't touch**: comments, key order, and the
executables next to the one you changed. That's what lets the desktop app's editors write
to your files safely.

## Edit one executable

```sh
mochi executable edit "build my-project/app:image" --data '{ ... }'
```

Replaces one executable with a JSON definition. Other executables, file-level fields, and
comments outside that entry are kept.

## Add executables to a file

```sh
mochi executable add --file path/to/app.flow --content "$(cat snippet.yaml)"
```

Appends the executables from a flow-file snippet, keeping the rest of the target file.

## Edit a workspace

```sh
mochi workspace edit my-project --display-name "My Project" --tags go,api
```

Only the flags you pass are changed. Pass an empty value to clear a field.

flow docs: [Flow file reference](https://flowexec.io/types/flowfile)

Every field an executable definition can have.

## In the desktop app

* **Edit an executable**: **Edit** on its page opens it with a **Form** / **YAML** toggle,
  then **Save**.
* **Create one**: **New executable** on the Executables page (`⌘N`) starts **From a
  template**, as a **Blank file**, or, with AI on, by describing what you want.
* **Edit a workspace**: **Edit** on the workspace page changes its display name,
  description and tags, as a form or as YAML.

[Discovered](/guides/discovery) executables aren't edited here: change the file they come
from instead.
