# Work locally

Work on a [project](/docs/concepts/project-lifecycle.md#projects) from Studio in your own editor: pull its files, run it, and push your edits back to the same branch.

## Before you start

You need a project. See [Create a project](/docs/projects/create-project.md).

## Pull and push a project

**Code**

1. Sign in. In a terminal without a browser, such as CI, set `VERYFRONT_API_KEY` to an [API key](/docs/authentication/api-keys.md) instead:

```bash
npx veryfront@latest login
```

2. Pull the project into a new folder. In Studio, **Code** in the header shows these commands with the slug filled in; the slug is also on the project's **Settings** page:

```bash
mkdir support-desk && cd support-desk
npx veryfront@latest pull <slug>
```

3. Answer `y` to "Continue? \[y/N]". You should see `✓ Pulled 10 files from <slug> (main)`. Without a terminal, such as in CI or a coding agent, add `--yes` to `pull` instead.
4. Change the heading in `app/page.tsx`, from "Welcome to Veryfront" to "Support desk".
5. Run the project. `dev` also syncs your edits to the project's `main` branch, and keeps running until you stop it:

```bash
npx veryfront@latest dev
```

6. Open the address it prints after `✓ App ready`, usually [localhost:3000](http://localhost:3000). You should see the "Support desk" heading.
7. Stop `dev` with Ctrl+C.
8. Push your changes. It prints `✓ Main is up to date` when `dev` has already synced them, then the project's Studio and preview addresses:

```bash
npx veryfront@latest push
```

9. Open the project's **Files** in Studio. You should now see your change in `app/page.tsx`.

### Try it in a sandbox

```playground
step: Setup: a project with files on main | npm create -y veryfront@latest seed -- --template minimal --yes && cd seed && npx veryfront push --yes && cd .. && rm -rf seed
step: Pull the project into a new folder | mkdir support-desk && cd support-desk && npx veryfront@latest pull $VERYFRONT_PROJECT_REFERENCE --yes
step: Change the heading | sed -i 's/Welcome to Veryfront/Support desk/' app/page.tsx
step: Run the project | PORT=3100 nohup npx veryfront@latest dev > dev.log 2>&1 &
step: Open it | sleep 45; curl -s localhost:3100 | grep -o "Support desk"
step: Push your changes | npx veryfront@latest push --yes
check: npx veryfront@latest files get app/page.tsx
expect: Support desk
```

## Troubleshooting

**If you see "Pull requires confirmation … Re-run with --yes"**, `pull` ran without a terminal to answer it. Add `--yes` to `pull`.

## With MCP

1. Call `veryfront__list_files` for the project.
2. Call `veryfront__get_file` for `app/page.tsx`. It worked when the content has your change.

## Next steps

* [Deploy from the CLI](/docs/deployment/cli.md)
* [Connect a coding agent](/docs/mcp/connect.md)
