# Basic timeline editing

> Add tracks, place clips and read the project back.

Source: https://stuarty.com/docs/guide/timeline/

## You will learn

- how to add a track and a clip in one batch;
- how to read the project cheaply;
- how to put markers on the timeline.

## The editor window

The video editor opens from a project and takes the whole window, with no sidebar. Its parts:

- **The top bar.** The **Menu** (File, Edit, Clip, Timeline, View, Help), a back link to **Projects**, a link to the dashboard, the project name (click it to rename), the revision with the connection state (for example "Rev 12, live"), "Saved automatically", and on the right the command palette (`Ctrl+K`, `Cmd+K` on macOS), the keyboard shortcuts, **Export**, the activity of long jobs, the language and the theme. **Chat** opens the [agent chat](/docs/guide/agent-chat) over the editor.
- **The material panels**, on the left, as tabs: **Media**, **Audio**, **Text**, **Captions**, **Transitions**, **Filters**, **Templates**, **Effects** and **Animation**. A tab appears only when the project can do what it offers.
- **The preview**, in the middle, above the timeline ([Preview and playback](/docs/guide/preview)).
- **The inspector**, on the right, with one tab for each kind of thing the selection has settings for (its timing, transform, text, audio and so on). With nothing selected it shows the project panel ([Settings](/docs/guide/settings)). The tab you chose is remembered between selections. The history of the project is a panel beside it.
- **The agent bar**, at the foot, with what the agent is doing and its permission requests ([The dashboard and the sidebar](/docs/guide/dashboard)).

## Quick start

Add two tracks and a clip. The clip names the imported asset, where it starts on the timeline, where it starts in the source and how long it runs:

```json
{
  "project_id": "prj_7k2m9x4q1b",
  "base_revision": 1,
  "operations": [
    { "op": "track.add", "args": { "kind": "visual", "name": "Video", "id": "trk_f6g7h8j9k0" } },
    { "op": "clip.add", "args": {
      "track_id": "trk_f6g7h8j9k0", "asset_id": "ast_3c5v8n2w6d",
      "start": "0s", "source_in": "2s", "duration": "5s", "id": "itm_m1n2p3q4r5"
    } }
  ]
}
```

Send it with the `edit` MCP tool, `stuarty edit --project prj_7k2m9x4q1b --ops -` (the batch on standard input), or `POST /api/v1/projects/{id}/edit`. The result gives the new `revision`, the ids created and a `diff`.

Read the project back as text with `project_get` (or `project:show`). The concise view is meant to fit in two pages of a few thousand tokens even for a long project; follow `next_cursor` for the next page.

## Markers

A **marker** is a labelled point on the timeline. It changes neither the picture nor the sound: it helps you (or an agent) find a place again, and a marker with a label becomes a chapter of the exported MP4 or M4A file (a WAV and a GIF have no chapters). Time before the first labelled marker is an untitled first chapter.

| To | Operation |
| --- | --- |
| put a marker at a position (`at`), with an optional `label` of up to 60 characters | `marker.add` |
| move a marker (`to`) or change its label (an empty label removes it) | `marker.set` |
| remove the marker at a position, or every marker (`all`) | `marker.remove` |

```json
{ "op": "marker.add", "args": { "at": "12s", "label": "chorus" } }
```

In the editor, `M` adds a marker at the playhead, or removes the one there, and `Mod+Shift+Left` and `Mod+Shift+Right` jump to the previous and the next marker. The [audio page](/docs/guide/audio) shows how to mark the beats of a song.

## Common mistakes

- A clip longer than the asset, or a `source_in` past its end: `E_INVALID_TIME`.
- Two items on one track at the same time: `E_OVERLAP`.

## Next steps

- [Trim, split and move clips](/docs/guide/editing-tools)
