CLI for Imperial's Department of Computing Materials Page.
Pulls all the latest resources from your course into your folder, pulling only the ones you haven't got in your folder.
Credentials are stored using keytar:
On macOS the passwords are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.
- Auto download resources for courses from terminal
- Auto login (after first call) to quickly access resources
- Only pulls new resources, so you don't need to find which ones are new
- Shortcuts to quickly access your main courses
- Concurrent downloads of materials
sudo apt-get install libsecret-1-dev gnome-keyring
Please check the documentation for keytar to download them
npm install -g materials-cli
Type materials
in the terminal to access the CLI.
Full options:
usage: materials [-h] [-v] [-c] [-d] [-a] [shortcut]
Materials CLI Tool
positional arguments:
shortcut Shortcut to course
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-c, --clean Clean configurations
-o, --open Open folder based off shortcut or selection
-d, --dir Save folders in current directory instead
-a, --all Download all shortcut courses one go
You can set shortcuts to courses by using the shortcut
argument. If no shortcut is found, selecting the course will assign
the shortcut to the chosen course. The next time you run materials
it will automatically fetch courses for the course chosen before.
Example:
Using CV
shortcut for first time:
Using CV
example again:
You can use -a or --all to download all the courses that have shortcuts in one go
Credentials are stored in the OS's keychain and retrieved on every call to materials
.
The credentials are never sent to anywhere other than https://api-materials.doc.ic.ac.uk
.
The package keytar is used for this.
- Add fine-grained control of config of credentials and shortcuts
- Find way to schedule pulling of files in the mornings
- Test on different Linux distributions