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

# dino init

> Interactive project setup: generates a .dino.yml configuration file

Set up a new Dino project by answering a few questions. Generates a `.dino.yml` config file in the current directory.

Runs without tenant context. No existing configuration or authentication required.

## Usage

```bash theme={null}
dino init [flags]
```

## Flags

| Flag      | Type      | Default | Description                                                      |
| --------- | --------- | ------- | ---------------------------------------------------------------- |
| `--force` | `boolean` | `false` | Skip the overwrite confirmation when `.dino.yml` already exists  |
| `--quiet` | `boolean` | `false` | Suppress banner, preview output, and endpoint reachability check |

## Interactive Prompts

The wizard asks five questions:

| #  | Prompt                   | Type                       | Default             |
| -- | ------------------------ | -------------------------- | ------------------- |
| 1  | API endpoint URL         | text (validated URL)       | —                   |
| 2  | Protocol                 | select                     | `graphql`           |
| 3  | Requires authentication? | confirm                    | No                  |
| 3a | Auth env var name        | text (shown if auth = yes) | `DINO_API_TOKEN`    |
| 4  | Output format            | select                     | `json`              |
| 5  | Enable AI analysis?      | confirm                    | No                  |
| 5a | Anthropic key env var    | text (shown if AI = yes)   | `ANTHROPIC_API_KEY` |

<Note>
  You can cancel at any prompt with `Ctrl+C`. No file is written and the exit code is `0`.
</Note>

## Examples

### Basic setup

```bash theme={null}
dino init
```

```text theme={null}
Welcome to Dino — API Intelligence

Let's set up your project.

? What's your API endpoint URL? https://api.example.com/graphql
? What protocol does your API use? GraphQL
? Does your API require authentication? No
? Output format? JSON (machine-readable)
? Enable AI-powered analysis? No

--- .dino.yml ---
# yaml-language-server: $schema=https://usedino.dev/schema.json
# Generated by dino init — see docs/CONFIGURATION.md for all options

endpoint: https://api.example.com/graphql
protocol: graphql
format: json
-----------------

Created .dino.yml

Next steps:
  dino scan
```

### With authentication and AI reasoning

```bash theme={null}
dino init
```

```text theme={null}
? What's your API endpoint URL? https://api.staging.example.com/graphql
? What protocol does your API use? GraphQL
? Does your API require authentication? Yes
? Environment variable name for your token? MY_API_TOKEN
? Output format? Markdown (human-readable)
? Enable AI-powered analysis? Yes
? Environment variable for Anthropic key? ANTHROPIC_API_KEY

Created .dino.yml

Next steps:
  export MY_API_TOKEN="your-token-here"
  export ANTHROPIC_API_KEY="sk-ant-..."
  dino scan
```

### Overwrite existing config

```bash theme={null}
dino init --force
```

Skips the "`.dino.yml` already exists. Overwrite?" prompt and writes immediately.

## Generated Config

<CodeGroup>
  ```yaml Minimal (no auth, no AI) theme={null}
  # yaml-language-server: $schema=https://usedino.dev/schema.json
  # Generated by dino init — see docs/CONFIGURATION.md for all options

  endpoint: https://api.example.com/graphql
  protocol: graphql
  format: json
  ```

  ```yaml With auth and AI theme={null}
  # yaml-language-server: $schema=https://usedino.dev/schema.json
  # Generated by dino init — see docs/CONFIGURATION.md for all options

  endpoint: https://api.example.com/graphql
  protocol: graphql
  format: markdown
  auth:
    enabled: true

  # AI reasoning enabled — set ANTHROPIC_API_KEY env var before running dino scan
  ```
</CodeGroup>

## Safety Guarantees

<Warning>
  `dino init` never writes secrets to `.dino.yml`. Auth tokens and API keys are referenced by environment variable name only.
</Warning>

| ID    | Invariant             | Description                                                       |
| ----- | --------------------- | ----------------------------------------------------------------- |
| INV-1 | No secrets in YAML    | Tokens and keys stored as env var references, never values        |
| INV-2 | Existing config check | Prompts before overwriting unless `--force` is passed             |
| INV-3 | Schema consistency    | Generated YAML passes the same Zod schema used by `dino validate` |
| INV-5 | Endpoint reachability | HEAD request with 5s timeout; warns but continues if unreachable  |

## Exit Codes

| Code | Meaning                                                   |
| ---- | --------------------------------------------------------- |
| `0`  | Config written successfully, or user cancelled            |
| `1`  | Failed to write `.dino.yml` (permission error, disk full) |

## Related

* [`dino validate`](/cli/validate) — Validate an existing config
* [`dino scan`](/cli/scan) — Run a scan using the generated config
* [`.dino.yml` Reference](/config/dino-yml) — Full configuration reference
