validate
Help page for codify validate
codify validate
[--debug]
[-o plain|default|debug|json]
[-p <value>]The validate command checks your Codify configuration file for errors without making any changes to your system. This is useful for quickly verifying that your configuration is syntactically correct, uses valid resource types, and passes all schema validation rules before running codify plan or codify apply.
Validation performs several checks:
- Syntax validation: Ensures your JSON/JSONC/JSON5/YAML file is properly formatted
- Schema validation: Verifies all resources match their expected schemas
- Type validation: Confirms all resource types are recognized and supported
- OS compatibility: Checks that resources are compatible with your operating system
- Plugin validation: Runs plugin-specific validation rules for each resource
Unlike plan or apply, validate does not query your system's current state or calculate what changes would be made. It only validates the configuration file structure and content.
Options
Path: --path -p
Specify the path for the configuration file. This parameter accepts both relative and absolute paths. Supports codify.jsonc, codify.json, codify.json5, and codify.yaml files.
Output mode: --output -o
Specify the CLI output mode. Options: [default, plain, json]. The output mode controls what gets printed to the console.
Debug output mode: --debug
Enable debug mode for verbose logging. The DEBUG=codify flag will be passed to all plugins for detailed troubleshooting output. Useful for debugging validation issues.
Examples
# Validate the codify.jsonc in current directory
codify validate
# Validate a specific configuration file
codify validate -p ~/my-configs/codify.jsonc
# Validate with plain output (useful for scripts)
codify validate --output plain
# Validate with debug output for troubleshooting
codify validate --debugCommon Validation Errors
Unknown resource type: The type field contains a resource type that isn't recognized by any installed plugin.
Missing required fields: A resource is missing required configuration parameters.
Invalid field values: A parameter value doesn't match the expected type or format (e.g., string instead of number).
OS incompatibility: A resource is not supported on your current operating system.
Schema violations: The resource configuration doesn't conform to the JSON schema definition.