
moodle-cli
Give your AI agent access to Moodle.
Keep up with deadlines and grades, fetch course files, and search forums. It reuses your browser session and keeps it alive, so the login wall stays out of your way.
Use it as a CLI, a local MCP server, or a private remote MCP server on your own Cloudflare account.

🦄 Part of unicorn. Live tools answer what is there now; unicorn answers what changed.
📖 Read the docs
Set up
Ask your agent (Claude Code, Codex, OpenClaw, or anything with a terminal):
Read https://unicorn.tuuhub.com/docs/moodle/agent-setup.md and set up moodle-cli for me.
It asks for your Moodle address and waits while you finish university sign-in in the browser. It can also deploy the remote MCP server for you.
Or by hand, on macOS arm64 or Linux x64:
curl -fsSL https://raw.githubusercontent.com/bunizao/moodle-cli/main/install.sh | sh
moodle auth login
moodle
Elsewhere, use npm install -g moodle-cli or bun add --global moodle-cli.
Use it from
| Where | How |
|---|
| Claude, ChatGPT or any web AI | moodle mcp deploy, then add your Worker as a custom connector. Remote MCP |
| Claude Code, Codex, Cursor | moodle mcp serve, or install the agent skill with moodle skills add. |
| Your terminal and scripts | moodle prints tables in a terminal and JSON in a pipe. Scripting |
| Your own Worker or Node code | import { createMoodleClientCore } from "moodle-cli/core", pass the MoodleSession cookie, then getTodo(), getCourseGrades(id), getAssignment(id) and the rest. |
Study Boooooooooost
Ask in plain language, or run the command yourself:
| Ask your agent | Command |
|---|
| “Give me a quick Moodle dashboard.” | moodle |
| “What is due in the next 14 days?” | moodle due --days 14 |
| “Show my grades and feedback for UNIT.” | moodle grades UNIT --include-feedback |
| “Find forum posts about the exam.” | moodle forums search "exam" --course UNIT |
| “Download week 7's slides.” | moodle dl "UNIT week 7 slides" |
| “Keep a copy of all my units.” | moodle sync --to ~/Units |
| “Submit my essay as a draft.” | moodle submit "UNIT TASK" essay.pdf |
UNIT is the unit's code, name, id or URL as your site shows it. You can paste Moodle links straight in. Submitting always shows a plan and asks first.
Learn more
Contributing
Bug reports from real Moodle sites help most: run moodle coverage --json and attach the output. Read CONTRIBUTING.md before a pull request and SECURITY.md for vulnerabilities. Everyone follows the Code of Conduct.
🦄 Part of unicorn
Live tools answer what is there now; unicorn answers what changed.