Standalone binary
The install script downloads a prebuilt binary and puts it on yourPATH. It supports macOS on Apple Silicon (arm64) and Linux on x86_64 — on any other platform it prints a message telling you to use npm instead and exits.
- Detects your OS and architecture and picks the matching release asset (
moodle-darwin-arm64ormoodle-linux-x64). - Downloads it from the latest GitHub release into a temporary directory.
- Makes it executable and runs
--versionas a sanity check. - Installs it to
~/.local/bin/moodle, creating the directory if needed.
Add the install directory to your
PATH if it isn’t already:
GitHub Releases may include other platform binaries. The install script itself only picks a binary for macOS arm64 and Linux x64; on any other OS or architecture it steps aside for npm.
npm
Bun
Node.js version
moodle-cli requires Node.js 22.13 or newer, because reading cookies out of a Chromium-based browser needs a feature Node only ships from that version on. On an older Node,moodle auth login fails with a message to upgrade Node or switch to Bun, which works on any version. Reading Safari’s cookie store doesn’t have this requirement.
If you’re on an older Node and can’t upgrade it, use Bun instead:
Update
There’s no built-in self-update command. Update the way you installed:Shell completion
moodle completion <shell> prints a completion script for zsh, bash or fish. It completes top-level command names only.
- Zsh
- Bash
- Fish
Save the script somewhere on your Then add this to Open a new shell to pick up the change.
fpath and let compinit pick it up:~/.zshrc, before compinit runs: