---
title: Getting started
description: Set up Dex in a new or existing project and have your agent work through your first comment.
---

This page takes you from an empty folder, or an existing React project, to an agent working through your comments. **Get started** on the Recents page tracks the same steps.

import { en } from "@prova/web/i18n/en";

You need Node 20.12 or newer, a React project and git. Dex is the `@dexhq/canvas` package on npm, and its command is `dex`.

## Set up with your agent

To have your coding agent do the setup, copy this prompt into it. It runs the steps below and tells you what it found.

<PromptCard label={en.landing.prompt.label} modes={en.landing.prompt.modes} />

## 1. Set up by hand

To start a new project:

<Commands code={`npm create dex@latest my-app
cd my-app
npm run dex`} />

`create` asks which starter to use and which agents to connect. Every starter is shadcn on Base UI:

| `--template` | What you get |
| --- | --- |
| `vite` (default) | A Vite and React app in `src/`, with the studio in `studio/`. |
| `standalone` | The studio and the components, with no app. For design teams without an app repository. |
| `turborepo` | `apps/web`, the components in `packages/ui`, and the studio in `apps/studio`. Start it with `bun run dex`. |

To add Dex to an existing project, run this from its root:

<Commands code={`npm create dex@latest
npm run dex`} />

Run `dex` commands from the folder with `dex.config.ts`. In a monorepo, that's the studio's own package, such as `apps/studio`.

`create` shows the components, styles and agents it found, asks you to confirm them, and shows every file it will write before it writes anything. It never overwrites your files. Run it again later and it changes only what differs from what this version writes. Every question has a flag, listed in the [CLI](/docs/cli) reference. Run `npx dex doctor` to check the setup at any time.

## 2. Check who you are

Dex puts your name on your files and comments. It reads it from your GitHub CLI account (`gh auth login`) or your git user, so there's nothing to set up. To add a teammate by hand:

<Commands code={`npx dex contributor --name "Ana Designer" --git "Ana Designer" --discipline product`} />

## 3. Connect your agent

`create` registers Dex's MCP server for the agents you confirmed, such as `.mcp.json` for Claude Code and `.cursor/mcp.json` for Cursor. To add one later, run `npx dex agents add <agent>`, or use **Settings** → **MCP connection**.

To open your agent, use the agent bar at the bottom right of the canvas. Claude Code opens listening, so new comments reach it as you post them. For any other agent, ask it to watch the studio.

## 4. Write guidelines

Open **Guidelines** in the sidebar and write what your agent can't learn from the design system: who you design for, your quality bar, and decisions already made. See [Guidelines](/docs/guidelines).

## 5. Create a file

Click **New file** on the Recents page, or ask your agent. The file opens on its canvas as Untitled. Click the title to rename it.

## 6. Review it with your agent

On the canvas, press **C**, click anything in a frame, write a comment and choose **Post to agent**. If your agent isn't listening already, ask it:

> Watch the studio for feedback and work through it.

The agent marks the comment 👀 when it takes it and ✅ when it's done, with a line on what changed. See [Comments and agents](/docs/comments-and-agents).
