feat(cli): add describe command for detailing OCM entities and metadata#1554
Merged
fabianburth merged 20 commits intoFeb 4, 2026
Merged
Conversation
…data Introduces the `describe` command, including the `types` subcommand, to describe OCM subsystems, types, and configuration schemas. Adds supporting markdown and text renderers for improved documentation output. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
… structure Replaces the deprecated internal `jsonschema` package with functionality from the `runtime` module. Refactors CLI renderers for `types` command to streamline schema introspection and output formatting. Adds support for `jsonschema` output format. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
… schemas Removes all schema definitions, markers, and code related to the Diataxis documentation model, along with its integration into the JSON schema generation. Simplifies the codebase by eliminating unused documentation features. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Adds support for new output formats (`markdown`, `html`) and customizable table styles (`StyleColoredBright`, `StyleColoredDark`, `StyleDefault`) for the `types` commands. Refactors subsystem sorting and removes unused `title` field from `Subsystem` struct for a streamlined design. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Introduces a new `--examples` flag to display YAML-formatted examples for specific types and schemas in the `types` command. Updates schema definitions and CLI flags to support this feature. Enhances JSON schema generation with example markers. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
… `types` command Adds support for rendering output through a pager (e.g., `less`) for improved readability in terminal environments. Refactors output rendering to detect terminal or file-based output, ensuring appropriate handling for different output types. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
7 tasks
4ca0c12 to
19a069c
Compare
Signed-off-by: Jakob Möller <contact@jakob-moeller.com> # Conflicts: # bindings/go/generator/jsonschemagen/marker.go # bindings/go/oci/spec/transformation/v1alpha1/schemas/CTFAddComponentVersion.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/CTFAddComponentVersionSpec.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/CTFGetComponentVersion.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/CTFGetComponentVersionOutput.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/OCIAddComponentVersion.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/OCIAddComponentVersionSpec.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/OCIGetComponentVersion.schema.json # bindings/go/oci/spec/transformation/v1alpha1/schemas/OCIGetComponentVersionOutput.schema.json # cli/go.mod # cli/go.sum # cli/integration/go.mod
19a069c to
a933696
Compare
fabianburth
reviewed
Jan 23, 2026
fabianburth
reviewed
Jan 23, 2026
fabianburth
left a comment
Contributor
There was a problem hiding this comment.
I love it!
Just some small remarks. Besides, if the terminal is not wide enough, the table format quickly becomes unreadable.
Signed-off-by: Jakob Möller <contact@jakob-moeller.com> # Conflicts: # cli/go.mod
0438418 to
0af214d
Compare
…on and improved field-path navigation Adds expanded documentation for subsystems and their types, including usage examples, workflows, and output formats. Introduces support for field-path navigation using dot notation and enhances terminal output for usability. Refactors schema handling to improve modularity and reusability. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
… global registry Replaces the global subsystem registry with context-specific registries, improving encapsulation and concurrency support. Refactors registration and access patterns. Adjusts tests and CLI integration to align with the new design. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
5a106f8 to
d1d48c1
Compare
…nfo` for improved flexibility Refactors schema metadata handling in the `describe types` command by introducing the `schemaInfo` struct to encapsulate schema details. Updates output rendering to leverage modular `schemaInfo` components, enhances formatting for tables and details, and adds support for rendering fields without properties. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
…ehensive tests Replaces inline table-building logic in the `describe types` command with reusable `buildSubsystemsTable` and `buildTypesTable` functions. Simplifies code by removing unused styles and refactoring output handling. Adds extensive tests to ensure command accuracy and reliability. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
# Conflicts: # .github/config/wordlist.txt
frewilhelm
reviewed
Feb 3, 2026
frewilhelm
reviewed
Feb 3, 2026
frewilhelm
left a comment
Contributor
There was a problem hiding this comment.
I really like the command and the capabilities!
… for `types` command Streamlines output rendering logic by directly determining terminal capability at usage. Updates examples in documentation to reflect changes in field-path navigation, replacing `spec` with `baseUrl`. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
# Conflicts: # cli/go.mod # cli/go.sum # cli/integration/go.mod
Upgraded `golang.org/x/text` to v0.33.0 and multiple `ocm.software/open-component-model` modules to newer versions. Adjusted `cli/integration/go.mod` accordingly. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
…` command Eliminates references to generating example configurations using `-o examples` from both command help text and related documentation for the `describe types` command. Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com> # Conflicts: # cli/go.mod
Signed-off-by: Jakob Möller <contact@jakob-moeller.com> # Conflicts: # cli/go.mod
matthiasbruns
approved these changes
Feb 4, 2026
fabianburth
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
Introduces the
describecommand, including thetypessubcommand, to describe OCM subsystems, types, and configuration schemas. Adds supporting markdown and text renderers for improved documentation output.Which issue(s) this PR fixes
Synopsis
ocm describe types
ocm describe types input
ocm describe types input dir
fix open-component-model/ocm-project#806