Skip to content

Expose Go APIs for filetypes and encodings #4281

@tvandinther

Description

@tvandinther

Is your feature request related to a problem? Please describe.
I am using CUE to load a CLI config and I would like to easily allow config in various formats by loading it in as CUE. This way I can load and merge part of a configuration in JSON, another in YAML, one part in TOML, and another part in CUE.

Describe the solution you'd like
I want to implement this functionality similarly to how cue export and other commands handle multiple files. I.e. identify the type from extension or by filetype scope toml: data.foo. It would be nice to get this same functionality through an exposed API.

Describe alternatives you've considered
Alternatively I could reimplement all of this logic myself, but this would also then be out of sync with increased filetype compatibility that may come with the upstream cmd/cue.

Additional context
https://cuelang.slack.com/archives/C012UU8B72M/p1771950432593959

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions