Skip to main content

Module plugin

Module plugin 

Source
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 Generator and either builds a custom gize or its own binary, calling run.
  • Subcommand fallback: a gize-<name> binary on PATH is invoked by gize <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 (honoring force/dry_run). This is the entry point a plugin binary calls from main.
run_in
Apply a generator’s plan against an explicit context (useful for tests and custom hosts).