---
title: "Set up a coding agent"
description: "Set up a coding agent to build, run, and share your mobile app on Limrun by itself."
canonical_url: "https://docs.limrun.com/docs/agents/cli"
markdown_url: "https://docs.limrun.com/docs/agents/cli.md"
last_updated: "2026-11-23"
x_farming_labs_generated_preamble: true
---

# Set up a coding agent
URL: /docs/agents/cli
LLM index: /llms.txt
Description: Set up a coding agent to build, run, and share your mobile app on Limrun by itself.

# Set up a coding agent

Install the `lim` CLI and the Limrun skills where your coding agent runs, then ask it for a product change. The skills teach the agent the whole loop: build on a remote Mac, run the app on a cloud simulator, check the screen, and hand you a link to review.

## Install the CLI

The CLI needs Node.js 20 LTS or newer. Install it with your package manager:

```bash
npm  install --global lim
pnpm add     --global lim
bun  add     --global lim
```

## Set your API key

Create an API key at [console.limrun.com/settings](https://console.limrun.com/settings) under **API Keys**, then export it in the shell your agent uses:

```bash
export LIM_API_KEY=lim_...
```

The CLI also reads `LIM_API_KEY` from a `.env` file in the working directory.

<Warning>
The API key can create, list, and delete every instance in your organization. If the agent runs in a sandbox that should not hold that much access, skip this step and give it a single instance instead. See [Sandboxed agents](/docs/agents/sandboxed-agents).
</Warning>

## Install the Limrun skills

From your project root, install the skills:

```bash
lim skills install
```

The command fetches the latest skills from the public [limrun-inc/skills](https://github.com/limrun-inc/skills) repository and installs them into each agent's native skills directory without prompting. By default it targets every agent that already has a skills directory, or all supported agents when none exists, and uses project scope. In project scope, the Bazel and Detox skills are included only when a scan of the folder finds matching clues; a global install includes every skill.

Narrow or change the install with these flags:

| Flag | What it does |
|---|---|
| `--agents claude\|cursor\|codex` | Install for one agent. Repeat to pick several. |
| `--skills <name>` | Install one skill, such as `limrun-xcode`. Repeat to pick several. |
| `--scope project\|global` | Install into the project (default) or into the agent's global skills directory. |
| `--keep-existing` | Leave existing skill directories that differ from the fetched version untouched instead of updating them. |

Existing skill directories with different content are updated in place, so review the change in your version control diff.

## Ask for a change

Open the same project in the agent, then ask for the change you want and say that it should build and run the app on Limrun:

```text
Update the onboarding screen, build the app with Limrun, run it on the remote simulator, and share the signed stream URL so I can review it.
```

## What the agent does

The skills walk the agent through this loop. Each step links to the page that documents its commands in full.

1. **Build the app.** `lim xcode build .` creates or reuses an Xcode sandbox, syncs the source to it, runs `xcodebuild` remotely, and streams the logs back. See [Build with Xcode](/docs/ios/build-with-xcode).
2. **Attach a simulator.** `lim ios create --attach --reuse-if-exists --label issue=<id>` boots a simulator attached to the sandbox. The attach installs and launches the latest build, and every later successful build reinstalls it. With `--reuse-if-exists`, a rerun with the same labels lands on the same instance. See [Run a simulator](/docs/ios/run-simulator).
3. **Share the live view.** The create output includes a signed stream URL, labeled **Signed Stream URL**. Anyone with it can watch and use the simulator in a browser without signing in, so the agent shares it at the start of the task.
4. **Read the screen, then act.** Before every tap, the agent reads `lim ios element-tree` and picks elements by accessibility ID instead of pixel coordinates. See [Run a simulator](/docs/ios/run-simulator#read-the-screen).
5. **Record video** for changes that involve motion, and attach it to the pull request. See [Record a video](/docs/ios/run-simulator#record-a-video).
6. **Share a preview link.** A build with `--upload <asset-name>` lands in Asset Storage, and `https://console.limrun.com/preview?asset=<asset-name>&platform=ios` opens it in the console for members of your organization. See [PR previews](/docs/ci/pr-previews).
7. **Delete the instances** when the work is done with `lim ios delete` and `lim xcode delete`.

## Tips for agents

- **The element tree is big.** Pipe `lim ios element-tree --json` through `jq` or `grep` so it does not fill the agent's context window.
- **Build errors are the agent's job.** When `lim xcode build` fails, the agent reads the output, fixes the code, and rebuilds instead of handing the failure back to you.
- **Unknown bundle ID?** Check the Xcode project, or run `lim ios list-apps` after a successful build.
- **Delete defaults to the last instance.** Without an ID, `lim ios delete` removes the last iOS instance the CLI created in this workspace. If the agent created several, list them by label first with `lim ios list --label-selector "issue=LIM-34"`.

## Next steps

<Columns cols={2}>
  <Card title="Claude Code on the web" icon="cloud" href="/https/docs.limrun.com/docs/agents/claude-code-web">
    Set up a cloud environment so every web session can build and run your app.
  </Card>
  <Card title="Remote MCP server" icon="plug" href="/https/docs.limrun.com/docs/agents/remote-mcp">
    Let an MCP client create and drive devices with OAuth sign-in, no CLI required.
  </Card>
  <Card title="Sandboxed agents" icon="lock-keyhole" href="/https/docs.limrun.com/docs/agents/sandboxed-agents">
    Hand an agent one instance without giving it your API key.
  </Card>
  <Card title="CLI reference" icon="book-open" href="/https/docs.limrun.com/docs/reference/cli">
    Every `lim` command, shared flag, and environment variable.
  </Card>
</Columns>

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
