Skip to Content
marmot
Commands

Run the //go:generate directives of the named packages like go generate, and cache what each one writes, keyed by the directive, its environment, the generator binary and the package's other files. A directive whose inputs did not change has its outputs restored instead of running again. -n lists directives and whether they are cached; -force runs everything.

Usage
marmot generate [packages] [flags]

Examples

marmot generate ./...
marmot generate -n ./...
marmot generate -run stringer .

marmot generate ./... runs //go:generate directives like go generate, and remembers what each one wrote, keyed by the directive, its environment, the generator binary and the package's other files. When none of those changed, the outputs are restored instead of running the generator. -n lists directives and whether they are cached; -force runs everything.

-json writes one generate object per directive (command, cached, outputs) and a result.

Flags

Flags take one dash or two: -release and --release are the same.

FlagMeaning
-color stringcolor in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
-forcerun every directive, ignoring the cache
-jsonmachine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
-nprint the directives and whether they are cached; run nothing
-run stringonly directives whose text contains this
-vprint each directive as it runs

Full help

marmot generate --help
Run the //go:generate directives of the named packages like go generate, and cache what each one writes, keyed by the directive, its environment, the generator binary and the package's other files. A directive whose inputs did not change has its outputs restored instead of running again. -n lists directives and whether they are cached; -force runs everything.

Usage:
  marmot generate [packages] [flags]

Examples:
marmot generate ./...
marmot generate -n ./...
marmot generate -run stringer .

Flags:
      --color string   color in human output: auto, always or never (NO_COLOR turns auto off) (default "auto")
      --force          run every directive, ignoring the cache
  -h, --help           help for generate
      --json           machine readable output: JSON Lines on stderr (also $MARMOT_OUTPUT=json, and the default under coding agents)
      --n              print the directives and whether they are cached; run nothing
      --run string     only directives whose text contains this
      --v              print each directive as it runs

On this page

Was this page helpful?

Report an issueOpen issues