Skip to main content

Terminal-first CLI for Moodle LMS

Project description

moodle-cli

Terminal-first CLI for Moodle LMS that reuses an authenticated browser session.

Features

  • No API token setup required
  • Reads MoodleSession from your browser or MOODLE_SESSION
  • Works with Moodle AJAX APIs and falls back to authenticated page scraping when needed
  • Upcoming timeline items for student-facing deadlines and actions
  • Terminal output plus --json and --yaml

Requirements

  • Python 3.10+
  • uv
  • An active Moodle browser session, or a MOODLE_SESSION environment variable

Install

# Recommended: uv tool
uv tool install moodle-cli

# Alternative: pipx
pipx install moodle-cli

Install from source:

git clone https://github.com/bunizao/moodle-cli.git
cd moodle-cli
uv sync

Usage

moodle --help
moodle user
moodle alerts
moodle todo
moodle overview
moodle courses
moodle grades 34637
moodle activities 34637
moodle update

To upgrade after an update is available:

uv tool upgrade moodle-cli
# or
pipx upgrade moodle-cli

Configuration

On first run, if no base_url is configured, the CLI will prompt you and write it to config.yaml in the project directory or in ~/.config/moodle-cli/:

base_url: https://school.example.edu

Required format:

  • Use a full root URL such as https://school.example.edu
  • Do not include paths, query strings, or fragments
  • Do not use URLs like /login/index.php or /my/
  • The CLI validates the URL against Moodle's token endpoint and asks again if it does not look valid

You can also set MOODLE_BASE_URL instead of using the interactive prompt. You can copy from config.example.yaml.

Environment overrides:

  • MOODLE_BASE_URL
  • MOODLE_SESSION

Development

uv run python -m compileall moodle_cli
uv build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moodle_cli-0.2.1.tar.gz (67.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moodle_cli-0.2.1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file moodle_cli-0.2.1.tar.gz.

File metadata

  • Download URL: moodle_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for moodle_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 155d2916022386e44b244cecdad4f20de9b8eef67d87ef252d9c54dcaf496eab
MD5 a23e540c35f3522166b53026ee65731c
BLAKE2b-256 bd19184ab6ef448ca1910c0bfa89593742d5c57515943c25dfa88b0298a1709b

See more details on using hashes here.

Provenance

The following attestation bundles were made for moodle_cli-0.2.1.tar.gz:

Publisher: publish.yml on bunizao/moodle-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moodle_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: moodle_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for moodle_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1834001d7a10e9db045de932a3b6dc2090255dbfd0141202a0a061743d324b9
MD5 eccd1a12c0390eb18a2bbb3258c7fe53
BLAKE2b-256 77f5d851e3e0d998f0c7faf7295aaacfb38a12d641b5e1cf0c65e3f3c67baf37

See more details on using hashes here.

Provenance

The following attestation bundles were made for moodle_cli-0.2.1-py3-none-any.whl:

Publisher: publish.yml on bunizao/moodle-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page