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.

Repository: https://github.com/bunizao/moodle-cli

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
  • Terminal output plus --json and --yaml

Requirements

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

Install

uv sync

Usage

uv run moodle --help
uv run moodle user
uv run moodle courses
uv run moodle activities 34637

Configuration

On first run, the CLI will ask for your Moodle base URL and save it to config.yaml.

Safety checks during setup:

  • Requires a full root URL such as https://school.example.edu
  • Rejects paths, query strings, and fragments
  • Probes the site before saving
  • Requires explicit confirmation if the target does not look like Moodle

If you prefer to configure it manually, create config.yaml in the project directory or in ~/.config/moodle-cli/:

base_url: https://school.example.edu

You can copy from config.example.yaml.

Environment overrides:

  • MOODLE_BASE_URL
  • MOODLE_SESSION

Development

uv run python -m compileall moodle_cli
uv build

CI

GitHub Actions runs the following checks on pushes and pull requests:

  • Dependency lock sync with uv
  • Bytecode compilation
  • CLI smoke check
  • Package 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.1.0b0.tar.gz (43.0 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.1.0b0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file moodle_cli-0.1.0b0.tar.gz.

File metadata

  • Download URL: moodle_cli-0.1.0b0.tar.gz
  • Upload date:
  • Size: 43.0 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.1.0b0.tar.gz
Algorithm Hash digest
SHA256 1efafe6b97b24dbe0b7fb0a5bb5a1d242b7d143061a2b533911556924ddba76b
MD5 91627d483f1602f564f6b399ddd3253e
BLAKE2b-256 744abe7164e39faa2a65ffcde576829fbd2be6e4c50432667edcd2c454549067

See more details on using hashes here.

Provenance

The following attestation bundles were made for moodle_cli-0.1.0b0.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.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: moodle_cli-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 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.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f13fafbf2cf3f5a192c8a5045452b7ff8cbef9ede08d9bc5fccbb7b91fa3e24
MD5 3b1e7b1885c0463d26ce5386c3680388
BLAKE2b-256 307d637e295aa4efb203a96cb3924d399177937f2cd0d212af5241d287c50b2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for moodle_cli-0.1.0b0-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