# Build with Agents

Fakebase works with the coding agent you already use. Once it's set up, you ask your agent for a database change, and it writes the migration, previews it, and applies it with the Fakebase CLI.

## Let your agent set it up

Paste this prompt into Cursor, Claude Code, or Codex. Your agent installs the CLI, sets up the project, and adds the Fakebase skill.

```prompt
Help me set up Fakebase in this project.

1. Install the Fakebase CLI, if not installed, with `npm install -g @fakebase/cli`
2. Run `fakebase init --start` to set up the project and start a local PostgreSQL database.
3. Run `fakebase agent install` to add the Fakebase skill for coding agents.
4. Run `fakebase db env` so my app can connect to the database.

Then help me build my database with Fakebase migrations.
```

You need [Docker Desktop](https://www.docker.com/products/docker-desktop/) running for Fakebase to start the database.

## Setup agent environment

Prefer to run the commands yourself? In the root of your project, run:

```bash
fakebase init
fakebase agent install
```

This sets up Fakebase in your project and adds a skill that teaches Cursor, Claude Code, and Codex how to use it. Commit the files it creates, so every teammate's agent gets them too.

## What gets added

| Agent       | Files                                                        |
| ----------- | ------------------------------------------------------------ |
| Cursor      | `.cursor/skills/fakebase/SKILL.md`                           |
| Claude Code | `.claude/skills/fakebase/SKILL.md` and a part of `CLAUDE.md` |
| Codex       | A part of `AGENTS.md`                                        |

If you already have a `CLAUDE.md` or `AGENTS.md`, your own text stays. Fakebase only adds and updates its own part of the file.

Other agents that read `AGENTS.md` pick up Fakebase too.

## Keep it up to date

After you update the CLI, update the skill too and commit the changes:

```bash
fakebase agent install
```

To check whether your agent files are out of date:

```bash
fakebase doctor
```

---

## Next steps

- [Overview](https://fakebase.studio/docs/cli.md): The Fakebase CLI runs a local PostgreSQL database for your project and manages its schema with plain-SQL migrations.
- [Get started](https://fakebase.studio/docs/get-started.md): Install the Fakebase CLI to run a local PostgreSQL database with migrations, and download Fakebase Studio to work with it on macOS.
