A CLI template for tools to provide system metadata to installers and environment managers
Metadata providers are CLI tools that provide metadata about the system they are running on. This metadata can be used by installers and environment managers to make decisions about which packages to choose from.
The CLI was chosen as the lowest common denominator so that installer tools in different languages can all use the same metadata providers (as suggested by Paul Moore). This "interface" project provides a template for metadata providers to follow, and defines a minimal set of functionality that metadata providers should implement.
This project provides reference implementations of a metadata providers. Metadata providers should have no runtime dependencies, other than libraries that they may load for determining the system state. For example, a python script would not be a good metadata provider, because it would require the python runtime (and possibly dependencies).
Metadata providers must provide the following commands:
names
- List the names of the variants that the metadata provider providesstate
- List the state of the environment with respect to the metadata that the provider provides
The names
command should output a list of names of the variants that the metadata provider provides. The names should
be separated by newlines.
$ metadata-provider names
some-variant-key
another-variant-key
The state
command should output the state of the environment with respect to the metadata that the provider provides.
The state should be a JSON object, to minimize parsing complexity for the installer tools.
$ metadata-provider state
{
"some-variant-key": "some-value",
"another-variant-key": "another-value"
}