From 2810779c61a50c7d49daa1d1caa83e100b9e1bb7 Mon Sep 17 00:00:00 2001 From: D-K-P <8297864+D-K-P@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:27:32 +0000 Subject: [PATCH] Updated cursor cli docs --- .../cursor-background-agent.mdx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/guides/example-projects/cursor-background-agent.mdx b/docs/guides/example-projects/cursor-background-agent.mdx index fa906d2136..b05ffa0df9 100644 --- a/docs/guides/example-projects/cursor-background-agent.mdx +++ b/docs/guides/example-projects/cursor-background-agent.mdx @@ -58,18 +58,24 @@ The task spawns the Cursor CLI as a child process and streams its output to the ### Build extension for system binaries -The example includes a custom build extension that installs the `cursor-agent` binary into the container image using `addLayer`. At runtime, the binary is copied to `/tmp` and given execute permissions; this is a workaround needed when the container runtime strips execute permissions from added layers. +The example includes a custom build extension that installs `cursor-agent` into the container image using `addLayer`. The official install script is run at build time, then the resolved entry point and its dependencies are copied to a fixed path so the task can invoke them at runtime with the bundled Node binary. ```ts extensions/cursor-cli.ts -export const cursorCli = defineExtension({ +const CURSOR_AGENT_DIR = "/usr/local/lib/cursor-agent"; + +export const cursorCli = (): BuildExtension => ({ name: "cursor-cli", - onBuildComplete(params) { - params.addLayer({ + onBuildComplete(context) { + if (context.target === "dev") return; + + context.addLayer({ id: "cursor-cli", image: { instructions: [ - `COPY cursor-agent /usr/local/bin/cursor-agent`, - `RUN chmod +x /usr/local/bin/cursor-agent`, + "RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*", + 'ENV PATH="/root/.local/bin:$PATH"', + "RUN curl -fsSL https://cursor.com/install | bash", + `RUN cp -r $(dirname $(readlink -f /root/.local/bin/cursor-agent)) ${CURSOR_AGENT_DIR}`, ], }, });