Skip to content

gclass-cli is a Python command‑line tool that integrates Google Classroom and Drive, letting you list courses, manage assignments, upload files, and submit work directly from your terminal.

Notifications You must be signed in to change notification settings

MrGolddev/classroom-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google Clasroom but CLI-tified

Python License Build Status

Command-line interface for Google Classroom and Google Drive.
Lets you list courses, view assignments, upload files, and submit work—all from your terminal.

Installation & setup

  1. Create & activate a virtual environment:

    python -m venv .venv
    # Windows: .venv\Scripts\Activate.ps1
    # macOS/Linux: source .venv/bin/activate
  2. Install the package:

    pip install -e .
  3. Show paths where config/creds are stored:

    gclass paths
  4. Place your Google API credentials.json there, then run:

    gclass auth

Now you’re ready—try:

gclass list-courses

Full Setup (Google Cloud Project)

If Quickstart fails (like fresh accounts or new APIs), follow the full setup:

Step 1. Make a Google Cloud project

Step 2. Enable APIs

  • Enable Google Classroom API
  • Enable Google Drive API

Step 3. OAuth consent screen

  • Choose External → fill details
  • Under Test Users, add your Gmail (the account with Classroom access)

Step 4. Create OAuth credentials

  • Credentials → Create Credentials > OAuth Client ID
  • App type: Desktop App
  • Download the JSON as credentials.json

Step 5. Put creds in CLI config

gclass paths

Copy the JSON into the printed path.

Step 6. First auth

gclass auth

Log in, grant permissions. A token.json will be saved.

Test it:

gclass list-courses

Usage

Common commands:

  • gclass whoami → display signed-in account
  • gclass list-courses [--page-size N] [--pick] → list courses / set default
  • gclass list-students --course COURSE_ID → show course students
  • gclass list-assignments --course COURSE_ID → show coursework & due dates
  • gclass set-default --course COURSE_ID → set default course
  • gclass upload --file PATH → upload a file to Drive
  • gclass open [--course COURSE_ID] [--assignment COURSEWORK_ID] → open in browser
  • gclass submit --assignment COURSEWORK_ID --file PATH [--course COURSE_ID] → turn in work

Example Workflow

# Pick a course
gclass list-courses --pick

# See assignments
gclass list-assignments --course <classID>

# Submit work
gclass submit --assignment <AssignmentID> --file "report.pdf"

Project Structure

  • src/gclass/cli.py → CLI with Click & Rich
  • src/gclass/auth.py → OAuth + token handling
  • src/gclass/config.py → paths, settings, scopes
  • src/gclass/services.py → Classroom & Drive API helpers

About

gclass-cli is a Python command‑line tool that integrates Google Classroom and Drive, letting you list courses, manage assignments, upload files, and submit work directly from your terminal.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages