quantumsheep / myges-cli

CLI for MyGES
MIT License
28 stars 4 forks source link
esgi myges ppa reseau-ges

MyGES CLI

A Command Line Interface replacement for MyGES (Réseau GES' Extranet).

How to install

You need to have npm installed.

npm i -g myges

Usage

Authenticate with myges login (only needed once).

myges help
Usage: myges [options] [command]

Options:
  -V, --version                     output the version number
  -d, --debug                       debug mode
  -h, --help                        display help for command

Commands:
  absences [options] [year]         list absences
  agenda [options] [week]           fetch agenda
  calendar-sync [days]              sync myges calendar with Google Calendar
  contribute                        show useful links
  courses [options] [year]          list courses
  grades [options] [year]           list grades
  login [options]                   sign in to an account
  logout [options]                  remove the saved auth informations
  projects                          manage projects
  request [options] <method> <url>  make a request to the API

Agenda

The agenda command is a little special since it offers diverse options in order to ease its use.

Listing weeks

You can list and select the week to display by using the -i option (alias of --interactive).

Manual week selection

It's possible to manually specify the wanted week. Here's some possibilities:

A shifting can be added to the specified week:

Those shifts can be applied to any manual week input using the same format (+n).

Project management

Using the CLI, you can list available projects and project groups. You can also join or quit a project group.

Calendar Sync

This command allows you to syncronize your calendar on goocle calendar (and thus no longer use the myges planning!).

Setup Google API

To make the script work, you need to create a google calendar API and save its information like this :

image image
image

image

Create new Google Calendar

:warning: Be sure to create a calendar dedicated ONLY to your schedule! Otherwise the script will delete the other events present in your calendar ...

To retrieve your calendar id:

First launch

At the first launch, you will be asked to enter the various information that you have configured before.

If this is the first connection, follow the terminal's instructions to retrieve the google connection token

When you click on the Google url, don't forget to copy the given authorization token and paste it into the CLI

image-20211121185850513