Skip to main content

If you encounter any problems, please report them on Github or in our forum. Your feedback is greatly appreciated and helps us to improve!

MoonBit Language plugin in Visual Studio Code

You can install it from the VS Code marketplace. This plugin provides a rich development environment for MoonBit, including functionalities like syntax highlighting, code completion, and more.


Step 1: Install the latest VS Code version.

Step 2: Click Extension on the left, search "MoonBit" and install VS Code MoonBit extension.



Step 3: Press the shift+cmd+p shortcut (for Mac, use ctrl+shift+p on Windows or Linux), and type MoonBit:install latest moonbit toolchain. Then a prompt will appear, click "Yes" and wait for the program to download.


Step 4: After the download is complete, open the terminal and enter moon new hello && code hello to create and open a new project.

Step 5: Once the project is launched, open the terminal again and enter the moon run main command to start executing the code.

MoonBit CLI Tools

To download and install MoonBit, run the following in your terminal, then follow the on-screen instructions.

curl -fsSL | bash

This command line tool is needed for creating and managing MoonBit projects.

Use moon help to view the usage instructions.

$ moon help
Moonbit's build system

Usage: moon <COMMAND>

build Build the current package
check Check the current package, but don't build object files
run Run WebAssembly module
clean Remove the target directory
new Create a new moonbit package
bench Generate build matrix for benchmarking
fmt Format moonbit
version Print version info and exit
test Run the tests
login Log in to your account
register Register an account on
publish Publish the current package
add Add a new dependency
remove Remove a dependency
tree Display the dependency tree
update Update index
doc Generate documentation
install Install dependencies
help Print this message or the help of the given subcommand(s)

-h, --help Print help

Verifying binaries

We provide .sha256 file with SHA checksums for downloaded binaries.

To download .sha256 file using curl (or using Invoke-WebRequest on windows):

curl -O

To check that the downloaded binaries match the checksums, run it through sha256sum with a command such as:

curl | sha256sum -c -