# Code

> Have Dvina write code in a project on your computer, review every change, then commit and open the pull request from the chat.

Dvina writes code in your project, on your computer, with the notes, the threads and the reasons in view. You describe what you want, review what it changed and ship it, in the same app you use for everything else.

## Before you start

Code is part of the Dvina desktop app, on Mac, Windows and Linux. There's nothing separate to install. Dvina needs to be on at least one computer; every other device can start the work and follow it.

To get the desktop app, see [Download and install Dvina](/docs/use-dvina/get-started/install).

## Open a project

A project is a folder on your computer: a code repository or a plain folder.

1. In the desktop app, open the Dock and choose the project row (**Projects**).
2. Choose **Open…** to pick a folder or code repository, or **New Project…** to make a new folder on this computer.

When you make a new project, turn on **Create Git repository** to keep a history of every change, so Dvina's edits can be undone.

The project you choose is the one the chat works in. For a code project, the Dock also shows its branch.

## Ask for the work

Describe what you want, like "Make the CSV export use the right dates". Dvina runs it as a task on your computer, and you can keep talking or start more tasks. Several tasks can work on one repository and decide among themselves who commits first.

Before it writes, Dvina reads the project together with what's around it: it searches your past chats and files, so the reasons come along. It also follows the AGENTS.md or CLAUDE.md in your project.

## Review the changes

Each task's answer comes back with its changes, in a card named for the task that says **Ready to review**.

- **See what changed:** Choose **Changes** to see each file's changes in the side panel. **Files** lets you browse the project.
- **Take a turn back:** Under a reply that changed files, choose the line that says how many files changed, then **Revert**, and confirm **Revert this turn?**. The files go back to how they were before it, and changes made since stay.

## Commit and open a pull request

1. In the task's card, choose **Commit**.
2. **Commit the changes** lists the files that will be committed on your branch, with a suggested **Title** and **Message**. Choose **Commit**. Nothing is pushed.
3. To open a pull request, choose **Push and create PR**. Dvina pushes the current branch first, then opens the pull request. Uncommitted files aren't included.

The pull request goes through your own Git sign-in. Dvina opens it on GitHub or GitLab; any other host opens its own new pull request page in your browser. When it's done, choose **View PR**.

## Approvals

Builds and tests just run. Deleting files, pushing, database changes, deploys and anything touching secrets wait for your OK. The card says why, for example **Run this command?** with **Deletes files** or **Changes a database**, and you choose **Allow** or **Reject**. Your admin can set how much always asks.

> [!IMPORTANT]
> Nothing is pushed until you say so. Your project is a folder on your computer, and with Git every edit Dvina makes can be undone.

## Test on a simulator or emulator

In the desktop app, Dvina can try your app on this computer the way your users will: in a browser, in the iOS Simulator on a Mac, or in the Android Emulator on a Mac, Windows or Linux.

1. Open the Dock and choose the row marked **Device**.
2. Under **This device**, choose **Browser**, **iOS Simulator** or **Android Emulator**.

The pane opens in the side panel. A simulator that's off starts when you open it. To use another one, choose **Choose a device** at the top of the pane; each device shows its system and whether it's **Running** or **Off**.

To show or hide the browser, press <kbd>⌘</kbd> <kbd>⇧</kbd> <kbd>B</kbd> on a Mac or <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>B</kbd> on Windows and Linux. While Dvina works in a pane you aren't looking at, the **Device** row has a dot.

### Let Dvina use a device

The first time Dvina uses a simulator or emulator, it asks, for example **Let Dvina use iPhone 17 Pro?**, because Dvina sees its screen, so don't sign in to your real accounts on it. Choose **Allow** or **Reject**. The device keeps your answer, so another chat doesn't ask again. Until you allow it, the pane offers **Let Dvina use it**.

While Dvina works, the pane says **Dvina is using this device**, and the chat shows the device live. Choose **Watch large** to see it bigger. Sending, paying and deleting on the device wait for your OK, every time.

To use the device yourself, choose **Take over**. Your taps and keys go to the device, and you can press **Home**, and on Android **Back** and **Recent apps**. When you're done, choose **Hand back**, and Dvina carries on.

### Set up the iOS Simulator

If the iOS Simulator isn't set up, its row opens a checklist, **Set up the iOS Simulator**. Each step ticks itself off once it's done, even if you did it somewhere else.

1. **Install Xcode:** Choose **Open the App Store**. Xcode is free and about 7 GB; open it once when it's done.
2. **Select Xcode:** Choose **Copy the command** and run it in Terminal. It asks for your password, so Dvina never runs it for you.
3. **Add the iOS simulator:** In Xcode, go to Settings › Components and get iOS, or run the command in Terminal.
4. **Create a device:** Choose **Create an iPhone**. Nothing is downloaded.

### Set up the Android Emulator

If the Android Emulator isn't set up, its row opens a checklist, **Set up the Android emulator**.

1. **Install Android Studio:** Choose **Get Android Studio**. It installs what the emulator runs on; open it once when it's done.
2. **Add the emulator and platform tools:** Run the command in a terminal, or add them in Android Studio › SDK Manager.
3. **Turn on hardware acceleration:** On Windows and Linux, run the command yourself, since it needs your password or an administrator. Then sign out and back in on Linux, or restart on Windows. A Mac needs nothing here.
4. **Add a system image:** Run the command in a terminal, or add one in Android Studio › SDK Manager. It's a large download.
5. **Create an emulator:** Choose **Create an emulator**. Nothing is downloaded.

If your admin turned simulators off, the rows say **Turned off by your admin**.

## Work from anywhere

From your phone or the web, ask for the work in your chat. Dvina works on it in the project on your computer, and the changes wait for your review. Your computer needs to be on, with Dvina open.

## When to use

- You're working on real software and want the whole story behind you: the notes, the decisions and last month's threads.
- You want a fix done while you're away from your desk.
- You want several changes worked on at once, each ready to review.

## Tips

- **Write your house rules down.** Put how you work in AGENTS.md or CLAUDE.md, and Dvina follows it.
- **Test on a phone.** Building an app? Dvina can test it in an iPhone simulator or an Android emulator, tapping through it the way your users will. See [Test on a simulator or emulator](#test-on-a-simulator-or-emulator).
- **Not a developer?** For working apps and pages, use [Create](/docs/use-dvina/features/create) instead.

## Related

- [Projects](/docs/use-dvina/features/projects)
- [Tasks](/docs/use-dvina/features/tasks)
- [Computer Use](/docs/use-dvina/features/computer-use)
- [Install](/docs/use-dvina/get-started/install)
