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

# envtrap check

> Validate envtrap.json syntax and configuration rules before deployment.

# `envtrap check`

Validates the `envtrap.json` configuration file in the current working directory.

```bash theme={null}
envtrap check
```

***

## Output Examples

### Valid Configuration

If the configuration passes all schema rules, `envtrap` exits with code `0`:

```text theme={null}
✅ Configuration is valid.
```

### No Configuration Found

If no `envtrap.json` is present in the current working directory, `envtrap` notifies that default settings are in effect:

```text theme={null}
No envtrap.json found. Using default settings.
```

### Validation Failure

If any field contains an invalid type or unrecognized mode, `envtrap` prints JSONPath errors and exits with code `1`:

```text theme={null}
Configuration Validation Failed:
  - [channels.network] Expected 'block', 'warn', or 'off', received 'reject'
  - [entropy.threshold] Expected number, received 'high'
```

***

## CI/CD Pre-Commit Hook

Use `envtrap check` in pre-commit hooks or CI test scripts to catch configuration mistakes before merging:

```json package.json theme={null}
{
  "scripts": {
    "lint:config": "envtrap check"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.