# Use a coding agent to install

> Let Claude Code, Codex or Cursor run the install while a person approves each gate.

Source: https://diakrin.com/docs/self-hosted/use-with-ai

A coding agent such as Claude Code, Codex or Cursor can run the install for you, while you approve each gate.

## Before you start

| You supply | Example | Comes from |
| --- | --- | --- |
| A coding agent in a terminal | Claude Code, Codex, Cursor | Already on your computer |
| AWS CLI signed in with admin rights | `aws sts get-caller-identity` works | [Prerequisites](/docs/self-hosted/prerequisites) |
| The values from the install guide | region, host name, DNS owner | You answer when the agent asks |

## Give the agent the guide

1. Open [Install Diakrin](/docs/self-hosted/install).
2. Choose **Use with AI → Copy as agent prompt** at the top of the page.
3. Paste it into your agent.

You should see the agent load the install skill and ask for each value in **Before you start**.

If the CLI is already installed, you can also load the skill yourself without restarting the agent:

```sh
diakrin skills show diakrin-self-hosted-install
```

## What the agent does and does not do

| The agent | A person |
| --- | --- |
| Writes `diakrin.env`, runs `--plan-only`, `status` and `doctor` | Reads and approves the plan before `--yes` |
| Reports the DNS records and checks `diakrin self-hosted dns` | Confirms the records exist at the DNS provider |
| Runs `deploy` | Runs the printed command to read the owner setup code and enters it in the browser |
| Reads `error.nextAction` and reruns the command | Decides on `destroy` and types the installation id |

> [!WARNING]
> Stop here if an agent asks you to paste a token, key, database URL or the owner setup code into the chat. Never do that. Secrets go in the browser, the AWS CLI session or the process environment.

## If it fails

| You see | It means | Do this |
| --- | --- | --- |
| The agent does not know the skill | It started before `diakrin init` | Run `diakrin skills show diakrin-self-hosted-install` and ask it to follow the output |
| The agent stops at a gate | That is intended | Do the step, then tell it to continue |

## Next

Follow [Install](/docs/self-hosted/install).
