Expand description
Plugin API v0 (ADR-008) — unstable.
A plugin is a Generator: given the project context and its arguments, it produces a
Plan. Applying the plan goes through the same safe Writer as the built-in
generators, so a third-party generator inherits the whole safety model for free (never
clobber without --force, honor --dry-run, manifest as source of truth). No plugin
writes files directly.
Two integration paths (ADR-008):
- In-process: a crate implements
Generatorand either builds a customgizeor its own binary, callingrun. - Subcommand fallback: a
gize-<name>binary onPATHis invoked bygize <name> ….
The trait and GenContext are v0 and may change until stabilized in the RC.
Structs§
- GenContext
- What a generator gets to work with: the project manifest and its root directory.
Traits§
- Generator
- A third-party (or built-in) code generator. Implement this to extend
gize(ADR-008, v0).
Functions§
- run
- Run a generator against the current project: build the context, ask it for a plan, and
apply that plan through the safe
Writer(honoringforce/dry_run). This is the entry point a plugin binary calls frommain. - run_in
- Apply a generator’s plan against an explicit context (useful for tests and custom hosts).