Cue

Cue·CueLang.Cue

CUE is an open source data constraint language which aims to simplify tasks involving defining and using data.

winget install --id CueLang.Cue --exact --source winget

Latest 0.17.0·June 29, 2026

Release Notes

Changes which may break some users are marked below with: ⚠️ Language The active try experiment renames the new fallback keyword, used with for comprehensions, to otherwise. fallback continues to be accepted for now, but is rewritten to the new form. The active aliasv2 experiment now allows ~(X) as an alternative to ~X for the single postfix alias form. ~X is also rewritten as ~(X) for the sake of consistency and clarity. Language versions v0.17.0 and later allow omitting commas in multi-line lists. Just like a newline after a struct field implies a comma, a newline after a list element now implies a comma as well. Language versions v0.17.0 and later allow a newline or a comma before the closing bracket of an index expression, matching how lists and func arguments allow omitting trailing commas. The language spec is tweaked to make $ a valid identifier, which was already allowed by the parser and evaluator. ⚠️ Support for the infix div, mod, quo, and rem operators has been removed. Since late 2020, these infix forms have been undocumented and rewritten by cue fix to the new function calls. The new shortcircuit experiment This release introduces the shortcircuit experiment, which changes the && and || operators to not evaluate the right operand if the left operand alone determines the result. This matches the behavior already documented in the CUE spec and is consistent with most mainstream languages, but for the sake of a smooth transition for end users, we are rolling out this change via an experiment. You can try this experiment via the @experiment(shortcircuit) file attribute. To mimic the old behavior with the experiment, you can use a hidden field: _y: Y if X && _y {} Evaluator Comprehensions The comprehension algorithm now waits to run a comprehension's body until the fields it reads have a concrete value, rather than trying to produce its fields up front. This resolves a number of long-standing bugs, most notably the last known regressions from evalv2, where a comprehension that should have resolved instead failed as an incomplete value or a cycle. This design also greatly simplifies upcoming evaluator work, such as introducing new builtins to replace comparing values to bottom, as well as the design of evalv4. Other changes The evaluator no longer deduplicates errors just by position, which was causing some useful errors from disjunctions or standard library calls to be dropped incorrectly. Several long-standing cycle-detection bugs have been fixed, such as self-referential uses of matchN and matchIf, self-feeding disjunctions, and comprehensions that read a let binding which refers back to the comprehension's own fields. Fixed a bug where the same package imported via different qualified import paths (e.g. foo.com/bar@v0 or foo.com/bar:baz) did not share the same hidden field namespace. Resolving an unversioned import from a dependency module now respects that module's own default major version, instead of always using the main module's default. Fix a number of issues where cue def could produce invalid CUE output, such as due to name conflicts. Fix an evaluator regression where embedded disjunctions across packages may not correctly apply closedness. Fix an evaluator bug where cue.Context.BuildExpr of close({}) did not actually result in a closed struct. Fix a bug where some calls to standard library functions or validators did not include the "error in call to pkg.Func" error context, or included it twice. A few changes to the evaluator should reduce allocated objects by up to 16%, reducing GC overhead and memory usage. To ease the transition into the new formatter we plan to release with v0.18, CUE_EXPERIMENT=formatv2=0 is now allowed as a no-op. A number of other bugs, panics, and hangs have been resolved as well. cmd/cue Module replaces CUE now supports substituting a module dependency with a local directory or a different remote module during development - for example while testing a fix to a dependency before it is published, or to replace a dependency with a fork including improvements. This configuration lives in cue.mod/local-module.cue, which is excluded when publishing to registries. cue mod edit and cue mod tidy gain support for maintaining this file. We have also published a how-to guide on replacing a dependency with a local module. Read the full design doc in the proposal, or read the cue.mod/local-module.cue reference docs. Other changes The new global -C or --chdir flag runs cue from the given working directory. Command input parsing is improved so that CUE packages can come after data files, such as cue vet -c data.yaml ./schema. cue import --with-context now ensures that data represents the original raw input data, and not its interpretation like JSON Schema. cue import --path now skips over null values in an input stream, such as empty documents in a YAML file. Fix a bug where the flag cue export --path was ignored when the inputs were pure CUE. The new cue exp gengotypes --outfile flag controls the output file path when generating a single package. cue vet -d/--schema now supports hidden fields, and correctly reports an error when the command inputs are CUE only. cue fix and cue trim no longer change file modification times when no changes are necessary. A $CUE_CACHE_DIR directory is no longer required when loading CUE without external dependencies. The "filetypes" lookup tables now use a more compact encoding, saving about 150KiB in binary size for cmd/cue as well as Go API users. LSP server Add an initial version of organize-imports, which sorts the existing imports and removes unneeded imports. It is not yet capable of suggesting missing imports. Wait for a short period of inactivity before sending diagnostics to the editor. This "debounce" means that a user typing incomplete CUE syntax will not be distracted with syntax errors as much. The aliasv2 experiment is now fully supported. The rename function is fixed to distinguish between field names and aliases. Improve field name analysis in general so that fields with multiple aliases (e.g. v=[k=string]: _) are properly supported. Improve attribute handling for file-level embedded attributes, and to attach attributes within expressions to the correct struct. Treat conjunctions (&) and disjunctions (|) the same way for goto-definition. With the cursor on a path, it returns all results that the path MAY resolve to. With the cursor on a field declaration name, it returns all results that the path constructed from the field's name, and its field's name (and so on) MAY resolve to. Special-case close function calls so that paths can resolve through fields within the argument to close. Encodings ⚠️ The experimental JSON Schema encoder now emits most definitions without the leading # character, shortening names and ensuring compatibility with the wider JSON Schema ecosystem. This required deprecating encoding/jsonschema.GenerateConfig.NameFunc in favor of NamesFunc. The JSON Schema encoder is improved to support list.UniqueItems and standalone validators, to use maxItems and minItems instead of maxLength and minLength for lists with prefix elements, and to generate description keywords for doc comments. Several closedness bugs in the JSON Schema encoder have been fixed, ensuring that the generated JSON Schema behaves the same way as the original CUE definition. The JSON Schema decoder is improved to better handle the prefixItems keyword. The ProtoBuf decoder now resolves relative references following the usual scoping rules, instead of always resolving them against the top-level scope. Standard library Add time.ToUnix and time.ToUnixNano, which convert an RFC3339Nano time value into seconds or nanoseconds since the Unix epoch, complementing the existing Unix builtin. strconv.FormatFloat now accepts a string format parameter, like FormatFloat(3.14, "e", 4, 64). list.MatchN now shows what expected value it's matching against when it fails. The net IP APIs now consistently return an error on invalid input types. Go API Using cue.Values concurrently is now fully supported, which required deprecating cue.Value.Context. If you encounter any races or bugs, please report them via the issue tracker. cue/load now supports loading from an io/fs.FS, as outlined in proposal #4285. Loading file embeds through Config.Overlay and Config.FS is supported now as well. cue/ast/astutil deprecates Sanitize in favor of the new SanitizeFiles API, given that Sanitize on a single file cannot know if another file in the same package shadows builtin names like self. Add Path.Compare and Selector.Compare, providing allocation-free total ordering suitable for slices.SortFunc. Clarify that cue/format indents with a tab width of 4 by default. A new fuzzer has been introduced in the cue package, checking that the parser doesn't crash and that its results are consistent with the rest of the Go APIs like cue/literal. So far, it has already resulted in seventeen bug fixes. The cue.Interpreter option API has been deprecated in favor of cue.WithInjection, which is a better name going forward. ⚠️ cue/ast.File.Imports, deprecated in mid 2025 in favor of cue/ast.File.ImportSpecs, is now removed. ⚠️ The long-deprecated and hidden cue.Instance methods Lookup, LookupDef, LookupField, and Fill are now removed. ⚠️ The modconfig.Registry interface is changed to report default major versions, which is required for resolving unversioned imports against each dependency module's own defaults. Clients that implement or wrap the interface will need to update. The new interface is future-proofed for upcoming modules changes. Full list of changes since v0.16.0

  • [release-branch.v0.17] internal/mod: resolve module replacements via minimum-version selection by @rogpeppe in 0fc639b
  • cue/format: revert #4296 regression test by @mvdan in e73658d
  • cue/format: revert manual-AST field alignment fix by @mvdan in c3f08a1
  • cue/format: revert issue #1006 test cases by @mvdan in 60e1bb7

Installer type: zip

ArchitectureScopeDownloadSHA256
x64Download5EE7C2A1AD13B8ED7521B164532E48C8BC1618B500AC3C5808CBBD47D4C9CCB8
arm64DownloadCEFCFC8AAD2CD6374512F45975FB8CD0DC69DCB6E3C2CA2022E2E1761F5FB858

Details

Homepage
https://github.com/cue-lang/cue
License
Apache-2.0
Publisher
Cue
Support
https://github.com/cue-lang/cue/issues

Tags

configurationdatakubernetesvalidation

Older versions (18)

0.16.1
ArchitectureScopeDownloadSHA256
x64Download2F24123F458229FCF283DB534BD86692AD1074DA806DEFEE0F0CC62976C0397C
arm64DownloadE0C15CE53F73E8609B0E8CE6507298F3474B334AC5EB0C826C9497A811FD0CCE
0.16.0
ArchitectureScopeDownloadSHA256
x64DownloadE57180A908A5E35D8A2BE00BA620B52FC6FDFC6E1400799D25BB53A115555B03
arm64DownloadE0BD483BE9159144C1ED2A19EE722A1FC6EE18BFDE173AFE02637F0AF8DA501E
0.15.4
ArchitectureScopeDownloadSHA256
x64DownloadD42E26A0FB09219FC1735326FB2188DADF7C8DEAB136698A55D793C0C15A6AAA
arm64DownloadA19CE1F517879B1BB3F5CB815364A2EC74B0302B54A86F5802A2C56AE3B7BA97
0.15.3
ArchitectureScopeDownloadSHA256
x64DownloadD291BD510887BF1308A6BC07C28D17C7F01BC75E7A885ADACDBD30D6D6ECBD20
arm64DownloadF7B72102BCF227800276BFB22D0D16CFCDAECEB79A1E99AF492AAA3EEA6BB839
0.15.1
ArchitectureScopeDownloadSHA256
x64Download516FA080C1AF12578FF76A4165CC7BF14AD9BBE5D9724A0C07553860D038885E
arm64DownloadBF789490A4C9B1FE2AEC8B1B078FB5CDD428C4653FAE1A0572CB75C1ADE50CA7
0.15.0
ArchitectureScopeDownloadSHA256
x64Download188931801FF39CD397589A7A271EDE54EF0694900CA3F06BC9834DDDBB3F39AE
arm64DownloadA47D356E4AD3CD891DF55C28C24763193F4973662BE9CCC4704090083D89FF34
0.14.2
ArchitectureScopeDownloadSHA256
x64Download0A1C6A050494D2D8D671E15967D2D2AB2BD37DCE48E193E59728242797C86BB0
arm64Download2187A7909951BFF30DD621DDE368CDEEBC30DC5FCF8D93F2F9C3DDC558AECA1D
0.14.1
ArchitectureScopeDownloadSHA256
x64DownloadB2289FEB775DB9D10DE6C039FFECCC8AFB7A7FE0C656AF891F8FCE7F38AA1D8A
arm64Download3BA4B950B1880AEC6F3DDD5D96F43648E4E0FF58151FFC17375068EF9EBF361A
0.14.0
ArchitectureScopeDownloadSHA256
x64Download9041F014820924E4FDE7BB2C295F4DA63E9AD6590F92D73E6C4BC37ABE5F2077
arm64Download045878CF337143B54CCAFF2718C4DD2431922AD53182A17D088E7A3D731B032B
0.13.2
ArchitectureScopeDownloadSHA256
x64Download9C5513C5BBAE3AAB5B906611E8E487A999BFB69851ED3267D4FF3C488269C271
arm64DownloadB97AC155F753FF58633EC50985FF5BA90C719A5F1FBC59EA2B84E6CE2C026555
0.13.1
ArchitectureScopeDownloadSHA256
x64Download934F10F81E3FEA059594029C84FD0AE49C4D746F463654DAF4A06C10B0A369B0
arm64Download4D6DF90A83E6BE1EF8EEF997877DF6BCAFB9B97763A303B962D2815B92560516
0.13.0
ArchitectureScopeDownloadSHA256
x64DownloadA17423528E176F984AE4778FE5C757955783985913A8E18D6CCC663EAF91C279
arm64DownloadFEF57DF2265C9CE92426EA698C9BF38E053F6B579A5F7CF1B8963926252AAC00
0.12.1
ArchitectureScopeDownloadSHA256
x64DownloadA80B570BD5D2D7D7E653F3C8689B37A7396A98D486901A14954F1EF6A83BD275
arm64Download61563BF81F0020BF7B6DD7F69B981F0E77DD0A014B17323905236623CA3CA705
0.12.0
ArchitectureScopeDownloadSHA256
x64Download268BF95F4767B37D5DB01450D55CA9D10E9A8BD8A1417C31DFF456B5F9775ABF
arm64Download91AD090EB86B0D21186D8DE0A7B985D235B27E67CD464F7738663E457B042505
0.8.0
ArchitectureScopeDownloadSHA256
x64Download8E3CED001982F10581DC1A6EEB82E08ADEE1B1E2ABE5B7E837A35401895C6BA7
arm64DownloadF5E5D9D3C7D0649D16AFDBC21BDE51EBC558FE64AC51AE89085037363DD658FC
0.7.1
ArchitectureScopeDownloadSHA256
x64Download54D2A7F64985BB5F4BDBFF8796EE9F290BA7C86BA1D8B98822373D01EBFAE19A
arm64Download4583FC57B6E90DA51F2397D0C9E65912D18A4DC4A6C946EA4347AF91BD9C7F38
0.7.0
ArchitectureScopeDownloadSHA256
x64Download50BE1C1A622C2544AE834B377293A587A0C08B3EA6C82441AE1D59435EEB5240
arm64Download257AB9A0A2723B84CB24F8F6AE7A9F899EBDE49B81371EF9EE1EC34FACFA2CCD
0.6.0
ArchitectureScopeDownloadSHA256
x64Download69C32671349665EC4AF9B8AB7A312E870B8318BF747041C0DA2B8F505CE0E2E5
arm64DownloadC8BA01B8914DA74BEDBCA653846C0311DCC2ED07FDB83BEBACC59BA0F72C3F7E