Controlling $PATH in Cursor Cloud Agents

I’m using mise to manage my dev tools in my monorepo. mise relies on adding a folder it manages to $PATH to expose dev tools it manages.

I want to use mise to manage dev tools in Cursor Cloud Agents so that they see the same developer environment I am using locally. I set up a Dockerfile that looks like this

FROM docker.io/library/ubuntu:24.04

ENV PATH="/mise/shims:${PATH}

....

USER ubuntu

However, the $PATH the Cloud Agent sees when executing shell commands is:

/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

How can I control the path (and more generally, the shell) the Cloud Agent uses to execute commands?

Hey!
This is a known limitation. Cloud Agents currently reset $PATH to a default value when the environment starts, so ENV PATH modifications in Dockerfiles don’t carry through to the agent’s shell sessions.

A couple of workarounds:

1. Add the PATH to .bashrc in your Dockerfile (recommended for mise)

RUN echo 'export PATH="/mise/shims:$PATH"' >> /home/ubuntu/.bashrc

The agent’s shell sessions source .bashrc, so this should make your mise-managed tools available for commands the agent runs.

2. Symlink mise shims to a standard PATH directory

RUN ln -sf /mise/shims/* /usr/local/bin/

This is more robust since /usr/local/bin is always on the default PATH, but it bypasses mise’s per-project version management.

3. Use the install command in .cursor/environment.json

You can add mise activation to your install script so it runs at environment setup time:

{
"install": "echo 'eval \"$(mise activate bash)\"' >> /home/ubuntu/.bashrc"
}

For more on environment configuration, see Cloud Agent Setup.