Install
Download the Monarch binaries
- macOS
- Windows
- Linux
Make sure you have Xcode installed.
Download the following bundle to get the latest release of the Monarch binaries, which include the Monarch CLI and desktop app.
cd ~/development
curl -O https://d148mrbia1nlbw.cloudfront.net/macos/monarch_macos_2.1.8.zip
Extract the file:
unzip monarch_macos_2.1.8.zip
Add the monarch binaries to your path:
export PATH="$PATH:`pwd`/monarch/bin"
This command sets your PATH variable for the current terminal window only. To permanently add Monarch to your path, see Update your path.
Make sure you have Visual Studio 2022 with the “Desktop development with C++” workload installed, including all of its default components. (Note: Visual Studio is different than Visual Studio Code).
Download the following bundle to get the latest release of the Monarch binaries, which include the Monarch CLI and desktop app.
Extract the file in the desired location, for example:
cd development
tar -x -f monarch_windows_2.1.8.zip
You can now run Monarch using the monarch.exe located in the monarch\bin directory. To permanently add Monarch to your path, see Update your path.
Monarch Linux works on Flutter 3.9 or above.
Monarch relies on Flutter desktop which has its own Linux requirements. To install those requirements run the following command:
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
For more details see Flutter additional Linux requirements.
Also install this requirement missing from the Flutter documentation:
sudo apt install lib32stdc++-12-dev
For more details see this Flutter documentation issue.
Download the following bundle to get the latest release of the Monarch binaries, which include the Monarch CLI and desktop app.
cd ~/development
curl -O https://d148mrbia1nlbw.cloudfront.net/linux/monarch_linux_2.1.8.tar.xz
Extract the file:
tar xf monarch_linux_2.1.8.tar.xz
Add the monarch binaries to your path:
export PATH="$PATH:`pwd`/monarch/bin"
This command sets your PATH variable for the current terminal window only. To permanently add Monarch to your path, see Update your path.
Run Monarch
Go to one of your Flutter projects and then run
monarch init
. Run it inside your existing project’s root directory:monarch init
The
monarch init
command sets up all the dependencies needed to run monarch. It also creates a few sample stories in your project.Run monarch using
monarch run
:monarch run
The
monarch run
command prepares the stories in your project so they can be used by Monarch. It then launches the Monarch app where you can preview your stories.
Building from source
If you prefer to build Monarch from source, you can follow this guide which will help you set up your local and build the Monarch source code.
Update your path
Follow these instructions to update your path variable permanently, which will
let you run monarch
from any terminal window.
- macOS
- Windows
- Linux
Open your
rc
file, which may be~/.bash_profile
,~/.bashrc
or~/.zshrc
.
Add the following line and change
[PATH_TO_MONARCH]
to be the path where you unzipped Monarch:
export PATH="$PATH:[PATH_TO_MONARCH]/monarch/bin"
Run
source ~/. <rc file>
to refresh the current window, or open a new terminal window to automatically source the file.
Verify that the
monarch/bin
directory is now in your PATH by running:
echo $PATH
Verify that the
monarch
command is available by running:
monarch --version
From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
Under User variables, look for an entry called Path, then append the full path of
monarch\bin
using;
as a separator from existing values.
Open (or create) the
rc
file for your shell. For example, Linux uses the Bash shell by default, so edit$HOME/.bashrc
. If you are using a different shell, the file path and filename will be different on your machine.
Add the following line and change
[PATH_TO_MONARCH]
to be the path where you unzipped Monarch:
export PATH="$PATH:[PATH_TO_MONARCH]/monarch/bin"
Run
source ~/. <rc file>
to refresh the current window, or open a new terminal window to automatically source the file.
Verify that the
monarch/bin
directory is now in your PATH by running:
echo $PATH
Verify that the
monarch
command is available by running:
monarch --version