
# Create a Vault

## Using a starter recipe

Starter recipes scaffold a vault with documents, packs, and agent instructions tailored to a role:

```bash
ctx init --starter developer    # Engineering teams
ctx init --starter executive    # Strategic leadership
ctx init --starter analyst      # Research / OSINT
ctx init --starter team         # General team knowledge base
ctx init --starter sales        # Sales teams
```

## See all starters

```bash
ctx init --list-starters
```

## Empty vault

```bash
ctx init --name "My Project"
```

This creates the vault structure without any starter content. You can apply a starter later by running `ctx init --starter <recipe>` in the same directory.

## Register it as a named vault

So you can reach this vault from any folder, register it in the vault registry under a short alias. You can do this at creation time or afterwards:

```bash
# At init: register the new vault as the registry default
ctx init --name "My Project" --set-default

# Or register an existing vault path later
ctx vault add myproject ~/code/my-project --set-default

# Confirm which vault the CLI resolves to, and why
ctx vault which
```

Once registered, target it from anywhere with the global `--vault` flag:

```bash
ctx --vault myproject list
```

## Consent on writes

`ctx init` writes files, so like every write command it **asks for confirmation first** and then prints the exact list of files it created. To preview without touching disk, add `--dry-run`; to skip the prompt in a script or agent, pass `--yes`. Nothing is overwritten silently — use `--force` to allow overwriting existing files.

## What gets created

```
my-project/
├── CONTEXT.md           # Vault-level system prompt for AI agents
├── context.yaml         # Machine-readable index
├── nodes/               # Knowledge documents
│   └── INDEX.md
├── sources/             # Source nodes (live data)
├── packs/               # Context packs
└── .context/
    └── config.yaml      # Vault configuration
```

## Layout modes

Context Nest supports two layout modes:

| Mode | Structure | Best for |
|------|-----------|----------|
| `structured` (default) | `nodes/`, `sources/`, `packs/` directories | Teams, CI/CD, programmatic access |
| `obsidian` | Flat folder structure | Obsidian users, personal vaults |

```bash
ctx init --layout obsidian --name "My Notes"
```
