> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# EdgeSpark CLI commands reference

> Reference for the current EdgeSpark CLI, including init, deploy, pull, db, storage, secrets, vars, auth config, and log commands.

<Tip>
  Run `edgespark --help` for a list of all commands, or `edgespark <command> --help` for detailed options and flags.
</Tip>

## Account and project setup

| Command                                                       | Description                                                                                                                              |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `edgespark login`                                             | Start browser-based authentication and store local credentials                                                                           |
| `edgespark whoami`                                            | Show the current authenticated user                                                                                                      |
| `edgespark logout`                                            | Clear stored credentials                                                                                                                 |
| <code>edgespark init \<name> --agent \<name></code>           | Create a new EdgeSpark project and write the matching instructions file                                                                  |
| <code>edgespark init \<name> --agent \<name> -t \<src></code> | Initialize from a [template](/guides/start-with-template) — official shorthand, `github:owner/repo`, tarball URL, SSH URL, or local path |

`edgespark init` now scaffolds a root project with `server/`, `web/`, `configs/`, and `edgespark.toml`. Install dependencies separately in `server/` and `web/` after scaffolding.

`--agent` is required. The current mappings are:

* `claude` writes `CLAUDE.md`
* `gemini` writes `GEMINI.md`
* `codex` writes `AGENTS.md`
* Any other agent name also writes `AGENTS.md`

That means values such as `copilot`, `cursor`, `opencode`, `amp`, `devin`, `aider`, `windsurf`, `cline`, `continue`, `antigravity`, `kiro`, or your own custom agent name all currently scaffold `AGENTS.md`.

## Local development

| Command                         | Description                                                                 |
| ------------------------------- | --------------------------------------------------------------------------- |
| `edgespark dev`                 | Start the [local dev server](/guides/local-mode) on `http://localhost:7775` |
| `edgespark dev --port <number>` | Run the dev server on a different port                                      |
| `edgespark dev --reset`         | Wipe `.edgespark/state/` before starting so seed data and migrations re-run |

## Deploy

| Command                      | Description                                                      |
| ---------------------------- | ---------------------------------------------------------------- |
| `edgespark deploy`           | Build and deploy your project to its current default environment |
| `edgespark deploy --dry-run` | Run deployment validation before a real deploy                   |

## Custom domains

See the [custom domains guide](/guides/custom-domains) for the end-to-end flow.

| Command                                          | Description                                                                                              |
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| <code>edgespark domain add \<hostname></code>    | Register a hostname against the current project and print the DNS records to publish                     |
| <code>edgespark domain verify \<hostname></code> | Poll until the domain is active or the timeout is reached (default `15m`, configurable with `--timeout`) |
| <code>edgespark domain status \<hostname></code> | One-shot read of activation, EdgeSpark routing, TLS status, and any pending DNS records                  |
| `edgespark domain list`                          | List every custom domain on the current project                                                          |
| <code>edgespark domain remove \<hostname></code> | Detach a hostname from the current project                                                               |

<Note>
  New projects currently expose one default production environment. Public staging and promote workflows are coming soon, so they are intentionally not documented here yet.
</Note>

## Logs

| Command              | Description                                                 |
| -------------------- | ----------------------------------------------------------- |
| `edgespark log tail` | Stream real-time logs from your current default environment |

## Pull platform-managed files

| Command                        | Description                                                          |
| ------------------------------ | -------------------------------------------------------------------- |
| `edgespark pull`               | Pull platform-managed schema and SDK types together                  |
| `edgespark pull schema`        | Pull system-managed database tables into `server/src/__generated__/` |
| `edgespark pull types`         | Pull SDK type declarations for `edgespark` imports                   |
| `edgespark pull types --check` | Check whether generated SDK types are stale without writing files    |

<Tip>
  Use `edgespark pull` to refresh everything that EdgeSpark generates for you. It does not replace your app schema workflow in `server/src/defs/`. For your own tables, use `edgespark db generate` and `edgespark db migrate`.
</Tip>

## Database

| Command                                           | Description                                                        |
| ------------------------------------------------- | ------------------------------------------------------------------ |
| `edgespark db generate`                           | Generate migration files from `server/src/defs/db_schema.ts`       |
| <code>edgespark db generate --name \<name></code> | Generate a named migration                                         |
| `edgespark db migrate`                            | Apply pending migrations to the project database                   |
| `edgespark db migrate --confirm-dangerous`        | Apply pending migrations that include destructive SQL              |
| `edgespark db check`                              | Validate the local migration chain before deploy                   |
| `edgespark db studio`                             | Open Drizzle Studio against the project database                   |
| <code>edgespark db studio --port \<port></code>   | Run Drizzle Studio on a custom port                                |
| <code>edgespark db studio --host \<host></code>   | Bind Drizzle Studio to a custom host                               |
| `edgespark db sql "<query>"`                      | Run an ad-hoc SQL query against the project database               |
| `edgespark db sql "<query>" --confirm-dangerous`  | Allow destructive DML such as `DELETE` after explicit confirmation |

<Warning>
  `edgespark db sql` is for reads and ad-hoc DML. DDL such as `CREATE TABLE`, `ALTER TABLE`, and `DROP TABLE` is blocked. Use the migration workflow instead.
</Warning>

## Storage

| Command                                       | Description                                                        |
| --------------------------------------------- | ------------------------------------------------------------------ |
| `edgespark storage apply`                     | Apply bucket declarations from `server/src/defs/storage_schema.ts` |
| `edgespark storage apply --confirm-dangerous` | Confirm bucket removals before applying                            |
| `edgespark storage bucket list`               | List synced storage buckets                                        |
| `edgespark storage bucket list --desc`        | Include bucket descriptions in the output                          |

## Secrets

| Command                                         | Description                                                                 |
| ----------------------------------------------- | --------------------------------------------------------------------------- |
| `edgespark secret list`                         | List secret names only                                                      |
| <code>edgespark secret set \<keys...></code>    | Register one or more secret keys and open a secure page for entering values |
| <code>edgespark secret delete \<keys...></code> | Delete one or more secret keys                                              |

<Tip>
  `edgespark secret set` never sends secret values through the terminal, agent context, or third-party LLM APIs such as Anthropic, Google, or OpenAI. The CLI only registers key names, then opens a secure EdgeSpark browser URL where the human owner enters the values directly.
</Tip>

## Vars

| Command                                      | Description                                        |
| -------------------------------------------- | -------------------------------------------------- |
| `edgespark var list`                         | List configured environment variables              |
| <code>edgespark var set \<entries...></code> | Set one or more plain env vars in `KEY=VALUE` form |
| <code>edgespark var delete \<keys...></code> | Delete one or more env vars by key                 |

## Auth configuration

| Command                     | Description                                      |
| --------------------------- | ------------------------------------------------ |
| `edgespark auth get`        | Show the current auth configuration              |
| `edgespark auth get --json` | Show the current auth configuration as JSON      |
| `edgespark auth pull`       | Pull auth config into `configs/auth-config.yaml` |
| `edgespark auth apply`      | Apply `configs/auth-config.yaml` to the project  |

<Tip>
  `edgespark auth apply` updates the project config, but you should still run `edgespark deploy` before expecting auth changes to affect your live app.
</Tip>

## See also

<Columns cols={2}>
  <Card title="CLI installation" icon="download" href="/cli/installation">
    How to install and authenticate the EdgeSpark CLI.
  </Card>

  <Card title="Deploy and test loop" icon="rotate" href="/agents/deploy-and-test">
    How to use `edgespark deploy` and `edgespark log tail` in the development loop.
  </Card>

  <Card title="The deploy pipeline" icon="rocket" href="/concepts/deploy-pipeline">
    What happens at each step when you run `edgespark deploy`.
  </Card>

  <Card title="Declarative workflow" icon="database" href="/agents/declarative-workflow">
    How repo-authored schema, pull commands, and generated types fit together.
  </Card>
</Columns>
