Skip to main content
The moon ext <id> command will execute an extension (a WASM plugin) that has been configured in .moon/extensions.*. View our official extensions guide for more information.
# Execute the download extension
$ moon ext download -- --url https://github.com/moonrepo/moon/archive/refs/tags/v1.19.3.zip

# Execute a custom extension
$ moon ext my-extension -- --custom-arg value
Extensions typically support command line arguments, which must be passed after a -- separator (as seen above). Any arguments before the separator will be passed to the moon ext command itself. :::caution This command requires an internet connection if the extension’s .wasm file must be downloaded from a URL, and it hasn’t been cached locally. :::

Arguments

  • <id> - Extension ID to execute, as configured in .moon/extensions.*
  • [-- <args>] - Arguments to pass through to the extension

Configuration

  • * in .moon/extensions.*

Examples

Executing with arguments

Extensions can receive arguments after the -- separator:
# Pass a URL to a download extension
$ moon ext download -- --url https://example.com/file.zip --dest ./downloads

# Pass configuration to a formatter extension
$ moon ext format -- --style=prettier --write

Using environment variables

Extensions can also access environment variables:
# Set environment variables for the extension
$ EXTENSION_CONFIG=./config.json moon ext my-extension

Terminal output

When executing an extension, moon will show the extension’s output in real-time:
$ moon ext download -- --url https://example.com/file.zip

Downloading file from https://example.com/file.zip...
Progress: 50%
Progress: 100%
Download complete!

Build docs developers (and LLMs) love