# cue-lang/cue

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/cue-lang-cue).**

6,147 stars · 356 forks · Go · Apache-2.0

## Links

- GitHub: https://github.com/cue-lang/cue
- Homepage: https://cuelang.org
- awesome-repositories: https://awesome-repositories.com/repository/cue-lang-cue.md

## Topics

`configuration` `data` `kubernetes` `validation`

## Description

CUE is a constraint-based configuration language designed for data validation, schema definition, and code generation. At its core, it unifies types and values into a single concept, enabling compile-time validation that catches structural and value errors before runtime. The language treats data and constraints as the same thing, allowing a single definition to serve as both a schema and concrete configuration data.

CUE distinguishes itself through its constraint-based unification engine, which combines multiple configuration sources into a single coherent result by merging their constraints and automatically resolving conflicts. It supports a value-as-type dualism where types and values are ordered in a lattice, enabling precise subsumption and validation. The language provides built-in mechanisms for struct closure, disjunction-based alternatives, comprehension-based iteration, and dynamic field creation, giving users fine-grained control over data modeling without requiring explicit validation code.

The tool translates data between CUE, JSON, YAML, TOML, Go, Protobuf, and OpenAPI formats without losing meaning, and generates Go code, Protobuf definitions, and OpenAPI specs from CUE schemas. It offers a command-line interface for validating and processing configuration files, a Go API for programmatic integration, and script-driven data automation for orchestrating data processing workflows. CUE can be installed via Homebrew, binary download, Docker, Arch Linux packages, or built from source using Go.

## Tags

### Development Tools & Productivity

- [Constraint-Based Configuration Languages](https://awesome-repositories.com/f/development-tools-productivity/constraint-based-configuration-languages.md) — Creates and validates large-scale configuration files using a constraint-based language that unifies types and values. ([source](https://cuelang.org/))
- [Configuration File Validators](https://awesome-repositories.com/f/development-tools-productivity/configuration-file-validators.md) — Checks and validates existing JSON, YAML, and native configuration files against CUE constraints. ([source](https://cuelang.org/))
- [Compile-Time Data Constraint Definers](https://awesome-repositories.com/f/development-tools-productivity/dependency-constraints/constraint-resolvers/data-constraint-unifiers/compile-time-data-constraint-definers.md) — Defines precise value constraints and schemas validated at compile time.
- [Configuration Validators](https://awesome-repositories.com/f/development-tools-productivity/yaml-command-line-interfaces/configuration-validators.md) — Validates JSON, YAML, and CUE files against user-defined constraints from the terminal.
- [Field-Level Metadata Annotations](https://awesome-repositories.com/f/development-tools-productivity/attribute-metadata-annotations/field-level-metadata-annotations.md) — Attaches metadata like @go(Field) or @xml(attr) to fields for mapping to external representations. ([source](https://cuelang.org/docs/reference/spec/))
- [Command-Line Tools](https://awesome-repositories.com/f/development-tools-productivity/command-line-tools.md) — Ships command-line tools to validate, format, and process CUE files and configurations. ([source](https://cuelang.org/docs/howto/))
- [Policy-Based Validations](https://awesome-repositories.com/f/development-tools-productivity/configuration-file-validators/policy-based-validations.md) — Validates data against defined policies by treating types and values as a unified concept. ([source](https://cuelang.org/docs/))
- [Configuration Module Dependencies](https://awesome-repositories.com/f/development-tools-productivity/external-module-declarations/runtime-module-declarations/module-dependency-declarations/configuration-module-dependencies.md) — Declares and resolves external module dependencies for sharing definitions across projects. ([source](https://cuelang.org/docs/reference/))
- [Multi-Format Data Exports](https://awesome-repositories.com/f/development-tools-productivity/multi-format-data-exports.md) — Converts validated configurations and schemas into standard data formats for use in other systems. ([source](https://cuelang.org/docs/concept/))
- [Multi-Format Data Processors](https://awesome-repositories.com/f/development-tools-productivity/multi-format-data-parsers/multi-format-data-processors.md) — Reads and writes data in JSON, YAML, Go, and other formats for cross-tool exchange. ([source](https://cuelang.org/docs/))
- [Data Format Importers](https://awesome-repositories.com/f/development-tools-productivity/project-imports/external-file-importers/data-format-importers.md) — Converts external data formats like JSON into internal representations for processing. ([source](https://cuelang.org/docs/reference/command/))

### Programming Languages & Runtimes

- [Constraint-Based Configuration Languages](https://awesome-repositories.com/f/programming-languages-runtimes/templating-languages/data-configuration-languages/constraint-based-configuration-languages.md) — Defines and validates configuration data using a constraint-based language that unifies types and values.
- [Comprehension Iteration Constructs](https://awesome-repositories.com/f/programming-languages-runtimes/comprehension-iteration-constructs.md) — Provides comprehension-based iteration with for, if, and let constructs for generating list elements and struct fields. ([source](https://cuelang.org/docs/reference/spec/))
- [Dynamic Field Label Expressions](https://awesome-repositories.com/f/programming-languages-runtimes/dynamic-field-label-expressions.md) — Computes field labels at evaluation time using parenthesized expressions for data-driven struct keys. ([source](https://cuelang.org/docs/reference/spec/))
- [Constraint Unification Operators](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/type-constraint-combinations/constraint-unification-operators.md) — Implements the & operator to unify list elements into a single constraint, returning top for empty lists. ([source](https://cuelang.org/docs/reference/spec/))
- [Struct Closure Builtins](https://awesome-repositories.com/f/programming-languages-runtimes/struct-closure-builtins.md) — Provides language-level builtins that convert open structs to closed ones, preventing undeclared fields. ([source](https://cuelang.org/docs/reference/spec/))
- [Struct Composition](https://awesome-repositories.com/f/programming-languages-runtimes/struct-composition.md) — Embeds one struct's fields into another, bypassing closed-struct restrictions for flexible composition. ([source](https://cuelang.org/docs/reference/spec/))
- [Struct Field Restriction Mechanisms](https://awesome-repositories.com/f/programming-languages-runtimes/struct-field-restriction-mechanisms.md) — Marks structs as closed to prevent addition of undeclared fields, catching typos and extra properties. ([source](https://cuelang.org/docs/reference/spec/))
- [Go Code Generators](https://awesome-repositories.com/f/programming-languages-runtimes/go-code-generators.md) — Produces Go types and code that mirror CUE definitions for type-safe data handling. ([source](https://cuelang.org/docs/))
- [List Length Builtins](https://awesome-repositories.com/f/programming-languages-runtimes/list-length-builtins.md) — Returns the number of elements in a list or the minimum length for open lists using the len builtin. ([source](https://cuelang.org/docs/reference/spec/))

### Data & Databases

- [Data Format Translators](https://awesome-repositories.com/f/data-databases/data-format-translators.md) — Reads and writes information in JSON, YAML, and Protobuf, translating between them without losing meaning. ([source](https://cuelang.org/docs/reference/))
- [Numeric Range Constraints](https://awesome-repositories.com/f/data-databases/data-querying/table-item-filters/numeric-range-filters/numeric-range-constraints/numeric-range-constraints.md) — Defines bounds like >=0 or <10 to restrict numeric values to ranges, acting as infinite disjunctions. ([source](https://cuelang.org/docs/reference/spec/))
- [Data Schema Definitions](https://awesome-repositories.com/f/data-databases/data-schema-definitions.md) — Defines reusable data schemas using a declarative language for structuring and constraining configuration data. ([source](https://cuelang.org/docs/howto/))
- [Data Source Unification](https://awesome-repositories.com/f/data-databases/data-source-unification.md) — Combines data from different sources by merging constraints into a single consistent result. ([source](https://cuelang.org/docs/))
- [Typed Configuration Schemas](https://awesome-repositories.com/f/data-databases/data-structure-definitions/user-defined-types/typed-configuration-schemas.md) — Defines reusable typed schemas that describe the shape and constraints of configuration data. ([source](https://cuelang.org/))
- [Configuration Unifiers](https://awesome-repositories.com/f/data-databases/file-based-storage-systems/unified-configuration-interfaces/configuration-unifiers.md) — Combines separate configuration sources into a single coherent result with automatic conflict detection. ([source](https://cuelang.org/docs/howto/))
- [Struct Field Declarations](https://awesome-repositories.com/f/data-databases/naming-conventions/struct-field-mappings/struct-field-declarations.md) — Creates structured maps from labels to values with nested fields and pattern constraints. ([source](https://cuelang.org/docs/reference/spec/))
- [Value Embeddings](https://awesome-repositories.com/f/data-databases/naming-conventions/struct-field-mappings/struct-to-struct-copiers/value-embeddings.md) — Embeds expressions inside structs to unify their results, bypassing closed-struct restrictions. ([source](https://cuelang.org/docs/reference/spec/))
- [Reference Cycle Resolution](https://awesome-repositories.com/f/data-databases/relationship-modeling/cycle-detection/reference-cycle-resolution.md) — Detects and resolves reference cycles in configuration by treating self-referencing fields as top. ([source](https://cuelang.org/docs/reference/spec/))
- [Disjunctive Constraint Operators](https://awesome-repositories.com/f/data-databases/schema-definitions/alternative/disjunctive-constraint-operators.md) — Declares values that can be one of several alternatives using the | operator with sum type support. ([source](https://cuelang.org/docs/reference/spec/))
- [Closed Definition Schemas](https://awesome-repositories.com/f/data-databases/schema-definitions/closed-definition-schemas.md) — Declares definitions with # prefix that are automatically closed, enforcing fixed field sets across all usages. ([source](https://cuelang.org/docs/reference/spec/))
- [Project Constraint Validation](https://awesome-repositories.com/f/data-databases/schema-enforcement-tools/validation-constraints/project-constraint-validation.md) — Checks data against user-defined constraints and reports violations to ensure correctness. ([source](https://cuelang.org/docs/reference/command/))
- [Constraint-Based Data Navigators](https://awesome-repositories.com/f/data-databases/complex-data-structure-transformation/constraint-based-data-navigators.md) — Navigates nested data to extract, reshape, or combine values using constraint-based paths. ([source](https://cuelang.org/docs/howto/))
- [Multi-Format Encoders](https://awesome-repositories.com/f/data-databases/data-serialization-formats/data-formats/binary-json-alternatives/multi-format-encoders.md) — Translates data between CUE, JSON, YAML, TOML, Go, Protobuf, and OpenAPI.
- [OpenAPI Argument Validators](https://awesome-repositories.com/f/data-databases/json-schema-modeling/schema-validators/schema-constrained-sampling/strict-tool-argument-validators/openapi-argument-validators.md) — Uses OpenAPI data schemas directly to validate JSON or YAML data. ([source](https://cuelang.org/))
- [Protobuf Contract Validators](https://awesome-repositories.com/f/data-databases/protobuf-contract-validators.md) — Validates data values beyond Protocol Buffer schemas to extend their validation capabilities. ([source](https://cuelang.org/))
- [Value Validators](https://awesome-repositories.com/f/data-databases/protobuf-contract-validators/value-validators.md) — Extends Protocol Buffer schemas to validate data values, not just structure. ([source](https://cuelang.org/))

### DevOps & Infrastructure

- [Constraint-Based YAML Validators](https://awesome-repositories.com/f/devops-infrastructure/cicd-pipeline-automation/cicd-pipeline-management/ci-cd-workflows/ci-formatting-checks/yaml-syntax-validation/constraint-based-yaml-validators.md) — Reads and validates YAML files with user-defined constraints, replacing anchors with reliable references. ([source](https://cuelang.org/))
- [Reusable Typed Schemas](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/configuration-validation/configuration-schemas/reusable-typed-schemas.md) — Creates reusable, typed schemas that describe the shape and constraints of configuration data. ([source](https://cuelang.org/docs/howto/))
- [Closed Definitions](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/configuration-validation/configuration-schemas/reusable-typed-schemas/closed-definitions.md) — Declares definitions with a # prefix that are closed by default and enforce structure when referenced. ([source](https://cuelang.org/docs/))
- [Constraint-Based Unifiers](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-file-loading/configuration-merging/constraint-based-unifiers.md) — Combines multiple configuration sources into a single coherent result by merging constraints automatically.
- [Constraint Unification Mergers](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-file-loading/configuration-merging/constraint-unification-mergers.md) — Combines multiple configuration sources by merging constraints into a single result.
- [Multi-Source Configuration Loaders](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-file-loading/multi-source-configuration-loaders.md) — Combines settings from JSON, YAML, TOML, and other formats into a single coherent configuration. ([source](https://cdn.jsdelivr.net/gh/cue-lang/cue@master/README.md))
- [Validated Data Exports](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/configuration-migration/json-to-toml-conversions/json-to-yaml-converters/validated-data-exports.md) — Produces validated, concrete data in JSON or YAML for consumption by external tools. ([source](https://cuelang.org/docs/reference/command/))

### Scientific & Mathematical Computing

- [Type-Value Lattice Definitions](https://awesome-repositories.com/f/scientific-mathematical-computing/lattice-based-data-merging/distributive-lattice-definitions/type-value-lattice-definitions.md) — Defines data and constraints using a lattice-based value system where types and values are ordered for precise validation. ([source](https://cuelang.org/docs/reference/spec/))
- [Value Lattices](https://awesome-repositories.com/f/scientific-mathematical-computing/lattice-based-data-merging/distributive-lattice-definitions/value-lattices.md) — Organizes values in a partial order with unique greatest lower bounds for type-value unification. ([source](https://cuelang.org/docs/reference/spec/))
- [Euclidean Division Utilities](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/arithmetic-number-types/multiplication-algorithms/number-theory-algorithms/euclidean-division-utilities.md) — Computes truncated and Euclidean quotients and remainders using quo, rem, div, and mod builtins. ([source](https://cuelang.org/docs/reference/spec/))

### Software Engineering & Architecture

- [Disjunct Default Selectors](https://awesome-repositories.com/f/software-engineering-architecture/conditional-branching/conditional-expression-returns/conditional-value-selection/disjunct-default-selectors.md) — Marks disjuncts with an asterisk to select preferred values when resolving expressions to concrete output. ([source](https://cuelang.org/docs/reference/spec/))
- [Value References](https://awesome-repositories.com/f/software-engineering-architecture/configuration-references/value-references.md) — Derives one configuration value from another using references, reducing duplication and keeping configurations consistent. ([source](https://cuelang.org/docs/tour/))
- [Data Encoders and Decoders](https://awesome-repositories.com/f/software-engineering-architecture/data-encoders-and-decoders.md) — Converts data between CUE and various formats such as JSON, YAML, and Protobuf for interoperability. ([source](https://cuelang.org/docs/howto/))
- [Multi-Format](https://awesome-repositories.com/f/software-engineering-architecture/data-encoders-and-decoders/multi-format.md) — Converts between CUE and multiple data formats using built-in encodings for system interoperability. ([source](https://cuelang.org/docs/concept/))
- [Data Validation Schemas](https://awesome-repositories.com/f/software-engineering-architecture/data-validation-schemas.md) — Defines and enforces constraints on data structures, ensuring values conform to expected types and formats. ([source](https://cuelang.org/docs/concept/))
- [Schema Default Values](https://awesome-repositories.com/f/software-engineering-architecture/default-configuration-values/schema-default-values.md) — Assigns fallback values to disjuncts so they are selected when expressions must resolve to a single concrete value. ([source](https://cuelang.org/docs/reference/spec/))
- [Versioned Configuration Modules](https://awesome-repositories.com/f/software-engineering-architecture/feature-extensions/capability-bundles/configuration-packages/configuration-package-imports/versioned-configuration-modules.md) — Organizes configuration logic into shareable, versioned modules that can be imported and reused across projects. ([source](https://cuelang.org/docs/howto/))
- [Constraint-Based JSON Validators](https://awesome-repositories.com/f/software-engineering-architecture/json-schema-validation/json-syntax-validators/constraint-based-json-validators.md) — Validates JSON data against user-defined constraints to enforce structure and values. ([source](https://cuelang.org/))
- [Conditional and Multi-Schema Validators](https://awesome-repositories.com/f/software-engineering-architecture/json-schema-validation/json-syntax-validators/constraint-based-json-validators/conditional-and-multi-schema-validators.md) — Ships built-in validators like matchN and matchIf for conditional and multi-schema constraint checking. ([source](https://cuelang.org/docs/reference/spec/))
- [Schema-Driven Code Generators](https://awesome-repositories.com/f/software-engineering-architecture/openapi-specification-parsers/go-code-generators/specification-from-code-generators/code-from-specification-generators/schema-driven-code-generators.md) — Generates Go code, Protobuf definitions, and OpenAPI specs from CUE schemas.
- [Default Value Applications](https://awesome-repositories.com/f/software-engineering-architecture/redundant-definition-cleanup/redundant-keyword-removal/default-value-applications.md) — Applies policies and defaults to eliminate repeated values, keeping configuration concise and maintainable. ([source](https://cuelang.org/))
- [Constraint-Value Dualisms](https://awesome-repositories.com/f/software-engineering-architecture/typed-value-systems/constraint-value-dualisms.md) — Unifies types and values so a single definition serves as both schema and data.
- [Typed Constraint Definitions](https://awesome-repositories.com/f/software-engineering-architecture/typed-value-systems/constraint-value-dualisms/typed-constraint-definitions.md) — Defines constraints where types and values are the same concept, making data definitions clear and concise. ([source](https://cuelang.org/docs/tour/))
- [Value Unifications](https://awesome-repositories.com/f/software-engineering-architecture/typed-value-systems/constraint-value-dualisms/value-unifications.md) — Combines two values into their greatest lower bound, producing a more specific value. ([source](https://cuelang.org/docs/reference/spec/))
- [Data Processing Expressions](https://awesome-repositories.com/f/software-engineering-architecture/configuration-pipelines/expression-based-configurations/data-processing-expressions.md) — Uses a rich set of expressions to construct, validate, and transform data within configurations. ([source](https://cuelang.org/docs/tour/))
- [Go-to-Schema Translators](https://awesome-repositories.com/f/software-engineering-architecture/data-schema-validation/data-type-validation/value-type-conversions/go-type-validators/go-to-schema-translators.md) — Uses its Go API to validate, constrain, and convert data, including translating Go types into CUE schemas. ([source](https://cuelang.org/))
- [Schema Inferences from Sample Data](https://awesome-repositories.com/f/software-engineering-architecture/data-schema-validation/schema-inferences-from-sample-data.md) — Infers type definitions from sample JSON or YAML data to serve as validation templates. ([source](https://cdn.jsdelivr.net/gh/cue-lang/cue@master/README.md))
- [Data Sync Conflict Resolution](https://awesome-repositories.com/f/software-engineering-architecture/data-sync-conflict-resolution.md) — Resolves conflicts when combining multiple data sources or schemas into a single result. ([source](https://cuelang.org/docs/))
- [Configuration Package Imports](https://awesome-repositories.com/f/software-engineering-architecture/feature-extensions/capability-bundles/configuration-packages/configuration-package-imports.md) — Splits configurations into separate packages for modular and scalable setups.
- [JSON Schema Validation](https://awesome-repositories.com/f/software-engineering-architecture/json-schema-validation.md) — Reads JSON Schema definitions as CUE constraints and validates data against them. ([source](https://cuelang.org/))
- [JSON Schema Converters](https://awesome-repositories.com/f/software-engineering-architecture/json-schema-validation/json-schema-converters.md) — Validates data against JSON Schema constraints and converts between JSON Schema and native formats. ([source](https://cuelang.org/))
- [Configuration Defaults](https://awesome-repositories.com/f/software-engineering-architecture/redundant-definition-cleanup/redundant-keyword-removal/default-value-applications/configuration-defaults.md) — Applies policies and templates to automatically fill in defaults and eliminate redundant values from configurations. ([source](https://cuelang.org/))
- [OpenAPI Specification Validators](https://awesome-repositories.com/f/software-engineering-architecture/specification-validation-schemas/openapi-specification-validators.md) — Validates data directly against OpenAPI schemas to simplify working with OpenAPI definitions. ([source](https://cuelang.org/))
- [Builtin Error Generators](https://awesome-repositories.com/f/software-engineering-architecture/validation-error-customizations/builtin-error-generators.md) — Provides the error builtin to generate bottom values with custom error messages during validation. ([source](https://cuelang.org/docs/reference/spec/))

### System Administration & Monitoring

- [Validation API Integrations](https://awesome-repositories.com/f/system-administration-monitoring/framework-instrumentation/go-integrations/validation-api-integrations.md) — Integrates validation and schema capabilities directly into Go applications via its API. ([source](https://cuelang.org/docs/howto/))

### User Interface & Experience

- [Infinite Range Bounds](https://awesome-repositories.com/f/user-interface-experience/component-props-management/bound-function-comparison/infinite-range-bounds.md) — Defines infinite sets of concrete values using comparison operators for numeric range constraints. ([source](https://cuelang.org/docs/reference/spec/))

### Part of an Awesome List

- [Multi-Format Data Readers](https://awesome-repositories.com/f/awesome-lists/data/data-formats-and-parsers/multi-format-data-readers.md) — Reads and validates data from JSON, YAML, and other formats into a unified configuration. ([source](https://cuelang.org/docs/))
- [Structured Data Format Converters](https://awesome-repositories.com/f/awesome-lists/data/data-formats-and-parsing/structured-data-format-converters.md) — Translates data between CUE, JSON, YAML, TOML, Go, Protobuf, and OpenAPI formats.
- [Expression-Based Data Validations](https://awesome-repositories.com/f/awesome-lists/data/data-profiling-and-validation/expression-based-data-validations.md) — Uses a rich set of expressions to construct, validate, and process data within configurations. ([source](https://cuelang.org/docs/tour/))
- [Structured Data Importers](https://awesome-repositories.com/f/awesome-lists/data/json-and-data-parsing/structured-data-importers.md) — Imports structured data from JSON and YAML files directly into CUE for validation. ([source](https://cuelang.org/docs/))
- [Configuration Languages](https://awesome-repositories.com/f/awesome-lists/devtools/configuration-languages.md) — Validates and generates configuration data using a constraint-based language.

### Business & Productivity Software

- [Schema Validators](https://awesome-repositories.com/f/business-productivity-software/task-workflow-automation/productivity-task-management/productivity-tools/command-line/schema-validators.md) — Validates data files against schemas directly in the terminal for script integration. ([source](https://cuelang.org/docs/howto/))

### Content Management & Publishing

- [Built-in Validation Functions](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/content-validation/custom-validation-functions/built-in-validation-functions.md) — Uses functions like matchN and matchIf to check that a value satisfies a conditional or multi-schema constraint. ([source](https://cuelang.org/docs/reference/spec/))

### Networking & Communication

- [Webhook Configuration Removal](https://awesome-repositories.com/f/networking-communication/api-integration-frameworks/webhook-management/payment-webhooks/webhook-configuration-removal.md) — Applies policies to template values and defaults, automatically removing redundant information from configurations. ([source](https://cuelang.org/))
