Skip to content

Installation

github-actions[bot] edited this page Oct 12, 2026 · 6 revisions

Installation

繁體中文 · Home

Check the Releases page before using a package manager: these commands work after the first stable release and package entries are public. If there is no published release yet, build from source.

Tab completion

Once the binary is installed, print a script for your shell and put it where that shell looks:

moodle shell-completion bash > /etc/bash_completion.d/moodle
moodle shell-completion zsh > "${fpath[1]}/_moodle"
moodle shell-completion fish > ~/.config/fish/completions/moodle.fish
moodle shell-completion powershell | Out-String | Invoke-Expression

It is not called completion: that name belongs to Moodle's own activity completion. Site and account names complete from your configuration, so nothing is requested from the site while you type.

Homebrew (macOS or Linux)

Use the project's tap; this formula is not in Homebrew Core:

brew tap KoukeNeko/tap
brew install koukeneko/tap/moodle-cli
moodle version

To upgrade later, run brew update followed by brew upgrade moodle-cli. The formula contains release-specific SHA-256 hashes for macOS and Linux, on amd64 and arm64.

Scoop (Windows)

Add the project's bucket and install its manifest:

scoop bucket add koukeneko https://github.com/KoukeNeko/scoop-bucket
scoop install koukeneko/moodle-cli
moodle version

To upgrade later, run scoop update followed by scoop update moodle-cli. The manifest supports Windows amd64 and arm64, with a separate SHA-256 hash for each archive. Windows binaries are not Authenticode-signed, so SmartScreen may ask for confirmation.

Direct download

The Releases page lists the published archives, checksums.txt, and its keyless workflow signature. Select the archive for your OS and architecture, compare its SHA-256 digest against checksums.txt, then put the extracted moodle (moodle.exe on Windows) on your PATH. Do not run an asset whose checksum does not match.

Package repositories update only after the stable release passes real-macOS signing and notarization verification. If the newest tag is not yet in the tap or bucket, use the previous stable package or wait for the release workflow to complete.

An interactive moodle run says on stderr when a newer release exists, checked at most once a day. The security model lists what is sent and how to turn it off. The notice appears when the release is published, which can be before your package manager has it.

Build from source

Use Git, GNU Make, and Go 1.26 or newer:

git clone https://github.com/KoukeNeko/Moodle-CLI.git
cd Moodle-CLI
make build
./bin/moodle version

Install to ~/.local/bin:

make install

Override PREFIX or BINDIR when another destination is needed:

make install PREFIX=/opt/moodle-cli
make install BINDIR="$HOME/bin"

make build produces a pure-Go binary at bin/moodle.

Verify the build

make verify

This runs unit and contract tests, the race detector, formatting and vet checks, then builds the binary. Docker-backed Moodle tests are separate because they download images and create local test sites; see Development and testing.

Platform note

The CLI builds on Linux, macOS, and Windows. Automatic browser callbacks use a per-user D-Bus service on Linux and an Apple Event handler on macOS. macOS builds its handler with the system's osacompile on first sign-in, without requiring Xcode. Windows should use moodle auth login --method manual.

Clone this wiki locally