> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor

> Set up Cursor with the bijection CLI and project guidance

[Cursor](https://cursor.com), the AI code editor, makes it easy to write and
maintain apps built with Bijection. Let's walk through how to set up Cursor for the
best possible results with Bijection.

## Cursor and Bijection

Point the assistant at the actual app tree (`bijection/app.ts`),
its tables, labels, roles and guards, and the committed `bijection.lock`. Types
catch a call to a function that does not exist or with the wrong arguments, and
`bijection check` explains label flow and lexicon problems in remedy sentences.
Review the lock diff and the tasks a change submits as you would a person's.

The assistant runs `bijection` with the same verbs and tree paths as the code:
`bijection check` checks the source and writes the lock,
`bijection query notes.list` and `bijection mutate notes.add text=Hi` call
functions, `bijection trial` shows what a mutation would write without
committing it, `bijection list notes.items --first 5` reads facts and
`bijection watch sys.logs` follows function logs. `bijection status request` observes or resumes
a deploy request whose reply was lost.

## Set up the Bijection CLI

[Install the CLI](https://docs.bijection.com/start/install.md), then add Bijection's guidance for
coding agents from your project directory:

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection ai-files install
```

This writes a managed pointer section into the project's `AGENTS.md` and
`CLAUDE.md`, a `bijection` stub skill for each selected agent (Claude Code and
Codex by default) and a `bijection` entry in `.mcp.json` that runs
`bijection mcp serve`. The guidance itself ships as Agent Skills inside the
installed `@bijectionhq/bijection`, so it matches the project's SDK version:
the MCP server serves it with the Skills extension, and `bijection skills list`
and `bijection skills show <name>` print it.
For Cursor, list `cursor` in `aiFiles.skills.agents` in
[`bijection.json`](https://docs.bijection.com/reference/configuration/bijection-json#configuring-ai-files-messages);
the command then also writes `.cursor/mcp.json`.
An application can also [declare an MCP server](https://docs.bijection.com/mcp/servers.md) for its
queries and mutations. [Connect the host](https://docs.bijection.com/mcp/clients.md) to that HTTP
endpoint as a person or an issued session. Each tool call runs under the
caller's own grants, and a write carries its `once`, so a retry is the same
effect.

Now start asking it questions like:

* Review my tables and indexes, and suggest the index a selection needs
* Which functions are exposed, and to which roles? (read `bijection.lock`)
* Run `bijection trial` on the `orders.place` mutation and explain its writes

## Tips and tricks

### Run Bijection during development

Run Bijection (`bijection dev`) in a terminal while you build so your functions
deploy, your app updates live, and your
[generated types](https://docs.bijection.com/development/cli#select-a-deployment) stay in sync as
the agent works. Stale types can otherwise leave the agent stuck in a linting
loop.

### Keep your requests small

The best results when using agentic LLMs can be found when keeping the amount of
changes you want to make small and git commit frequently. This lets you be more
specific around the context you provide the agent and it means the agent doesn't
need to do a lot of searching for context.

After each successful prompt or series of prompts it is a good idea to commit
your changes so that its simple to rollback to that point should the next prompt
cause issues.

### Update and reference your `README.md`

The agent needs context about the specific business goals for your project.
While it can infer some details from the files it reads, this becomes more
challenging as your project grows. Providing general information about your
project gives the agent a helpful head start.

Rather than including this information in each prompt, it's better to write a
comprehensive README.md file in your project root and reference it.

[Some people](https://youtu.be/2PjmPU07KNs?t=145) advocate for crafting a
Product Requirements Document (PRD), this may be a good idea for more complex
projects.

### Add Bijection docs

Adding Bijection docs can let you specifically refer to Bijection features when
building your app.

From **`Cursor Settings`** > **`Indexing & Docs`** > **`Docs`** add new doc, use
the URL `https://docs.bijection.com`.

Cursor will then index all of the Bijection docs for the LLM to use.

You can then reference those docs in your prompt with the `@Bijection` symbol.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.