Skip to content

Commit ecb8113

Browse files
Add optional Cursor agent-cli version override for the MicroVM image
Co-authored-by: Jack Pertschuk <jp954@cornell.edu>
1 parent d484b25 commit ecb8113

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ aws lambda-microvms create-microvm-image \
3636
--hooks '{"port":9000,"microvmImageHooks":{"ready":"ENABLED","readyTimeoutInSeconds":60},"microvmHooks":{"run":"ENABLED","runTimeoutInSeconds":60}}'
3737
```
3838

39+
To test a CLI off `main`, put a lab version (`YYYY.MM.DD-<sha7>`) in `microvm-image/cursor-agent-version` and rebuild the MicroVM image. Lab builds: [cursor.com/install?channel=lab](https://cursor.com/install?channel=lab), the `agent-cli.yml` GitHub Action on `main`, or `https://downloads.cursor.com/lab/<version>/linux/x64/agent-cli-package.tar.gz`. Leave the file empty for the prod installer.
40+
3941
Then start an agent from [cursor.com/agents](https://cursor.com/agents) against the pool.
4042

4143
## How it works

‎microvm-image/Dockerfile‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,27 @@ RUN dnf install -y --setopt=install_weak_deps=0 \
66
$(command -v curl >/dev/null 2>&1 || echo curl) && \
77
dnf clean all
88

9-
RUN curl -fsSL https://cursor.com/install | bash && \
9+
# Optional: pin a lab/main CLI, e.g. 2026.08.20-f582eb6. Empty = prod installer.
10+
# create-microvm-image zips this directory and may not pass --build-arg;
11+
# set the version in cursor-agent-version instead (ships in the zip).
12+
COPY cursor-agent-version /tmp/cursor-agent-version
13+
ARG CURSOR_AGENT_VERSION=
14+
ARG CURSOR_AGENT_ARCH=x64
15+
RUN VERSION="$(sed -e 's/#.*//' -e 's/[[:space:]]//g' /tmp/cursor-agent-version | sed -e '/^$/d' | head -n 1)" && \
16+
VERSION="${VERSION:-${CURSOR_AGENT_VERSION:-}}" && \
17+
ARCH="${CURSOR_AGENT_ARCH:-x64}" && \
18+
if [ -n "${VERSION}" ]; then \
19+
mkdir -p "/root/.local/share/cursor-agent/versions/${VERSION}" /root/.local/bin && \
20+
curl -fsSL "https://downloads.cursor.com/lab/${VERSION}/linux/${ARCH}/agent-cli-package.tar.gz" \
21+
| tar --strip-components=1 -xzf - -C "/root/.local/share/cursor-agent/versions/${VERSION}" && \
22+
ln -sf "/root/.local/share/cursor-agent/versions/${VERSION}/cursor-agent" /root/.local/bin/agent && \
23+
ln -sf "/root/.local/share/cursor-agent/versions/${VERSION}/cursor-agent" /root/.local/bin/cursor-agent; \
24+
else \
25+
curl -fsSL https://cursor.com/install | bash; \
26+
fi && \
1027
ln -sf /root/.local/bin/agent /usr/local/bin/agent && \
11-
ln -sf /root/.local/bin/agent /usr/local/bin/cursor-agent
28+
ln -sf /root/.local/bin/agent /usr/local/bin/cursor-agent && \
29+
rm -f /tmp/cursor-agent-version
1230

1331
ENV PATH="/root/.cursor/bin:/root/.local/bin:/usr/local/bin:${PATH}"
1432
WORKDIR /opt/cursor

‎microvm-image/cursor-agent-version‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Optional Cursor agent-cli lab version (YYYY.MM.DD-<sha7>).
2+
# Leave empty / comments only to use the prod installer:
3+
# curl -fsSL https://cursor.com/install | bash
4+
# Example: 2026.08.20-f582eb6
5+
#
6+
# This file ships in the create-microvm-image zip (AWS may not pass Docker --build-arg).
7+
# Put the version on its own line, rebuild the MicroVM image, then re-zip/upload.

0 commit comments

Comments
 (0)