xfetch-extension-api provides the public types that extension
authors are expected to use. Extensions are standalone binaries that
communicate with xfetch over a stdin/stdout JSON protocol, separate from the
plugin system.
ConfigProviderRequestConfigProviderResponseExtensionKind
xfetch writes one ConfigProviderRequest JSON to stdin
(the fully resolved config plus optional args), the extension
modifies it, and writes one ConfigProviderResponse JSON to
stdout with the new config.
{
"version": 1,
"kind": "config_provider",
"config": { "show_colors": true, "modules": ["os", "cpu"] },
"args": { "strategy": "random" }
}{
"config": { "show_colors": false, "modules": ["cpu", "memory"] }
}
Extensions should write errors to stderr and exit with a
non-zero code; the core skips the extension and keeps the previous config.
- The crate owns the shared wire protocol, not end-user config files.
- Extensions run at config load time and can modify or replace the effective config.
- Official extensions are expected to use the same public SDK as third-party extensions.