# bsv-scaffold.json

> The manifest every run writes. What's in it, why later runs read it, and how it records exactly where a project came from.

> Agents: search these docs with the `search_docs` tool on the MCP server at https://createbsvapp.vercel.app/mcp, or read everything at https://createbsvapp.vercel.app/llms-full.txt.

Every run writes `bsv-scaffold.json` at the project root. It's the CLI's memory of your project: later `add` runs read it to reuse your stack, folders and network, and to offer only the capabilities you don't have yet.

## Generated project

```json [bsv-scaffold.json]
{
  "version": 2,
  "name": "my-app",
  "network": "test",
  "stack": {
    "frontend": { "framework": "react", "variant": "react-ts" },
    "backend": { "framework": "express" }
  },
  "targets": { "client": "client", "server": "server" },
  "bsvDir": "src/bsv",
  "capabilities": ["wallet-connect", "wallet-login", "signed-requests"],
  "starter": { "id": "full-stack", "kind": "generated" }
}
```

## Complete example

```json [bsv-scaffold.json]
{
  "version": 2,
  "name": "my-meter-app",
  "starter": {
    "id": "meter",
    "kind": "repository",
    "repository": "https://github.com/p2ppsr/meter.git",
    "ref": "master",
    "commit": "<40-character SHA of the cloned commit>"
  }
}
```

(Trimmed. Example manifests also carry the stack and target fields.)

## Fields

| Field | Type | What it records |
| --- | --- | --- |
| `version` | `2` | manifest format. Version 1 files from older CLIs are still read |
| `name` | `string` | the project name |
| `network` | `"main" \| "test" \| "ttn"` | the default network |
| `stack` | `{ frontend?, backend? }` | frameworks, reused by `add` |
| `targets` | `{ client?, server? }` | app folders, so `add` puts files in the same place |
| `bsvDir` | `string` | where capability files live |
| `capabilities` | `string[]` | what's installed. `add` merges new ids in |
| `starter.id` | `string` | which starter produced the project |
| `starter.kind` | `"generated" \| "repository"` | generated scaffold or cloned example |
| `starter.repository` | `string` | complete examples: the source repo |
| `starter.ref` | `string` | complete examples: the branch cloned |
| `starter.commit` | `string` | complete examples: the exact commit cloned |

## Should I commit it?

**Yes.** It's small, it describes the project, and it makes `add` runs (yours, your teammates' or your agent's) behave predictably. Don't edit it by hand. Let the CLI keep it in sync.

## Reproducing a project

The manifest is a record, not a recipe: the CLI doesn't rebuild a project from it. A folder containing only `bsv-scaffold.json` is detected as an existing project, so a plain run goes to **add** mode, and `new --yes` there stops with `a new project needs at least a frontend or a backend`.

To recreate a generated project, run the same command again, or better, commit a [`config.json`](https://createbsvapp.vercel.app/docs/config) and use `--file`. For complete examples, `repository` + `commit` pin the exact code: `git clone <repository>`, then `git checkout <commit>`.
