Validation happens entirely on your device. Ghostable never sees your plaintext data or schema details, maintaining a true zero-knowledge design.
Configuration
All validation lives in the.ghostable directory:
Example
.ghostable/schema.yaml file defines rules applied to every environment in the project.
Any file under .ghostable/schemas/ will override rules for that specific environment. For example, rules placed inside .ghostable/schemas/production.yaml will only be applied to the production environment.
Schema Format
Each key represents an environment variable, followed by an array of rules.schema.yaml
Supported Rules
Presence & Type| Rule | Description |
|---|---|
required | The variable must be defined. Validation fails if missing. |
nullable | The variable can be empty or null without triggering an error. |
boolean | Accepts values that can be interpreted as boolean (true, false, 1, 0). |
integer | Must be a whole number with no decimals. |
numeric | Must be a number (integer or floating-point). |
string | Must be a string value. |
in:<values> | Restricts value to a specific list, e.g. in:local,staging,production. |
Format / Pattern
| Rule | Description |
|---|---|
url | Must be a valid URL (e.g., https://example.com). |
email | Must be a valid email address. |
regex:<pattern> | Must match a regular expression. Example: regex:^v[0-9]+\\.[0-9]+$. |
starts_with:<text> | Value must begin with the given prefix (e.g., starts_with:sk_). |
ends_with:<text> | Value must end with the given suffix (e.g., ends_with:=). |
Length / Range
| Rule | Description |
|---|---|
min:<n> | Minimum allowed length (for strings) or value (for numbers). |
max:<n> | Maximum allowed length (for strings) or value (for numbers). |
Usage
Validate your local environment before pushing or deploying:- Loads
.ghostable/schema.yaml - Merges any overrides from
.ghostable/schemas/production.yaml - Validates your
.envvalues against all defined rules
Running validation in CI
Because validation runs locally with your device keys, it fits naturally into CI pipelines. For example, a GitHub Actions job can block merges when a.env drifts from the schema:
github-actions