Skip to content

Commit 6e3ac8b

Browse files
authored
docs: cursor cli docs update (remove chmod workaround) (#3031)
<!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/3031" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
1 parent 170fde3 commit 6e3ac8b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

docs/guides/example-projects/cursor-background-agent.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,24 @@ The task spawns the Cursor CLI as a child process and streams its output to the
5858

5959
### Build extension for system binaries
6060

61-
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.
61+
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.
6262

6363
```ts extensions/cursor-cli.ts
64-
export const cursorCli = defineExtension({
64+
const CURSOR_AGENT_DIR = "/usr/local/lib/cursor-agent";
65+
66+
export const cursorCli = (): BuildExtension => ({
6567
name: "cursor-cli",
66-
onBuildComplete(params) {
67-
params.addLayer({
68+
onBuildComplete(context) {
69+
if (context.target === "dev") return;
70+
71+
context.addLayer({
6872
id: "cursor-cli",
6973
image: {
7074
instructions: [
71-
`COPY cursor-agent /usr/local/bin/cursor-agent`,
72-
`RUN chmod +x /usr/local/bin/cursor-agent`,
75+
"RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*",
76+
'ENV PATH="/root/.local/bin:$PATH"',
77+
"RUN curl -fsSL https://cursor.com/install | bash",
78+
`RUN cp -r $(dirname $(readlink -f /root/.local/bin/cursor-agent)) ${CURSOR_AGENT_DIR}`,
7379
],
7480
},
7581
});

0 commit comments

Comments
 (0)