# snizu app dev

Source: https://snizu.dev/docs/cli/app/dev

## Usage [#usage]

```sh title="Usage"
snizu app dev [dir] --store <address> [--theme <handle>] [--port 9292] [--once] [--json]
```

## Flags [#flags]

<Fields>
<Field name="--store" type="<address>" required>
One of your organization's development stores, by its address (`siwa-grove-test` or `siwa-grove-test.snizu.app`), name or ID. Merchants' stores never run drafts.
</Field>

<Field name="--theme" type="handle">
A Theme Store theme to make live on the store first, to see your embeds in it. The store's own live theme by default.
</Field>

<Field name="--port" type="number">
The local address's port on 127.0.0.1. 9292 by default.
</Field>

<Field name="--once" type="flag">
Do it once and stop, printing where it runs.
</Field>

<Field name="--json" type="flag">
With `--once`, print one line of JSON for scripts: `url`, `password`, `theme`, `version` and `embeds`.
</Field>
</Fields>

## What happens on save [#what-happens-on-save]

<Steps steps={[{"title":"Build","text":"300 ms after the last change, `npm run build` runs, when package.json has a build script."},{"title":"Draft","text":"The version in snizu.app.json becomes a draft, or updates the draft with that number."},{"title":"Try","text":"The draft goes on the store with its embeds on in the live theme, and the page reloads."}]} />

Hidden files, `node_modules`, `dist`, `report`, `test-results` and `playwright-report` never start it again. With a build, `snizu.app.json` is the build's output, so a change to it starts nothing either; without one, it's the file you edit.

The store is a development store your organization owns, so it behaves exactly as a merchant's will. The local address shows it through 127.0.0.1 only: the preview is yours, and a page that tries to reach it under another name is turned away.

## Examples [#examples]

```shellsession title="Terminal"
$ snizu app dev --store siwa-grove-test
Sending the app to Siwa Grove test…
✓ 0.1.0 runs on Siwa Grove test (Nour) at http://127.0.0.1:9292
The store's password page takes: tadra-mafi
Embeds on: gift-wrap-note. Ctrl+C to stop.
✓ Sent 0.1.0
```

An app with a build script says "Building and sending" instead, and runs it first every time.

A refused manifest or a failed build shows in the terminal and over the page, one problem a line, and the loop keeps running so the next save can fix it.

<Callout title="Stopping leaves the draft">
Press Ctrl C to stop. The draft stays on the development store, and the next run picks up where you left off.
</Callout>