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

# holydocs init

Scaffold a new HolyDocs project with starter pages and a docs config.

## Usage

```bash
holydocs init [options]
```

Creates a new local docs project by writing `docs.json` plus starter MDX files in the target directory.

## Options

| Option | Description | Default |
|---|---|---|
| `--template <id>` | Starter template: `blank`, `api-docs`, `product-docs`, or `open-source` | Prompted |
| `--dir <path>` | Directory to initialize | Current directory |

## Templates

| Template | Description |
|---|---|
| `blank` | Minimal starter with a single introduction page |
| `api-docs` | API docs starter with intro, quickstart, auth, and API reference pages |
| `product-docs` | Product documentation starter with guides |
| `open-source` | Open source starter with installation, contributing, and changelog pages |

## Examples

### Interactive Setup

```bash
holydocs init
```

You will be prompted for:

1. Template selection
2. Project name

### Choose a Template Up Front

```bash
holydocs init --template api-docs
```

### Initialize in a Subdirectory

```bash
holydocs init --template product-docs --dir ./docs
```

## What Gets Created

Every template writes:

- `docs.json`
- One or more starter `.mdx` pages
- Nested content directories when needed, such as `guides/` or `api-reference/`

## Existing Projects

If `docs.json` already exists in the target directory, `holydocs init` warns and asks whether you want to overwrite it.

## Suggested Next Steps

```bash
holydocs dev
holydocs check
holydocs deploy
```

`holydocs init` writes into the directory you point it at. Create the directory first if you want a fresh folder, for example `mkdir my-docs && cd my-docs && holydocs init`.