Repository navigation
Commands
Use moodle <command> --help as the authoritative flag reference. IDs shown below can often be
replaced by a pasted Moodle URL.
The generated complete command reference documents every command and flag; feature coverage lists every core function in the three-version registry.
moodle site add <name> <url>
moodle site list
moodle site use <name>
moodle site remove <name>
moodle auth methods
moodle auth login [--method token|password|qr|mobilelaunch|browser-session|manual]
moodle auth status
moodle auth logout
moodle auth import-browser [--list-profiles|--store]
moodle auth import-browser --browser safari --store # macOS Safari
moodle auth import-session --site <name> # hidden paste prompt when Safari's cookie is absent from disk
moodle auth register-handler # Linux and macOS; macOS also registers on first mobilelaunch sign-in
moodle auth handler-status
moodle auth unregister-handlermoodle doctor
moodle course list
moodle calendar upcoming
moodle grade overview
moodle grade list --course <id|url>
moodle assignment list
moodle assignment overview
moodle assignment show <id|url>
moodle assignment status <id|url>
moodle quiz list
moodle quiz show <id|url>
moodle forum list
moodle forum discussions <id|url>
moodle forum read <id|url>
moodle file download <url>
moodle resolve <url>doctor explains the available backend and missing capability instead of assuming every site has
the same functions. Forum reads do not mark discussions as read.
assignment overview checks each submission in one CLI invocation. If a status is unreadable,
submission is null and status_error explains why; that does not mean the assignment is unsubmitted.
quiz list reads the visible quizzes in your courses, not only calendar events. With a browser
session, some quiz settings may remain unknown; check meta.missing before interpreting a null date.
The MCP tools assignment_overview, quiz_list, and quiz_show offer the same read-only use cases.
moodle assignment submit <id|url> report.pdf --dry-run
moodle assignment submit <id|url> report.pdf --yes
moodle assignment submit <id|url> report.pdf --draft --yesThe non-draft path uploads, saves, performs the separate “submit for grading” step when required, and
reads the state back. --draft deliberately stops before handing work in. The JSON field handed_in
is the final truth reported by Moodle.
moodle api functions --match assign
moodle api call core_enrol_get_users_courses --param userid=4
moodle ws list --version v52
moodle ws describe core_course_update_coursesThe raw call still passes through the safety policy. Unreviewed functions are treated as writes and are not retried. Use it to reach an official function that has no high-level command, not to bypass the safety model.
moodle version --json
moodle commands --json
moodle schema
moodle schema assignment.submit
moodle schema assignment submit --json
moodle assignment list --current --json --fields name,due_date --no-input
moodle mcp serve
moodle mcp serve --allow-write
moodle mcp host # starts a public Cloudflare quick tunnel
moodle mcp host --public-url https://moodle-mcp.example.com
moodle course list --read-only
moodle course list -v # redacted HTTP diagnostics on stderr
moodle shell-completion zsh # tab completion; not "completion", which is Moodle's--read-only removes write commands. MCP is read-only unless --allow-write is explicitly present.
--fields keeps only the named data fields, and --no-input makes a command fail instead of
waiting for an answer. See JSON contract before consuming output in a program, and
automation recipes for worked examples and rules to give an agent.
Moodle CLI
- Home · 繁中
- Installation · 安裝
- Authentication and sites · 登入與站台
- Commands · 命令
- Complete command reference · 完整命令參考
- Feature coverage · 功能覆蓋
- Roles and capabilities · 角色與 capability
- Scale test model · 規模測試模型
- Report contract · 報告契約
- JSON contract · JSON 契約
- Automation recipes · 自動化範例
- Claude connector · Claude connector
- Security model · 安全模型
- Development and testing · 開發與測試