Expand description
Shared plugin protocol types for meta subprocess plugins.
This crate defines the communication protocol between the meta CLI host and its subprocess plugins (meta-git, meta-project, meta-rust, etc.).
The protocol works as follows:
- Host discovers plugins via
--meta-plugin-info(plugin responds withPluginInfoJSON) - Host invokes plugins via
--meta-plugin-exec(sendsPluginRequestJSON on stdin) - Plugin responds with either a
PlanResponseJSON (commands to execute) or direct output
Structs§
- Execution
Plan - An execution plan returned by a plugin, containing commands for the host to execute.
- Plan
Response - Wrapper for the execution plan response (the JSON envelope plugins emit).
- Planned
Command - A single command to be executed by the host via loop_lib.
- Plugin
Definition - Definition of a plugin, used by
run_plugin()to eliminate main.rs boilerplate. - Plugin
Help - Help information for a plugin’s commands.
- Plugin
Info - Metadata about a plugin, returned in response to
--meta-plugin-info. - Plugin
Request - A request from the meta CLI host to a plugin, sent as JSON on stdin.
- Plugin
Request Options - Options passed from the host to the plugin as part of the request.
Enums§
- Command
Result - The result of a plugin command execution.
Functions§
- output_
execution_ plan - Serialize and print an execution plan to stdout.
- output_
execution_ plan_ full - Serialize and print a full execution plan with pre/post commands to stdout.
- read_
request_ from_ stdin - Read and parse a
PluginRequestfrom stdin. - run_
plugin - Run a plugin’s main loop. Handles
--meta-plugin-infoand--meta-plugin-execflags.