Installation
To use Mortar, you need to install the compilation tools. Don’t worry, the process is simple!
Method 1: Install with Cargo (Recommended)
If you already have Rust installed, it’s very convenient:
cargo install mortar_cli
Wait for the installation to complete, then check if it was successful:
mortar --version
Seeing the version number means the installation was successful!
Method 2: Build from Source (Not for Average Users)
Want to experience the latest development version? You can build from source (this also requires a Rust development environment):
# Download source code
git clone https://github.com/Bli-AIk/mortar.git
cd mortar
# Build
cargo build --release
# The compiled program is here
./target/release/mortar --version
Tip: The compiled executable is located at target/release/mortar, you can add it to your environment variables.
Method 3: Download from GitHub Release (Not for Average Users)
If you don’t want to use Rust or Cargo, you can also download pre-compiled binaries directly from Mortar’s GitHub Release page.
Linux / macOS
- Open the Release page and download the corresponding version, for example
mortar-x.x.x-linux-x64.tar.gzormortar-x.x.x-macos-x64.tar.gz. - Extract to any directory:
tar -xzf mortar-x.x.x-linux-x64.tar.gz -C ~/mortar
- Add the executable path to environment variables, for example:
export PATH="$HOME/mortar:$PATH"
- Check if installation was successful:
mortar --version
Windows
- Download the corresponding version of
mortar-x.x.x-windows-x64.zip. - Extract to any directory, for example
D:\mortar. - Add the directory to system environment variable PATH:
- Right-click “This PC” → “Properties” → “Advanced system settings” → “Environment Variables”
- Find
Pathin “System variables” or “User variables” → Edit → AddD:\mortar
- Open a new command prompt and check installation:
mortar --version
⚠️ Note:
- Need to manually set environment variables
- May encounter issues when opening new terminals or modifying system configuration
- Not very user-friendly for average users
Therefore, we recommend Method 1 (Cargo) for a smoother installation experience.
Verify Installation
Run this command to test:
mortar --help
You should see help information explaining various usage options.
Editor Support (Optional but Recommended)
For a better writing experience, you can install the language server:
cargo install mortar_lsp
Then configure it in your favorite editor.
Check Editor Support to learn how to configure your editor.
Encountering Problems?
“cargo command not found”
You need to install Rust first. Visit https://rust-lang.org/ and follow the installation guide.
“Build failed”
Make sure your Rust version is new enough:
rustup update
Other Issues
- Check GitHub Issues
- Or ask in Discussions
Next Steps
Installed? Then go try out Quick Start Guide!