> ## 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 validate

> Validate .dino.yml configuration against the Dino schema

Check that your `.dino.yml` is well-formed and passes all schema rules. Prints field-level error messages when validation fails.

Runs without tenant context. No network calls to external services.

## Usage

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

## Flags

| Flag      | Type      | Default | Description                              |
| --------- | --------- | ------- | ---------------------------------------- |
| `--quiet` | `boolean` | `false` | Suppress success message on valid config |

## What It Checks

Validation runs the same Zod schema used internally by `loadCliConfig()`. One source of truth for config shape.

| Field             | Validation                         |
| ----------------- | ---------------------------------- |
| `endpoint`        | Must be a valid URL                |
| `protocol`        | Must be `"graphql"`                |
| `format`          | Must be `"json"` or `"markdown"`   |
| `auth.enabled`    | Must be boolean                    |
| `auth.role`       | Non-empty string if provided       |
| `rateLimit.burst` | Integer between 1 and 500          |
| `autonomy.level`  | Must be `"observe"` or `"enforce"` |

<Tip>
  The schema uses `.passthrough()` — extra fields are allowed and ignored. You won't get errors for unknown keys.
</Tip>

## Examples

### Valid config

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

```text theme={null}
Config valid.
```

### No config file

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

```text theme={null}
No .dino.yml found — using smart defaults. Config is valid.
```

When no config file exists, Dino falls back to built-in defaults. This is not an error.

### Invalid endpoint

```yaml theme={null}
# .dino.yml
endpoint: not-a-url
protocol: graphql
```

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

```text theme={null}
Invalid .dino.yml config: endpoint: Invalid url
```

### Invalid enum value

```yaml theme={null}
# .dino.yml
endpoint: https://api.example.com/graphql
protocol: rest
```

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

```text theme={null}
Invalid .dino.yml config: protocol: Invalid enum value. Expected 'graphql', received 'rest'
```

### Multiple errors

```yaml theme={null}
# .dino.yml
endpoint: not-a-url
format: xml
rateLimit:
  burst: 9999
```

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

```text theme={null}
Invalid .dino.yml config: endpoint: Invalid url, format: Invalid enum value.
Expected 'markdown' | 'json', received 'xml', rateLimit.burst: Number must be
less than or equal to 500
```

<Note>
  All field-level errors are reported in a single message. Fix them all at once — no need to re-run between each fix.
</Note>

## Config Search Locations

`dino validate` uses [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig) to find your config:

| File                                            | Format       |
| ----------------------------------------------- | ------------ |
| `.dino.yml` / `.dino.yaml`                      | YAML         |
| `.dinorc`                                       | JSON or YAML |
| `.dinorc.json` / `.dinorc.yaml` / `.dinorc.yml` | JSON / YAML  |
| `package.json` (`"dino"` key)                   | JSON         |

<Warning>
  JavaScript config files (`.js`, `.ts`, `.cjs`, `.mjs`) are blocked for security and will be ignored.
</Warning>

## Exit Codes

| Code | Meaning                                                    |
| ---- | ---------------------------------------------------------- |
| `0`  | Config is valid, or no config file found (defaults apply)  |
| `1`  | Validation error — one or more fields failed schema checks |

## Related

* [`dino init`](/cli/init) — Generate a new config interactively
* [`dino scan`](/cli/scan) — Run a scan using the validated config
* [`.dino.yml` Reference](/config/dino-yml) — Full field reference
