
# Project Commands

Four commands operate on a project rather than on a running server: scaffold one, build it to static files, print its schema, and check a config before you ship it.

## `sovrium init`

Scaffold a new project into the given directory, or into the current one when no directory is passed. Every scaffold writes an `app.yaml`, a `CLAUDE.md` written for that template's domain, and a `public/` directory for static assets.

```bash
sovrium init ./my-app                          # blank starter
sovrium init ./my-app --template crm --name acme-crm
sovrium init ./my-app --template sovrium/crm-template#v2
```

| Flag                | Effect                                                                           |
| ------------------- | -------------------------------------------------------------------------------- |
| `--template <name>` | Bundled template name, or a GitHub repo — see below.                             |
| `--name <name>`     | App name written into the scaffolded `app.yaml`. Defaults to the directory name. |
| `--force`           | Allow `app.yaml` to be overwritten when the directory already has one.           |

Bundled templates: `hello-world`, `landing-page`, `crm`, `api-only`, `intranet`, `mcp-server`, `blog`, `docs-site`, `projects`, `helpdesk`, `content-calendar`, `people`, `events`, `assets`, `expenses`, `company-os`, `automation-recipes`, `knowledge-base`. An unknown name exits `1` and prints the list.

`--template` also accepts a **GitHub repository** in any of the forms `owner/repo`, `gh:owner/repo`, or `https://github.com/owner/repo`, each with an optional `#ref` naming a branch, tag or SHA. Only `github.com` is supported.

:::callout
**`init` never clobbers what it does not own.** Existing `.gitignore`, `.env.example` and `public/` files are left verbatim. `app.yaml` is the one file `init` owns, and even that is only overwritten with `--force`.
:::

## `sovrium build`

Generate a static site — HTML, CSS and assets — from your configuration, ready for any static host.

```bash
sovrium build app.yaml

SOVRIUM_DEPLOYMENT=github-pages sovrium build app.yaml

SOVRIUM_OUTPUT_DIR=./public \
  SOVRIUM_BASE_URL=https://example.com \
  SOVRIUM_GENERATE_SITEMAP=true \
  SOVRIUM_GENERATE_ROBOTS=true \
  sovrium build app.yaml
```

Build options come from `SOVRIUM_*` environment variables, not flags — see [Environment Variables](/en/docs/env-vars) for the full set. Output goes to `SOVRIUM_OUTPUT_DIR` when set; otherwise to a `dist/` directory beside the config file.

## `sovrium schema`

Print the JSON Schema (Draft-07) for the app configuration to stdout, or write it to a file.

```bash
sovrium schema
sovrium schema --output app.schema.json
```

The document is self-contained, with a top-level `$schema` declaration, so any JSON-Schema-aware editor or validator consumes it as-is. See [JSON Schema](/en/docs/json-schema) for how to wire it into an editor.

## `sovrium validate`

Decode a config file against `AppSchema` and report what is wrong. Accepts `.json`, `.yaml`, `.yml` and `.ts`, resolving `$ref` includes first.

```bash
sovrium validate app.yaml
sovrium validate app.ts
```

Prints `Valid configuration: <name>` and exits `0`, or a tree of errors and exits `1`. Run it in CI ahead of a deploy — the same schema the server decodes at boot. Full behaviour on [Validating a Config](/en/docs/config-validation).

## Related Pages

- [CLI Overview](/en/docs/cli) — config resolution and the full command surface.
- [Lifecycle Commands](/en/docs/cli-lifecycle) — `start`, `stop`, `restart`, `reload`.
- [Templates & Examples](/en/docs/templates-examples) — what each bundled template contains.
- [Validating a Config](/en/docs/config-validation) — reading the errors `validate` prints.
