---
title: "Manage projects"
description: "Open, play, pause, stop, reload, close and remove projects on the runtime, follow what it's doing, and recover a stream that failed."
type: "docs-page"
url: "https://tatolab.com/docs/run/manage"
site: "Tatolab"
section: "Run from the CLI"
---

# Manage projects

> Open, play, pause, stop, reload, close and remove projects on the runtime, follow what it's doing, and recover a stream that failed.

> **Note**
>
> This page is the command line. In Tato Studio, the same things are the Projects window, the **Run** menu and closing a project's window: see [Projects](https://tatolab.com/docs/studio/projects) and [Run and watch](https://tatolab.com/docs/studio/run).

Every stream runs inside the machine's runtime. The `tatolab` CLI, Tato Studio and agents ask the runtime to open, play and stop projects; none of them runs a stream itself. This page covers those commands, and how a project, its streams and the actions on them fit together.

## Projects and streams

A **project** is a folder holding `tatolab-project.json`. Each graph document in its `streams/` folder, `streams/<name>.graph.json`, is one **stream**. The runtime opens a project as a whole: every stream in it is loaded, side by side, and the project plays, pauses and stops as one.

```txt
cameras/
├── tatolab-project.json
├── pyproject.toml
├── nodes/
└── streams/
    ├── front-door.graph.json
    └── garage.graph.json
```

Opening this project loads two streams, `front-door` and `garage`. To run one without the other, put them in separate projects.

## A project's life

| Command | What happens |
|---|---|
| `tatolab new [DIR]` | Creates a project, from the starter or `--sample NAME`, and opens it, held stopped |
| `tatolab open` | Opens a project: loads each of its streams, held stopped. `--play` plays it after. |
| `tatolab play` | Plays an open project: each stream starts fresh from the graph it holds |
| `tatolab pause` | Pauses every stream of the project at once, each node holding its state |
| `tatolab resume` | Resumes a paused project from where it stood |
| `tatolab stop` | Ends playback: every node, device claim and clock torn down. The graphs stay loaded to read and edit. |
| `tatolab reload` | Reads the project from disk again, keeping its playback |
| `tatolab close` | Ends playback and unloads its streams, deleting nothing |
| `tatolab rm` | Unloads its streams and forgets the project, deleting nothing |
| `tatolab dev` | Opens or reloads, plays, follows the log, and reloads on every save |

Each acts on the project in the current folder, or the one `--dir` names. A verb that doesn't fit the project's state is refused, naming the one that does: `open` on an open project names `reload`, `play` on a paused one names `resume`.

`new`, `open`, `reload`, `play`, `stop`, `close` and `rm` don't wait: each asks the runtime for a **stream action**, prints its ID, and returns.

```sh
tatolab open --dir ~/cameras
```

```txt title="Output"
Rk3x9q2m7v1c8b4n6p0w5z2ty-4 queued: open of /home/you/cameras
  follow it: tatolab logs -f --dir /home/you/cameras
```

An open or reload works in steps:

1. **Makes the project's `.venv`** with the uv it carries, if it's missing or its Python doesn't run. The first time, that downloads Python and your dependencies, which can take a while.
2. **Reads the graph documents**, and describes each node type they name in the project's own Python, which imports your node code.
3. **Loads** each stream, held stopped for an open, or as it was for a reload.

Each project has a queue of its own. Its actions run one at a time, in the order you asked for them, and a slow `.venv` in one project never holds up another. While a stream is being loaded, `tatolab streams` shows it as `preparing`, with the step it's on.

## Projects stay open

Every project the runtime opens is recorded, playing, paused or stopped as it is. It stays that way after the command returns, after you close the terminal, and after an agent that opened it disconnects. Each time the runtime starts, it opens every recorded project again, as it was, until you close or remove it.

The runtime runs while Tato Studio is open, or wherever you start `tatolabd`: in a terminal, or under systemd. See [Install Tato](https://tatolab.com/docs/install).

## See what's loaded

```sh
tatolab streams
```

```txt title="Output"
ID                          NAME         STATE      NODES  PROJECT                ASSET
cameras-front-door-51c7a2   front-door   running    4      /home/you/cameras      2b7e…
cameras-garage-9b0e14       garage       running    3      /home/you/cameras      8c1d…
door-camera-main-3f2a9c     door-camera  preparing  -      /home/you/door-camera  6f1c…

door-camera-main-3f2a9c making_the_venv
```

| State | Means |
|---|---|
| `running` | Playing |
| `paused` | Paused, its nodes holding their state |
| `stopped` | Loaded, not playing. Its graph reads and edits. |
| `closed` | Its project is closed |
| `preparing` | An action that loads it is queued or under way, on the step named below the table |
| `stopping` | An action that ends its playback is queued or under way |
| `failed` | It couldn't load or start. The reason is printed below the table. |

## Names and IDs

Each stream has an **ID**, such as `cameras-front-door-51c7a2`: the project's name, the graph document's name, and a short hash of the project's UUID and the stream's. Moving the project or renaming the document keeps it. A copy made with a new project UUID gets new IDs, so two copies never collide. `tatolab graph --stream`, `tatolab clock` and `tatolab logs --stream` take a stream by its ID.

Each stream also has a **display name**, shown in `NAME`: the `display_name` its document writes, or the document's file name. Change it in Tato Studio, or with the `set_stream_display_name` operation; the ID stays the same.

## Follow an action, or cancel it

Each action's records go into the project's log, so following the log is following the action:

```sh
tatolab logs -f                                          # everything in this project's log
tatolab logs --action Rk3x9q2m7v1c8b4n6p0w5z2ty-4        # just what that action wrote
```

Changed your mind? `cancel` takes an action back:

```sh
tatolab cancel Rk3x9q2m7v1c8b4n6p0w5z2ty-4
```

A queued action is dropped. An open or reload under way stops at its current step.

## Change a running stream

A stream is its graph document. An edit made in Tato Studio, by an agent, or with `tatolab call`, is applied to the running stream, written to the document, and recorded as one commit on the project's history in `.tatolab/history.git`, so the next load keeps it and undo takes it back. A change you make to a file yourself takes effect at the next reload: `tatolab reload`, or a save under `tatolab dev`. A reload keeps each stream's ID, and brings its graph to the document in place while the node code is unchanged.

## When a stream fails

A load never stops because of what a document or your code holds. A stream that can't load is listed **failed**, with the reason below the table and in the project's log, and the project's other streams still load:

- **The document doesn't read**, or the load is refused: failed until a reload of the fixed document.
- **A node type isn't described** by the project's code: failed and held stopped, each node of that type kept as written and reading `Error`, until a reload of the fixed code.
- **Some links don't validate**: failed and held stopped, each such link kept as drawn, reading `error` with its reason, until an edit removes or fixes it.
- **It won't start**, or the `.venv` can't be made: failed and held stopped; `tatolab play` tries again.
- **It was involved in the runtime's last two crashes in a row**: held stopped at the next start from its document alone, with none of its node code read, until `tatolab reload` tries it for real.

A stream whose document is deleted is unloaded and forgotten.

## The edit loop in detail

`tatolab dev` watches the project's `.py` files, its graph documents, `tatolab-project.json` and `pyproject.toml`. After each save it queues a reload, refreshes any fragment a [graph generator](https://tatolab.com/docs/build/graphs#graph-generators) built from a changed module, and prints the records the reload and the streams write. A stream whose code fails, say a syntax error in a node module, is listed failed, its traceback printed in your terminal, until a save that loads. Ctrl-C ends `dev` and leaves the project playing.

## The runtime

Every command on this page needs the runtime running. Without it, each one stops at once:

```txt
error: no runtime is running on this machine: nothing answers at /run/user/1000/streamlib/local-api.sock. Start one by opening Tato Studio, or by running `tatolabd` in a terminal.
```
