Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(mcp): fail a crashed runner instead of hanging, and close finished runners

EtienneLescot4814b22871ca
diff --git a/electron/cli/cliMain.ts b/electron/cli/cliMain.ts
index b3ed45792..1aeffd079 100644
--- a/electron/cli/cliMain.ts
+++ b/electron/cli/cliMain.ts
@@ -450,17 +450,10 @@ export function runCli(command: CliCommand): void {
}
});
- runnerWindow.webContents.on("did-fail-load", (_e, code, description) => {
- output.error(`Failed to load runner window: ${description} (${code})`);
- app.exit(1);
- });
+ // A crash or a failed load ends the run through `run.done`, reported below.
app.on("child-process-gone", (_e, details) => {
milestone(`child-process-gone: ${details.type} (${details.reason})`);
});
- runnerWindow.webContents.on("render-process-gone", (_e, details) => {
- output.error(`Renderer crashed: ${details.reason}`);
- app.exit(1);
- });
output.event("started", { command: command.kind });
diff --git a/electron/cli/runnerHost.test.ts b/electron/cli/runnerHost.test.ts
index 9ae8c7472..3f0abde77 100644
--- a/electron/cli/runnerHost.test.ts
+++ b/electron/cli/runnerHost.test.ts
@@ -20,15 +20,28 @@ class FakeIpc {
}
}
+/** Whatever a runner window event passes its listener. */
+type WindowListener = (...args: never[]) => void;
+
class FakeWindow {
readonly events = new EventEmitter();
readonly webContents;
+ destroyed = false;
constructor(id: number) {
+ const listen = (listener: WindowListener) => listener as (...args: unknown[]) => void;
this.webContents = {
id,
- once: (event: "destroyed", listener: () => void) => this.events.once(event, listener),
+ once: (event: string, listener: WindowListener) => this.events.once(event, listen(listener)),
+ on: (event: string, listener: WindowListener) => this.events.on(event, listen(listener)),
};
}
+ isDestroyed() {
+ return this.destroyed;
+ }
+ destroy() {
+ this.destroyed = true;
+ this.events.emit("destroyed");
+ }
}
function setup() {
@@ -88,6 +101,33 @@ describe("createRunnerHost", () => {
});
});
+ it("fails a run whose renderer crashes or whose page does not load, instead of hanging", async () => {
+ const { host, opened } = setup();
+ const crashed = host.start(sources);
+ opened[0].window.events.emit("render-process-gone", {}, { reason: "oom" });
+ await expect(crashed.done).resolves.toEqual({
+ success: false,
+ error: "Renderer crashed: oom",
+ });
+
+ const unloaded = host.start(sources);
+ // A subframe failing is not the runner failing.
+ opened[1].window.events.emit("did-fail-load", {}, -3, "ABORTED", "x", false);
+ opened[1].window.events.emit("did-fail-load", {}, -6, "FILE_NOT_FOUND", "x", true);
+ await expect(unloaded.done).resolves.toMatchObject({
+ success: false,
+ error: expect.stringContaining("FILE_NOT_FOUND (-6)"),
+ });
+ });
+
+ it("closes a finished runner's window once, when asked", () => {
+ const { host, opened } = setup();
+ const run = host.start(sources);
+ run.close();
+ run.close();
+ expect(opened[0].window.isDestroyed()).toBe(true);
+ });
+
it("fails a run whose window goes away, and ignores a second result", async () => {
const { ipc, host, opened } = setup();
const run = host.start(sources);
diff --git a/electron/cli/runnerHost.ts b/electron/cli/runnerHost.ts
index 22f7f0b6b..7475aa2dc 100644
--- a/electron/cli/runnerHost.ts
+++ b/electron/cli/runnerHost.ts
@@ -10,9 +10,25 @@ import type { CliDoneResult, CliProgressEvent, CliRequest } from "../../src/lib/
/** The slice of a BrowserWindow this needs. */
export interface RunnerWindow {
+ isDestroyed(): boolean;
+ destroy(): void;
webContents: {
id: number;
once(event: "destroyed", listener: () => void): unknown;
+ on(
+ event: "render-process-gone",
+ listener: (event: unknown, details: { reason: string }) => void,
+ ): unknown;
+ on(
+ event: "did-fail-load",
+ listener: (
+ event: unknown,
+ errorCode: number,
+ errorDescription: string,
+ validatedURL: string,
+ isMainFrame: boolean,
+ ) => void,
+ ): unknown;
};
}
@@ -32,8 +48,10 @@ export interface RunnerHandlers {
export interface RunnerRun<W> {
window: W;
- /** The runner's own result; a window that goes away first fails the run. */
+ /** The runner's own result. A window that closes, crashes or fails to load fails the run. */
done: Promise<CliDoneResult>;
+ /** Closes the runner's window: a long-lived caller does once it has the result. */
+ close(): void;
}
interface PendingRun {
@@ -83,13 +101,29 @@ export function createRunnerHost<W extends RunnerWindow>(
const done = new Promise<CliDoneResult>((resolve) => {
runs.set(id, { request, handlers, resolve });
});
- window.webContents.once("destroyed", () => {
+ // A runner that never reports would otherwise hold its caller forever.
+ const fail = (error: string) => {
const run = runs.get(id);
if (!run) return;
runs.delete(id);
- run.resolve({ success: false, error: "The runner window closed before it finished" });
+ run.resolve({ success: false, error });
+ };
+ window.webContents.once("destroyed", () =>
+ fail("The runner window closed before it finished"),
+ );
+ window.webContents.on("render-process-gone", (_event, details) =>
+ fail(`Renderer crashed: ${details.reason}`),
+ );
+ window.webContents.on("did-fail-load", (_event, code, description, _url, isMainFrame) => {
+ if (isMainFrame) fail(`Failed to load runner window: ${description} (${code})`);
});
- return { window, done };
+ return {
+ window,
+ done,
+ close: () => {
+ if (!window.isDestroyed()) window.destroy();
+ },
+ };
},
};
}
diff --git a/electron/mcp/hidden-video.ts b/electron/mcp/hidden-video.ts
index 8cfa2b0b0..a2f94e6c8 100644
--- a/electron/mcp/hidden-video.ts
+++ b/electron/mcp/hidden-video.ts
@@ -78,7 +78,7 @@ export async function openVideoInHiddenWindow(videoPath: string): Promise<Opened
const dataUrl = (await withTimeout(
win.webContents.executeJavaScript(`new Promise((resolve) => {
const video = window.__video;
- video.onseeked = () => {
+ const draw = () => {
const scale = Math.min(1, ${maxWidth} / video.videoWidth);
const canvas = document.createElement("canvas");
canvas.width = Math.round(video.videoWidth * scale);
@@ -86,7 +86,13 @@ export async function openVideoInHiddenWindow(videoPath: string): Promise<Opened
canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);
resolve(canvas.toDataURL("image/jpeg", 0.85));
};
- video.currentTime = ${timeSec};
+ // A seek to where the video already is may never fire "seeked".
+ if (Math.abs(video.currentTime - ${timeSec}) < 1e-3 && video.readyState >= 2) {
+ draw();
+ } else {
+ video.onseeked = draw;
+ video.currentTime = ${timeSec};
+ }
})`),
`seeking to ${timeSec}s`,
)) as string;
diff --git a/electron/mcp/media-tools.test.ts b/electron/mcp/media-tools.test.ts
index 18ea55c1d..c49726f76 100644
--- a/electron/mcp/media-tools.test.ts
+++ b/electron/mcp/media-tools.test.ts
@@ -31,15 +31,25 @@ class FakeRunners {
readonly started: CliRequest[] = [];
recordStarts = true;
results: Partial<Record<CliRequest["kind"], CliDoneResult>> = {};
+ /** Set: exports stay running until `releaseExport` is called. */
+ holdExport = false;
+ releaseExport: () => void = () => undefined;
+ open = 0;
constructor(private readonly videoPath: string) {}
start(request: CliRequest, handlers: RunnerHandlers = {}) {
this.started.push(request);
+ this.open++;
let finish: (result: CliDoneResult) => void = () => undefined;
const done = new Promise<CliDoneResult>((resolve) => {
finish = resolve;
});
+ let isOpen = true;
+ const close = () => {
+ if (isOpen) this.open--;
+ isOpen = false;
+ };
const window = {
webContents: {
send: (channel: string) => {
@@ -49,14 +59,17 @@ class FakeRunners {
},
},
};
- if (request.kind !== "record") {
- finish(this.results[request.kind] ?? { success: true });
+ const result = this.results[request.kind] ?? { success: true };
+ if (request.kind === "export" && this.holdExport) {
+ this.releaseExport = () => finish(result);
+ } else if (request.kind !== "record") {
+ finish(result);
} else if (this.recordStarts) {
queueMicrotask(() => handlers.onLog?.("info", "Recording started"));
} else {
finish({ success: false, error: "Recording did not start within 30s" });
}
- return { window, done };
+ return { window, done, close };
}
}
@@ -80,6 +93,7 @@ let videoPath = "";
let documents: DocumentService;
let runners: FakeRunners;
let closed: number;
+let openVideoFails: boolean;
let client: Client;
/** The pointer recorded with the take, as the sidecar beside the video. */
@@ -100,6 +114,7 @@ beforeEach(async () => {
await fs.writeFile(`${videoPath}.cursor.json`, JSON.stringify({ samples: clickTrack() }));
runners = new FakeRunners(videoPath);
closed = 0;
+ openVideoFails = false;
const toolDeps: McpToolDeps = {
host: { snapshot: async () => null, apply: async () => "no-editor" },
@@ -112,18 +127,21 @@ beforeEach(async () => {
const deps: MediaToolDeps = {
runners,
documents,
- openVideo: async () => ({
- durationSec: 12,
- width: 1920,
- height: 1080,
- capture: async (timeSec) => ({
- mimeType: "image/jpeg",
- data: Buffer.from(`frame@${timeSec}`).toString("base64"),
- }),
- close: () => {
- closed++;
- },
- }),
+ openVideo: async () => {
+ if (openVideoFails) throw new Error("media error 4");
+ return {
+ durationSec: 12,
+ width: 1920,
+ height: 1080,
+ capture: async (timeSec) => ({
+ mimeType: "image/jpeg",
+ data: Buffer.from(`frame@${timeSec}`).toString("base64"),
+ }),
+ close: () => {
+ closed++;
+ },
+ };
+ },
readCursor: readSidecar,
runTool,
now: () => 1_000,
@@ -206,6 +224,16 @@ describe("recording", () => {
expect(restored.isError).toBeFalsy();
});
+ it("says where the take is when it cannot become a project", async () => {
+ openVideoFails = true;
+ await call("startRecording", { window: "My App" });
+ const stopped = await call("stopRecording");
+ expect(stopped.isError).toBe(true);
+ expect(textOf(stopped)).toContain(videoPath);
+ expect(textOf(stopped)).toContain("media error 4");
+ expect(runners.open).toBe(0);
+ });
+
it("says why a recording did not start, and holds no take", async () => {
runners.recordStarts = false;
const started = await call("startRecording", { display: 1 });
@@ -317,6 +345,22 @@ describe("exportVideo", () => {
});
});
+ it("runs one export at a time, and closes each runner once it is done", async () => {
+ const { projectId } = await recordTake();
+ runners.holdExport = true;
+ const first = call("exportVideo", { projectId, path: path.join(dir, "a.mp4") });
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ const second = await call("exportVideo", { projectId, path: path.join(dir, "b.mp4") });
+ expect(second.isError).toBe(true);
+ expect(textOf(second)).toContain("already running");
+ // Nor may a take start while it renders.
+ expect((await call("startRecording", {})).isError).toBe(true);
+
+ runners.releaseExport();
+ expect((await first).isError).toBeFalsy();
+ expect(runners.open).toBe(0);
+ });
+
it("refuses a path that is not a video, and reports a failed render", async () => {
expect((await call("exportVideo", { projectId: "proj_x", path: "out.mov" })).isError).toBe(
true,
diff --git a/electron/mcp/media-tools.ts b/electron/mcp/media-tools.ts
index c6e911640..8c9b6b8fa 100644
--- a/electron/mcp/media-tools.ts
+++ b/electron/mcp/media-tools.ts
@@ -32,6 +32,7 @@ export interface MediaToolDeps {
): {
window: { webContents: { send(channel: string): void } };
done: Promise<CliDoneResult>;
+ close(): void;
};
};
documents: Pick<
@@ -152,6 +153,15 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
/** When each take of this session started, by its video: setPointerTrack's clock. */
const startedAtByVideo = new Map<string, number>();
+ /** A runner's result, its hidden window closed: this server outlives every runner. */
+ async function finish(run: ReturnType<MediaToolDeps["runners"]["start"]>) {
+ try {
+ return await run.done;
+ } finally {
+ run.close();
+ }
+ }
+
/** The take as a project, laid out as the editor lays out a fresh recording. */
async function createProjectFromVideo(videoPath: string, title: string) {
const video = await deps.openVideo(videoPath);
@@ -210,7 +220,7 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
annotations: READ_ONLY,
},
async () => {
- const result = await deps.runners.start({ kind: "sources" }).done;
+ const result = await finish(deps.runners.start({ kind: "sources" }));
if (!result.success || !result.sources) {
return text(`Could not list the sources: ${result.error ?? "unknown error"}`, true);
}
@@ -276,6 +286,7 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
);
const outcome = await Promise.race([started, run.done]);
if (outcome !== "started") {
+ run.close();
return text(`The recording did not start: ${outcome.error ?? "unknown error"}`, true);
}
take = { run, startedAt: now() };
@@ -304,14 +315,23 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
} catch {
// The runner already went away; its result says why.
}
- const result = await current.run.done;
+ const result = await finish(current.run);
take = null;
if (!result.success || !result.screenVideoPath) {
return text(`The recording failed: ${result.error ?? "unknown error"}`, true);
}
const title =
args.title?.trim() || `Recording ${new Date(current.startedAt).toLocaleString()}`;
- const project = await createProjectFromVideo(result.screenVideoPath, title);
+ let project: Awaited<ReturnType<typeof createProjectFromVideo>>;
+ try {
+ project = await createProjectFromVideo(result.screenVideoPath, title);
+ } catch (error) {
+ // The take is on disk all the same: say where, so it can still be looked at.
+ return text(
+ `The take was saved to ${result.screenVideoPath}, but it could not be turned into a project: ${error instanceof Error ? error.message : String(error)}`,
+ true,
+ );
+ }
startedAtByVideo.set(result.screenVideoPath, current.startedAt);
const projectId = project.document.project.id;
const checkpoint = await deps.runTool("createCheckpoint", { projectId });
@@ -415,6 +435,8 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
},
async (args, extra) => {
if (take) return text("A recording is running. Stop it before exporting.", true);
+ if (exporting)
+ return text("An export is already running. Wait for it, then try again.", true);
const outPath = path.resolve(args.path);
const extension = path.extname(outPath).toLowerCase();
if (extension !== ".mp4" && extension !== ".gif") {
@@ -423,7 +445,7 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
const progressToken = extra._meta?.progressToken;
exporting = true;
try {
- const result = await deps.runners.start(
+ const run = deps.runners.start(
{
kind: "export",
projectPath: deps.documents.filePathFor(args.projectId),
@@ -448,7 +470,8 @@ export function registerMediaTools(server: McpServer, deps: MediaToolDeps): void
.catch(() => undefined);
},
},
- ).done;
+ );
+ const result = await finish(run);
if (!result.success) {
return text(`The export failed: ${result.error ?? "unknown error"}`, true);
}
diff --git a/electron/mcp/stdio-server.ts b/electron/mcp/stdio-server.ts
index 553762b69..7b7701926 100644
--- a/electron/mcp/stdio-server.ts
+++ b/electron/mcp/stdio-server.ts
@@ -37,7 +37,16 @@ export async function serveMcpOverStdio(options: {
runTool,
});
const stdin = openStdin();
- // The transport only reads stdin; a client that exits just closes it.
- stdin.once("end", options.onClose);
+ // The transport only reads stdin; a client that exits just closes it. A pipe can
+ // report that as "end", "close" or "error", depending on how the client went.
+ let closed = false;
+ const close = () => {
+ if (closed) return;
+ closed = true;
+ options.onClose();
+ };
+ stdin.once("end", close);
+ stdin.once("close", close);
+ stdin.once("error", close);
await server.connect(new StdioServerTransport(stdin, process.stdout));
}
diff --git a/website/docs/cli.md b/website/docs/cli.md
index e6590764c..d433ab800 100644
--- a/website/docs/cli.md
+++ b/website/docs/cli.md
@@ -14,7 +14,7 @@ keywords:
# Screen recorder CLI
-OpenScreen's command-line interface is built into the desktop app's own executable. `openscreen record`, `captions`, `export`, `pack`, `info`, `sources` and `mcp` run from a terminal without opening a window, and `--json` turns their output into NDJSON on stdout. A script, a CI job or a coding agent can record a take, edit the `.openscreen` project as plain JSON, and render an MP4 or GIF with the same native compositor as the editor's **Export** button.
+OpenScreen's command-line interface is built into the desktop app's own executable. `openscreen record`, `captions`, `export`, `pack`, `info` and `sources` run from a terminal without opening a window, and `--json` turns their output into NDJSON on stdout. A script, a CI job or a coding agent can record a take, edit the `.openscreen` project as plain JSON, and render an MP4 or GIF with the same native compositor as the editor's **Export** button.
It is not a server tool. Every command starts Electron, which needs a display server even though no window appears, and recording needs a real desktop session. See [When the CLI is not the right tool](#when-the-cli-is-not-the-right-tool).
diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/de/docusaurus-plugin-content-docs/current/cli.md
index 39e23c460..52740c759 100644
--- a/website/i18n/de/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/de/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# Bildschirmrekorder-CLI
-Die Kommandozeilenschnittstelle von OpenScreen ist in die ausführbare Datei der Desktop-App selbst eingebaut. `openscreen record`, `captions`, `export`, `pack`, `info`, `sources` und `mcp` laufen im Terminal, ohne ein Fenster zu öffnen, und `--json` macht aus ihrer Ausgabe NDJSON auf stdout. Ein Skript, ein CI-Job oder ein Coding-Agent kann einen Take aufnehmen, das `.openscreen`-Projekt als einfaches JSON bearbeiten und mit demselben nativen Compositor wie die Schaltfläche **Export** im Editor ein MP4 oder GIF rendern.
+Die Kommandozeilenschnittstelle von OpenScreen ist in die ausführbare Datei der Desktop-App selbst eingebaut. `openscreen record`, `captions`, `export`, `pack`, `info` und `sources` laufen im Terminal, ohne ein Fenster zu öffnen, und `--json` macht aus ihrer Ausgabe NDJSON auf stdout. Ein Skript, ein CI-Job oder ein Coding-Agent kann einen Take aufnehmen, das `.openscreen`-Projekt als einfaches JSON bearbeiten und mit demselben nativen Compositor wie die Schaltfläche **Export** im Editor ein MP4 oder GIF rendern.
Ein Server-Tool ist sie nicht. Jeder Befehl startet Electron, das einen Displayserver braucht, auch wenn kein Fenster erscheint, und für die Aufnahme ist eine echte Desktop-Sitzung nötig. Siehe [Wann die CLI nicht das richtige Werkzeug ist](#when-the-cli-is-not-the-right-tool).
diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/es/docusaurus-plugin-content-docs/current/cli.md
index 615a75b51..650b5f0ed 100644
--- a/website/i18n/es/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/es/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# CLI de grabación de pantalla
-La interfaz de línea de comandos de OpenScreen está integrada en el propio ejecutable de la app de escritorio. `openscreen record`, `captions`, `export`, `pack`, `info`, `sources` y `mcp` se ejecutan desde una terminal sin abrir ninguna ventana, y `--json` convierte su salida en NDJSON por stdout. Un script, un trabajo de CI o un agente de código puede grabar una toma, editar el proyecto `.openscreen` como JSON normal y renderizar un MP4 o un GIF con el mismo compositor nativo que el botón **Exportar** del editor.
+La interfaz de línea de comandos de OpenScreen está integrada en el propio ejecutable de la app de escritorio. `openscreen record`, `captions`, `export`, `pack`, `info` y `sources` se ejecutan desde una terminal sin abrir ninguna ventana, y `--json` convierte su salida en NDJSON por stdout. Un script, un trabajo de CI o un agente de código puede grabar una toma, editar el proyecto `.openscreen` como JSON normal y renderizar un MP4 o un GIF con el mismo compositor nativo que el botón **Exportar** del editor.
No es una herramienta para servidores. Cada comando inicia Electron, que necesita un servidor gráfico aunque no aparezca ninguna ventana, y grabar requiere una sesión de escritorio real. Consulta [Cuándo la CLI no es la herramienta adecuada](#when-the-cli-is-not-the-right-tool).
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/fr/docusaurus-plugin-content-docs/current/cli.md
index 6fd6b9fd8..3b69d90f4 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# CLI d'enregistrement d'écran
-L'interface en ligne de commande d'OpenScreen est intégrée à l'exécutable même de l'application de bureau. `openscreen record`, `captions`, `export`, `pack`, `info`, `sources` et `mcp` s'exécutent depuis un terminal sans ouvrir de fenêtre, et `--json` transforme leur sortie en NDJSON sur stdout. Un script, un job de CI ou un agent de code peut enregistrer une prise, modifier le projet `.openscreen` comme du simple JSON, et produire un MP4 ou un GIF avec le même moteur de composition natif que le bouton **Exporter** de l'éditeur.
+L'interface en ligne de commande d'OpenScreen est intégrée à l'exécutable même de l'application de bureau. `openscreen record`, `captions`, `export`, `pack`, `info` et `sources` s'exécutent depuis un terminal sans ouvrir de fenêtre, et `--json` transforme leur sortie en NDJSON sur stdout. Un script, un job de CI ou un agent de code peut enregistrer une prise, modifier le projet `.openscreen` comme du simple JSON, et produire un MP4 ou un GIF avec le même moteur de composition natif que le bouton **Exporter** de l'éditeur.
Ce n'est pas un outil pour serveur. Chaque commande démarre Electron, qui a besoin d'un serveur d'affichage même si aucune fenêtre n'apparaît, et l'enregistrement exige une vraie session de bureau. Voir [Quand la CLI n'est pas le bon outil](#when-the-cli-is-not-the-right-tool).
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/cli.md
index e4979da0f..01f8f1525 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# 画面録画 CLI
-OpenScreen のコマンドラインインターフェースは、デスクトップアプリ自身の実行ファイルに組み込まれています。`openscreen record`、`captions`、`export`、`pack`、`info`、`sources`、`mcp` はウィンドウを開かずにターミナルから実行でき、`--json` を付けると出力が stdout への NDJSON になります。スクリプト、CI ジョブ、コーディングエージェントは、テイクを録画し、`.openscreen` プロジェクトをただの JSON として編集し、エディターの**エクスポート**ボタンと同じネイティブコンポジターで MP4 や GIF をレンダリングできます。
+OpenScreen のコマンドラインインターフェースは、デスクトップアプリ自身の実行ファイルに組み込まれています。`openscreen record`、`captions`、`export`、`pack`、`info`、`sources` はウィンドウを開かずにターミナルから実行でき、`--json` を付けると出力が stdout への NDJSON になります。スクリプト、CI ジョブ、コーディングエージェントは、テイクを録画し、`.openscreen` プロジェクトをただの JSON として編集し、エディターの**エクスポート**ボタンと同じネイティブコンポジターで MP4 や GIF をレンダリングできます。
これはサーバー向けのツールではありません。どのコマンドも Electron を起動するため、ウィンドウは表示されなくてもディスプレイサーバーが必要です。また、録画には実際のデスクトップセッションが必要です。[CLI が適さない場合](#when-the-cli-is-not-the-right-tool)を参照してください。
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/cli.md
index 64847aee5..f740bcec4 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# CLI de gravação de tela
-A interface de linha de comando do OpenScreen vem embutida no próprio executável do app para desktop. `openscreen record`, `captions`, `export`, `pack`, `info`, `sources` e `mcp` rodam em um terminal sem abrir nenhuma janela, e `--json` transforma a saída deles em NDJSON no stdout. Um script, um job de CI ou um agente de código pode gravar uma tomada, editar o projeto `.openscreen` como JSON puro e renderizar um MP4 ou GIF com o mesmo compositor nativo do botão **Exportar** do editor.
+A interface de linha de comando do OpenScreen vem embutida no próprio executável do app para desktop. `openscreen record`, `captions`, `export`, `pack`, `info` e `sources` rodam em um terminal sem abrir nenhuma janela, e `--json` transforma a saída deles em NDJSON no stdout. Um script, um job de CI ou um agente de código pode gravar uma tomada, editar o projeto `.openscreen` como JSON puro e renderizar um MP4 ou GIF com o mesmo compositor nativo do botão **Exportar** do editor.
Não é uma ferramenta de servidor. Todo comando inicia o Electron, que precisa de um servidor de exibição mesmo que nenhuma janela apareça, e a gravação precisa de uma sessão de desktop real. Veja [Quando a CLI não é a ferramenta certa](#when-the-cli-is-not-the-right-tool).
diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/cli.md
index 41f5fc824..4196c75ad 100644
--- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# 录屏 CLI
-OpenScreen 的命令行界面内置在桌面应用自身的可执行文件中。`openscreen record`、`captions`、`export`、`pack`、`info`、`sources` 和 `mcp` 可以在终端中运行,而不会打开窗口;`--json` 会把它们的输出变成 stdout 上的 NDJSON。脚本、CI 任务或 AI 编程代理可以录制一段内容,把 `.openscreen` 项目当作普通 JSON 来编辑,再用与编辑器**导出**按钮相同的原生合成器渲染出 MP4 或 GIF。
+OpenScreen 的命令行界面内置在桌面应用自身的可执行文件中。`openscreen record`、`captions`、`export`、`pack`、`info` 和 `sources` 可以在终端中运行,而不会打开窗口;`--json` 会把它们的输出变成 stdout 上的 NDJSON。脚本、CI 任务或 AI 编程代理可以录制一段内容,把 `.openscreen` 项目当作普通 JSON 来编辑,再用与编辑器**导出**按钮相同的原生合成器渲染出 MP4 或 GIF。
它不是服务器工具。每条命令都会启动 Electron,即使不显示窗口,Electron 也需要显示服务器;录制则需要真实的桌面会话。请参阅[什么情况下不适合使用 CLI](#when-the-cli-is-not-the-right-tool)。
diff --git a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/cli.md b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/cli.md
index b2a13b994..008326c14 100644
--- a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/cli.md
+++ b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/cli.md
@@ -14,7 +14,7 @@ keywords:
# 螢幕錄影 CLI
-OpenScreen 的命令列介面內建在桌面應用程式本身的執行檔中。`openscreen record`、`captions`、`export`、`pack`、`info`、`sources` 與 `mcp` 可以在終端機中執行,不會開啟任何視窗,而 `--json` 會把它們的輸出轉為 stdout 上的 NDJSON。腳本、CI 工作或程式設計代理可以錄製一段影片、將 `.openscreen` 專案當作一般 JSON 編輯,再用與編輯器**匯出**按鈕相同的原生合成器算繪出 MP4 或 GIF。
+OpenScreen 的命令列介面內建在桌面應用程式本身的執行檔中。`openscreen record`、`captions`、`export`、`pack`、`info` 與 `sources` 可以在終端機中執行,不會開啟任何視窗,而 `--json` 會把它們的輸出轉為 stdout 上的 NDJSON。腳本、CI 工作或程式設計代理可以錄製一段影片、將 `.openscreen` 專案當作一般 JSON 編輯,再用與編輯器**匯出**按鈕相同的原生合成器算繪出 MP4 或 GIF。
它不是伺服器工具。每個指令都會啟動 Electron,即使不會出現任何視窗,Electron 仍然需要顯示伺服器,而錄影則需要真正的桌面工作階段。請參閱[什麼情況下不適合使用 CLI](#when-the-cli-is-not-the-right-tool)。