---
title: Upgrading
description: Update the package, and the studio, its agents' rules and methods update with it.
---

```sh
npm install --save-dev @dexhq/canvas@latest
npx dex doctor   # checks hooks, MCP and anything new
```

The studio is one versioned package, like Storybook. Its app, canvas, CLI, and the rules and methods agents follow all come from the installed version, so updating the package updates everything. `AGENTS.md` is regenerated from it whenever the studio starts.

Your project keeps only what is yours: `dex.config.ts`, `DESIGN.md`, `context/`, `CLAUDE.md` and your files (`files/`).

## Updating from Dex

When npm has a newer Dex, a notice says so: what kind of update it is, and **Update**. One press syncs your changes with your branch first (in a repository with a remote), installs the new version with the project's package manager, runs `npx dex upgrade`, shares the change in a commit of its own (`chore: update Dex to 0.9.1`), and restarts Dex; the page reloads on the new version. Nothing needs a terminal. If something stops it, such as a Sync that needs you to choose between clashing lines, or an install the registry refused, the notice says why in a line, with **Try again**, which picks up where it stopped. **Dismiss** hides that version until the next one.

## Your team's update

One person updates Dex, from the update notice's **Update** or the commands above, and shares it with **Sync** (**Update** shares it itself). The lockfile it changed comes in with everyone else's next Sync, which then installs it with the project's package manager and runs `npx dex upgrade`, so Dex runs the version the team is on. It then restarts and the page reloads on it. Each agent's MCP server moves to that version by itself, between two of the agent's calls, keeping the comments the agent had taken: nobody reconnects it. An agent connected before Dex 0.10 has to be restarted once; the canvas marks an agent whose server is older. The same goes for any dependency a teammate changes, such as your design system. If the install fails (offline, or the registry refused), your work is still synced, the toast says why, and the next Sync installs again.

Dex asks your project's package manager whether a newer version is out, so it uses the registry, proxy and certificate you set for installs (`.npmrc`, `.yarnrc.yml`, `bunfig.toml` or the environment): on a company network the update notice appears wherever an install works. If the notice never appears, `npx dex doctor` says why it could not answer.

## Studios made with Sudio

Sudio is now Dex: the package `@sudio/core` is `@dexhq/canvas`, the command `sudio` is `dex`, and `npm create sudio` is `npm create dex`. A project made with Sudio moves over once. Swap the package where `package.json` lists `@sudio/core`:

```sh
npm uninstall @sudio/core
npm install --save-dev @dexhq/canvas@latest
npx dex upgrade
npx dex doctor
```

`npx dex doctor` lists each agent still set up for Sudio. Bring each one over, then start Dex once:

```sh
npx dex agents add claude    # or codex, cursor: each agent doctor lists
npx dex dev
```

`npx dex upgrade` renames `sudio.config.ts` to `dex.config.ts` and `sudio.components.tsx` to `dex.components.tsx`, and points the config's `@sudio/core/config` import at `@dexhq/canvas/config`. Until it runs, Dex still reads the old names and says once, as it starts, what to rename. The same goes for the rest of what kept the old name:

- **Scripts and agents.** `@dexhq/canvas` still has a `sudio` command that runs `dex` and says to change it, so package scripts and Claude Code's hooks keep working. Change `sudio` to `dex` in your scripts. An agent's MCP server set up by Sudio runs `npx --package=@sudio/core sudio mcp`, which fetches Sudio again and can't read `dex.config.ts`: `npx dex doctor` lists each one, and `npx dex agents add <agent>`, or "Add MCP config" under "Connect your agent" in the studio, rewrites it.
- **Imports.** Any other `@sudio/core/…` import, such as `"types": ["@sudio/core/client"]` in the studio's `tsconfig.json`, becomes `@dexhq/canvas/…`.
- **Environment.** `SUDIO_*` variables, such as `SUDIO_NO_UPDATE_CHECK`, are `DEX_*` now; the old ones still work.
- **Team skills.** A project's skills in `.sudio/skills/` are still read until you rename the folder to `.dex/skills/`.
- **Sync.** A team that shares on `sudio/sync` goes on sharing there, so teammates on Sudio and on Dex keep one branch. To keep it for good, set `git: { syncBranch: "sudio/sync" }` in `dex.config.ts`; new branches start with `dex/`.
- **Your machine.** Your sign-in and preferences are copied from `~/.config/sudio` to `~/.config/dex`, drafts and other things the browser kept carry over, and `~/Applications/Sudio.app` is made again as `Dex.app` the next time Dex starts. Sudio.app runs `@sudio/core`, so after the swap start Dex once with `npx dex dev` before opening the app.
- **Markup.** `@sudio/markup` is `@dexhq/markup`, and its script is at `https://cdn.jsdelivr.net/npm/@dexhq/markup/dist/cdn/markup.js`. A review in progress carries over, and review files from before still import.

## Studios made before Sudio

The studio was `@prova/studio`, with the command `studio` and its settings in `studio.config.ts`; it is now `@dexhq/canvas`, with the command `dex` and its settings in `dex.config.ts`. A project made before Sudio moves over by hand, once. Swap the package where `package.json` lists `@prova/studio` (in a workspace, the studio's app or the app it is in):

```sh
npm uninstall @prova/studio
npm install --save-dev @dexhq/canvas@latest
```

Then:

- **Scripts.** Those that run `studio dev`, `studio build`, `studio preview` or `studio claude` now run `dex dev`, `dex build` and so on. The scripts keep their names.
- **Imports.** The config imports `defineConfig` from `@dexhq/canvas/config`, and the studio's `tsconfig.json` has `"types": ["@dexhq/canvas/client"]`. Any other `@prova/studio/…` import becomes `@dexhq/canvas/…`.
- **Config.** Rename `studio.config.ts` to `dex.config.ts`, or let `npx dex upgrade` (below) do it. Until then the studio still reads the old name, and `npx dex doctor` says so.
- **Registry.** A studio installed from GitHub Packages (`@connorwforsyth/studio`) added `@connorwforsyth:registry=https://npm.pkg.github.com` and `//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}` to `.npmrc` (with Yarn 2 and later, `npmScopes.connorwforsyth` in `.yarnrc.yml`; with Yarn 1, the token line went in your own `~/.npmrc`). `@dexhq/canvas` comes from npm, so delete them unless something else installs from that scope.
- **Agents.** Their MCP servers and Claude Code's hooks still run `studio`. `npx dex doctor` lists each one; `npx dex agents add <agent>`, or "Add MCP config" under "Connect your agent" in the studio, rewrites it.

## Files move into files/

Files used to live by owner, in `prototypes/<owner>/<slug>/`. Now they live in `files/<slug>/`, owned by no one. **Update**, or `npx dex upgrade`, moves every file once. A file keeps its name, unless two owners had one by the same name: then it becomes `<owner>-<slug>`. Each file's `prototype.json` gets `createdBy`, who made it, and `was`, where it was. Old links, old names given to agents and old review files still find it.

Ask everyone on the team to update. A teammate still on an older Dex can keep syncing: when their work comes in at an old path, your Sync moves it into the file it belongs to. If your team's files use a newer layout than your Dex knows, Sync stops and asks you to update first. Your work stays saved on your computer.

## Your own rules

To change how agents work here, put a file in the studio's `rules/` or `methods/`: it replaces the installed one of the same name. Copy the installed one from `node_modules/@dexhq/canvas/templates/` to start.

## Studios set up by an older version

What setup wrote comes up to date when you run it again: `npm create dex@latest` in the project shows what differs from what this version writes (a `dex.config.ts` with only the choices, a studio `tsconfig.json` that extends yours, `plugins: [next()]` in a Next app, the newer `@dexhq/canvas` that needs), and changes it once you say go ahead. Your config's other keys and comments stay, and lines an older setup added to your `.gitignore` and `package.json` stay too: the plan says which can go.

For what is in the studio's folder, run this once. `--dry-run` shows what would change and writes nothing; running it again changes nothing.

```sh
npx dex upgrade --dry-run
npx dex upgrade
```

**The config becomes `dex.config.ts`.** A `studio.config.ts` (or `.mts`, `.js`, `.mjs`) is renamed, keeping its extension.

**The design system moves into `dex.config.ts`.** A studio with `studio/design-system/index.ts` (the adapter `init` used to write) gets a `designSystem` in its config instead, and every move is printed. The studio no longer reads `index.ts`, so until this runs the studio has no design system and `npx dex doctor` fails.

- `name`, `styling`, `marker`, `links` and `mcp` move as they are; `imports` too, less those the components already give.
- A component list `init` wrote becomes `components: { folder, import }`, scanned on every start, with anything people wrote about a component (description, category, status) in `about`. Any other list stays a list.
- A `styles.css` that only imports becomes `styles` and is deleted; one with CSS of its own stays, and `styles` points at it.
- `chromeTheme` moves to `ui.chromeTheme`, and `ui.primitives` naming the components' import becomes `true`.
- Foundations, and the guidance and contributing notes people wrote, become sections at the end of `DESIGN.md`. What `init` wrote there is dropped: the generated `AGENTS.md` says it now.
- A one-line preset (`export { default } from "@acme/ui/studio"`) is imported into the config as it is.
- `index.ts` and its README are deleted (git keeps them), and the studio's `tsconfig.json` loses the `@design-system` paths.

If `dex.config.ts` is not written as `export default defineConfig({ … })`, upgrade prints what to add, writes nothing and exits with code 2. Add it, then run `npx dex upgrade` again to move the rest.

**State moves into `.studio/`.** `dex snapshot` screenshots (`.snapshots/`) move into the studio's `.studio/snapshots/` (or are deleted, when that folder already has some: they are regenerated by the next `dex snapshot`). The old presence file (`.presence.json`) is deleted: presence lasts two minutes and is now written to `.studio/presence.json`. Their `.gitignore` lines become the one `.studio/` line.

**Rules copied in.** A studio with a `studio.lock.json` had its rules copied in: upgrade removes the copies nobody edited, keeps edited ones as your own, and deletes `studio.lock.json`. Your files are never touched.

**Explored directions live on the canvas.** Dex no longer has an explore page, so each file's `explorations/` folder, which only that page read, is deleted. The directions' views and the canvas section `dex explore` made for them stay, so nothing you built is lost; the trade-offs those files held are not kept. An agent asked to explore now lays the directions out as rows of a canvas section, gives you the trade-offs as a table in its reply, and records the choice as a decision in the section's spec.
