# Connect your AI agent

Source: https://olef.dev/docs/start/agents

Your coding agent writes and changes the app. Olef gives it a way to run Android, inspect the screen, act on it, debug behavior, and collect evidence.

## Codex and Claude Code

[Install Olef](https://olef.dev/docs/start/install), then run this in the environment where your agent works:

```bash
olef init
```

Review the plugin installation prompts. Start a new agent session after setup so it can discover the integration. The plugins provide Android guidance and a live device viewer; available presentation features depend on the client.

For a project in the cloud, follow the [Cloud quickstart](https://olef.dev/docs/cloud/quickstart). For a local app, open its project directory in your agent and connect a local emulator or phone.

## Other coding agents

Olef also works with shell-capable agents such as Cursor, Gemini CLI, and Antigravity. `olef init` installs the supported skill files. An agent can discover commands directly:

```bash
olef commands --json --depth 1
olef commands --guide workflow --json
```

A shell connection is enough for the CLI workflow. An embedded viewer requires a compatible integration; it is not implied by shell access alone.

## Give it a small first task

```text
Use Olef to run this Android project on the selected emulator. Inspect the
first screen, tell me what is working, and show evidence. If setup is
missing, explain what I need to approve or install before proceeding.
```

For an existing app:

```text
The app crashes when I open Settings. Reproduce the problem with Olef,
inspect the crash and relevant source, fix the cause, then repeat the
same steps and show that Settings opens successfully.
```

For a new app, use the [first-app walkthrough](https://olef.dev/docs/build/first-app).

## Help the agent finish well

Give it a concrete outcome: “the saved item remains after restarting the app” is more useful than “make saving work.” Ask it to check the result on the device and summarize any behavior it could not verify.

The [agent loop](https://olef.dev/docs/concepts/agent-loop) explains screen reads, selectors, postconditions, and recovery. The [output contract](https://olef.dev/docs/concepts/output-contract) explains how an integration should interpret responses.
