A compatibility wrapper that enables v2-style CLI usage for mockery
v3.
mockery
v3 removed support for direct CLI flags like --name
, --inpackage
, etc., and requires a YAML config file instead. This proxy allows to continue using the v2-style CLI syntax without needing to rewrite existing scripts or Makefiles.
mockery-proxy
internally invokes the actual v2 command implementation from the github.com/vektra/mockery/v2/cmd
package.
go install github.com/vektra/mockery/v3@v3
go install github.com/spirin/mockery-proxy@latest
mv "$GOPATH/bin/mockery" "$GOPATH/bin/mockery3"
mv "$GOPATH/bin/mockery-proxy" "$GOPATH/bin/mockery"
with drop-in replacement:
mockery --name MyInterface --inpackage --case underscore ...etc
or without drop-in replacement:
mockery-proxy --name MyInterface --inpackage --case underscore ...etc
Behaves exactly as if you were using mockery v2
.
If the --config
flag is passed, or no arguments are provided, the proxy forwards the call directly to the mockery v3
binary installed in your system.
with drop-in replacement:
mockery --config .mockery.yml
mockery
or without drop-in replacement:
mockery-proxy --config .mockery.yml
mockery-proxy
Commands like completion
, help
, init
, migrate
, showconfig
, version
are also passed to v3
MIT