# Edit by prompting an agent, end to end

> Connect an agent through MCP or the CLI, ask for a cut, and watch it import, edit, check and export.

Source: https://alexgalhardo.github.io/vukem-video/docs/guide/tutorial-agent-edit/

## You will learn

- how to connect an agent and what it can do;
- the order in which a good agent works, and the commands it runs;
- how you check its work.

## The idea

The agent uses the same commands you do. Through MCP it calls tools such as `edit`, `lint` and `view`; with a shell it runs the same operations from the CLI. Every edit is a numbered revision with the name of the agent, so you can read the history and undo any step. Nothing is sent over the network by the product itself.

## Steps

1. Connect the agent. For Claude Code:

```bash
   claude mcp add vukem-video -- vukem-video mcp
```

   Other clients take the same command, see [Connect an agent](/docs/agents/connect). If you run the editor, the agent and the browser share the project.

2. Teach it the product. `vukem-video agent:docs --print skill` prints the skill and `--print agents` the snippet for your `AGENTS.md`; see [The skill](/docs/agents/skill).

3. Ask in plain words, for example: "Import `interview.mp4`, remove the silences, caption the speech and export a 9:16 video."

4. The agent works in this order. You can follow it in the history.

   | Step | MCP tool | CLI |
   | --- | --- | --- |
   | create the project | `project_create` | `vukem-video project:create --name "Interview" --id prj_7k2m9x4q1b` |
   | import the media | `media_import` | `vukem-video media:import interview.mp4 --project prj_7k2m9x4q1b --asset-id ast_3c5v8n2w6d` |
   | learn the operations | `command_help` | `vukem-video command:help clip.add` |
   | edit in one batch | `edit` | `vukem-video edit --project prj_7k2m9x4q1b --ops -` |
   | transcribe | `job_start` with `"kind": "transcribe"` | `vukem-video transcribe --project prj_7k2m9x4q1b --asset ast_3c5v8n2w6d --wait` |
   | check | `lint`, then `view` | `vukem-video lint --project prj_7k2m9x4q1b` |
   | export | `job_start` with `"kind": "export"` | `vukem-video export --project prj_7k2m9x4q1b` |

5. Read what it did. The agent sees the same history you do:

```bash
   vukem-video history --project prj_7k2m9x4q1b
```

6. Undo what you do not like. `vukem-video undo --project prj_7k2m9x4q1b` reverts the last step, and the agent can redo or try again.

## How to check its work

An agent should look the cheapest way first: read the project as text, run `lint`, then look at frames with `view`. [How an agent verifies its work](/docs/agents/verify) explains the order. Ask the agent to run `lint` before every export; the export is refused while the lint finds an error.

## Common mistakes

- Letting two actors edit from an old revision: `E_REVISION_CONFLICT`. The agent reads the project again and plans again; see [Recipes](/docs/agents/recipes).
- Asking for transcription before the helper is installed. A person installs it once with `vukem-video tools:install whisper`.
- Giving the agent a path on another machine. Paths are read on the machine that runs the server.

## Next steps

- [The MCP server](/docs/agents/mcp)
- [Safety for agents](/docs/agents/safety)
- [Recipes: cut, caption, export](/docs/agents/recipes)
