---
title: Muse Code CLI Headless Exec with PilotCut
description: Run muse exec with META_API_KEY against PilotCut's local MCP for batch cleanup on a .pcbundle. Approvals, sandbox flags, and MCP not-sandboxed warnings from Meta docs. BYO only.
url: https://www.pilotcut.com/blog/muse-code-cli-headless-exec-pilotcut
---

# Muse Code CLI Headless Exec with PilotCut

Run muse exec with META\_API\_KEY against PilotCut's local MCP for batch cleanup on a .pcbundle. Approvals, sandbox flags, and MCP not-sandboxed warnings from Meta docs. BYO only.

September 15, 2026 4 min read

## The short version

Interactive Muse Code is `muse` in a project. For scripts and batch cleanup, Meta documents **headless** runs: `muse exec "<prompt>"` with `META_API_KEY` in the environment ([auth](https://dev.meta.ai/docs/muse-code/auth), [headless](https://dev.meta.ai/docs/muse-code/extending#headless)).

Point that agent at [PilotCut](https://www.pilotcut.com/?utm_source=blog\&utm_medium=cta\&utm_content=muse-code-cli-headless-exec-pilotcut)'s **local MCP** so batch work mutates a real `.pcbundle`: **83 purpose-built editing tools, shaped by tens of thousands of hours of video-editing practice**, not Muse AI consumer tasks.

Muse Code remains **BYO via MCP/CLI**. It is not a PilotCut in-app catalog agent. PilotCut's featured agents are Claude Code, ChatGPT Codex, Grok Build, GitHub Copilot, OpenCode, Antigravity.

Tip

**Free during beta. Bring the agent you already pay for.** **83 purpose-built editing tools, shaped by tens of thousands of hours of video-editing practice.** The fastest editor for AI: 83 purpose-built tools, shaped by tens of thousands of hours of video-editing practice, so your agent and you waste less time and money. [Try PilotCut](https://www.pilotcut.com/?utm_source=blog\&utm_medium=cta\&utm_content=muse-code-cli-headless-exec-pilotcut).

## Install once, then exec

```
curl -fsSL https://dev.meta.ai/install.sh | sh
muse --version
```

Interactive auth once (browser or API key), or always supply the key for automation:

```
export META_API_KEY="<your-key>"
```

Per Meta, an environment API key takes priority over a stored browser session ([auth](https://dev.meta.ai/docs/muse-code/auth)).

## Wire PilotCut MCP before unattended runs

Declare PilotCut in Muse `mcp_servers` (`stdio` or `streamable_http`) while the PilotCut editor window that owns the `.pcbundle` is open ([MCP](https://dev.meta.ai/docs/muse-code/extending#mcp)).

Warning

**MCP tools are not sandboxed** (Meta). For headless runs, also read Meta's approval flags: `--disable-approval` keeps the OS sandbox but skips approval prompts; `--yolo` disables approval **and** the sandbox and trusts the workspace. Meta says use `--yolo` only on trusted code in a disposable, isolated container ([headless](https://dev.meta.ai/docs/muse-code/extending#headless)).

PilotCut's Core Agent chat panel gates on `riskTier`. Muse Code as a third-party MCP client does **not** get that gate. Prefer prompts that demand `confirm:false` plans first on silence/filler tools, then an explicit second step for `confirm:true`.

## Example headless shapes

```
META_API_KEY="$MUSE_KEY" muse exec \
  "On the open PilotCut .pcbundle, run edit-words cutSilences and removeDeadAir with confirm:false only. Print the plan. Do not apply."
```

```
META_API_KEY="$MUSE_KEY" muse exec --json \
  "Apply the reviewed silence plan with confirm:true, then export type=fcpxml to the path I specify."
```

```
muse exec --prompt-file ./pilotcut-batch-task.txt
```

Meta's exit codes reflect **how the run ended**, not whether the edit is correct (`0` turn complete, `1` fail/cancel, `2` usage error). Gate on your own checks after the run ([headless](https://dev.meta.ai/docs/muse-code/extending#headless)).

Optional: `--max-model-steps` caps a stuck loop. Resume with `muse exec --session-id <uuid> "Continue."` when you need a follow-up turn.

## What batch cleanup is good for

- Propose breath-safe silence / filler plans across talking-head takes
- Re-run the same prompt file after human review of the plan
- Write `export type=fcpxml` when the next stop is Final Cut

It is **not** text-to-video. It is **not** Muse AI. It is a coding agent calling PilotCut tools on local media.

## Eligibility and pricing

Meta positions Muse Spark 1.2 with **expanded global access** in Muse Code / Model API. Verify account eligibility at auth. Check Meta's live pricing pages for dollars. PilotCut stays free during beta with no editor-side credit meter for BYO agent edits.

## Facts (checked 2026-09-15)

| Item            | Value                                                                         |
| --------------- | ----------------------------------------------------------------------------- |
| Headless        | `muse exec "..."`; CI via `META_API_KEY`                                      |
| Approvals       | `--disable-approval` vs `--yolo` (see Meta docs)                              |
| MCP             | Not sandboxed                                                                 |
| PilotCut        | Free during beta; BYO agent; 83 tools; `export type=fcpxml`                   |
| Featured agents | Claude Code, ChatGPT Codex, Grok Build, GitHub Copilot, OpenCode, Antigravity |
| Muse Code       | BYO only, not catalog                                                         |

## Also read

- [How to use Muse Code with PilotCut MCP](https://www.pilotcut.com/blog/how-to-use-muse-code-with-pilotcut-mcp)
- [How to use Claude Code / ChatGPT Codex MCP/CLI without Resolve Studio](https://www.pilotcut.com/blog/how-to-use-claude-codex-mcp-cli-video-editing-without-resolve-studio)
- [Edit videos with AI agents](https://www.pilotcut.com/blog/edit-videos-with-ai-agents)

## Bottom line

Use `muse exec` + `META_API_KEY` for batch propose/apply loops on a `.pcbundle`, with Meta's sandbox and MCP warnings respected. Muse Code stays BYO outside the featured catalog list. Keep the cut on PilotCut's local timeline.

[Try PilotCut](https://www.pilotcut.com/?utm_source=blog\&utm_medium=cta\&utm_content=muse-code-cli-headless-exec-pilotcut). Free during beta. Bring the agent you already pay for.

## Related articles

[September 15, 2026](https://www.pilotcut.com/blog/how-to-use-muse-code-with-pilotcut-mcp)

## [How to Use Muse Code with PilotCut MCP](https://www.pilotcut.com/blog/how-to-use-muse-code-with-pilotcut-mcp)

[BYO Meta Muse Code into PilotCut's local MCP: free during beta, confirm protocol on silence cuts, breath-safe snap, export type=fcpxml. Muse Code is not an in-app catalog agent.](https://www.pilotcut.com/blog/how-to-use-muse-code-with-pilotcut-mcp)

[4 min read](https://www.pilotcut.com/blog/how-to-use-muse-code-with-pilotcut-mcp)

[September 8, 2026](https://www.pilotcut.com/blog/how-to-use-claude-codex-mcp-cli-video-editing-without-resolve-studio)

## [How to Use Claude / Codex with MCP/CLI for Video Editing (Without Resolve Studio)](https://www.pilotcut.com/blog/how-to-use-claude-codex-mcp-cli-video-editing-without-resolve-studio)

[Searching for Resolve 21.1 MCP setup with Claude or ChatGPT Codex? Here is the Studio path in brief — then the PilotCut path: BYO agent via terminal MCP/CLI on a local Mac project, free during beta.](https://www.pilotcut.com/blog/how-to-use-claude-codex-mcp-cli-video-editing-without-resolve-studio)

[5 min read](https://www.pilotcut.com/blog/how-to-use-claude-codex-mcp-cli-video-editing-without-resolve-studio)

[April 29, 2026](https://www.pilotcut.com/blog/edit-videos-with-ai-agents)

## [How to Edit Videos with AI Agents](https://www.pilotcut.com/blog/edit-videos-with-ai-agents)

[A practical way to think about agent-assisted video editing: use AI for structure and repetition, then keep human taste in the final pass.](https://www.pilotcut.com/blog/edit-videos-with-ai-agents)

[1 min read](https://www.pilotcut.com/blog/edit-videos-with-ai-agents)
