Skip to Content
marmot
Commands

marmot follows the go command where it can. Run it inside a Go module.

CommandWhat it does
marmot buildCompile packages and their dependencies into an executable.
marmot runCompile and run a program.
marmot testCompile and run package tests, like go test.
marmot checkRun vet, lint, format and the other code checks in one pass.
marmot fixApply the suggested fixes of build errors and check findings.
marmot fmtFormat Go source and fix its imports, as goimports does.
marmot watchBuild, run or test again after every change.
marmot replEvaluate Go declarations, statements and expressions interactively.
marmot sizeSize of a binary by section, package and function.
marmot benchRun benchmarks and compare them with go or a saved run.
marmot profRead a CPU or memory profile in the terminal.
marmot doctorCheck the installation and the environment and say what to fix.
marmot explainDescribe an error code.
marmot mcpServe build, run, test, fix and explain to coding agents.
marmot generateRun //go:generate directives, with their outputs cached.
marmot cacheShow the build cache size; cache trim and cache clean shrink or remove it.
marmot completion SHELLPrint shell completion for bash, zsh, fish or powershell.
marmot versionPrint the version.

Top level help

marmot --help
marmot compiles Go programs to native executables through MLIR and LLVM.
It works like the go command: run it inside a Go module.

Errors are shown with the source, the exact span, and suggested fixes on a
terminal, as plain file:line:col lines otherwise, and as JSON Lines with
-json or MARMOT_OUTPUT=json (the default under coding agents).

Usage:
  marmot [command]

Examples:
# build the package in the current directory
marmot build

# build and run a program with arguments
marmot run ./cmd/app -v input.txt

# smallest release binary
marmot build -release -O z -s -o app ./cmd/app

# apply the suggested fixes of the build errors
marmot fix

# what an error code means
marmot explain M0002

Available Commands:
  bench       Run benchmarks and compare them with go or a saved run
  bind        Generate Go bindings from a C header
  build       Compile packages and their dependencies
  cache       Show, trim or remove the build cache
  check       Run every code check in one pass: fmt, vet, lint, modernize, vuln, tidy, cross, deadcode
  completion  Generate the autocompletion script for the specified shell
  doctor      Check the toolchain, runtime, cache and environment
  explain     Describe an error code
  fix         Apply the suggested fixes of build errors
  fmt         Format Go source and fix its imports (gofmt plus goimports)
  generate    Run //go:generate directives, with their outputs cached
  help        Help about any command
  mcp         Serve marmot's tools to coding agents (Model Context Protocol)
  prof        Read a CPU or memory profile in the terminal
  repl        Evaluate Go interactively
  run         Compile and run a Go program
  size        Show what an executable's size is made of
  test        Compile and run package tests
  version     Print the marmot version
  watch       Rebuild, rerun or retest on every change

Flags:
  -h, --help      help for marmot
  -v, --version   version for marmot

Use "marmot [command] --help" for more information about a command.

On this page

Was this page helpful?

Report an issueOpen issues