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
MoodleSessionfrom your browser orMOODLE_SESSION - Works with Moodle AJAX APIs and falls back to authenticated page scraping when needed
- Terminal output plus
--jsonand--yaml
Requirements
- Python 3.10+
uv- An active Moodle browser session, or a
MOODLE_SESSIONenvironment 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 courses
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.phpor/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_URLMOODLE_SESSION
Development
uv run python -m compileall moodle_cli
uv build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moodle_cli-0.1.1.tar.gz.
File metadata
- Download URL: moodle_cli-0.1.1.tar.gz
- Upload date:
- Size: 56.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4d4e241bf2874e51f9653ccff90b47b7413067ec1fe5e63589ba8187f6c1dfd
|
|
| MD5 |
6d5ab9bbcf7ad55608140d09b207f913
|
|
| BLAKE2b-256 |
39c6f05db7d64fb8ae296448dde3da0da79a603fadba14ca153d1bb5ded9cc33
|
Provenance
The following attestation bundles were made for moodle_cli-0.1.1.tar.gz:
Publisher:
publish.yml on bunizao/moodle-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moodle_cli-0.1.1.tar.gz -
Subject digest:
c4d4e241bf2874e51f9653ccff90b47b7413067ec1fe5e63589ba8187f6c1dfd - Sigstore transparency entry: 1079111710
- Sigstore integration time:
-
Permalink:
bunizao/moodle-cli@4b4a7f4c6ecaa77c2c8caf188b9acb91a2cefd71 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/bunizao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b4a7f4c6ecaa77c2c8caf188b9acb91a2cefd71 -
Trigger Event:
push
-
Statement type:
File details
Details for the file moodle_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: moodle_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaf85455423230a9a4a077ab3017a92cac7b721a7763397c2593bbea7bad551a
|
|
| MD5 |
70aad5df7f1b35d91fb5be17d3185128
|
|
| BLAKE2b-256 |
83910232a3062053f51aa7fa2ca7be4ceca96b0d40f2bb6cae5f8375bbbffe67
|
Provenance
The following attestation bundles were made for moodle_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on bunizao/moodle-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moodle_cli-0.1.1-py3-none-any.whl -
Subject digest:
eaf85455423230a9a4a077ab3017a92cac7b721a7763397c2593bbea7bad551a - Sigstore transparency entry: 1079111717
- Sigstore integration time:
-
Permalink:
bunizao/moodle-cli@4b4a7f4c6ecaa77c2c8caf188b9acb91a2cefd71 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/bunizao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4b4a7f4c6ecaa77c2c8caf188b9acb91a2cefd71 -
Trigger Event:
push
-
Statement type: