Metadata-Version: 2.4
Name: studium-cli
Version: 0.2.5
Summary: A context-aware CLI for Canvas LMS (Studium)
Author-email: Markus Bajlo <markus@bajlo.se>
Requires-Python: >=3.12
Requires-Dist: notify-py>=0.3.43
Requires-Dist: packaging>=24.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: questionary>=2.0.1
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=14.0.0
Requires-Dist: typer>=0.24.0
Description-Content-Type: text/markdown

# Studium CLI (studium-cli)

A command-line tool for Canvas LMS. While designed with Uppsala University (Studium) as the default, it works with any Canvas instance.

## Features

- ** Performance**: Parallel API fetching and persistent HTTP sessions.
- ** Interactive Browser**: Navigate courses, modules, and assignments with Vim-style (`hjkl`) keys.
- ** Assignments**: Beautiful tables with countdown timers and overdue highlighting.
- ** Downloads**: Download module files and assignment attachments directly from the CLI.
- ** Notifications**: Desktop notifications for new assignments and announcements.
- ** Integrations**: Ready-to-use status bar strings for Sketchybar, Polybar, and Waybar.

## Installation

### 1. Install UV

UV is required to run and install this tool. See the [UV documentation](https://github.com/astral-sh/uv).

```bash
curl -sSfL https://astral-sh.uv.io/install.sh | sh
```

### 2. Install the CLI

Install directly from PyPI:

```bash
uv tool install studium-cli
```

Or from source:

```bash
git clone https://github.com/mackrus/studium.git
cd studium
uv tool install .
```

## Setup

1. **Get an API Token**: Log in to your Canvas instance, go to **Account** > **Settings** > **Approved Integrations**, and click **+ New Access Token**.
2. **Configure the CLI**:

```bash
# Set your token
studium config set-token <YOUR_TOKEN>

# (Optional) Set your Canvas URL if not Uppsala University
studium config set-url https://canvas.your-school.edu
```

3. **Verify Connection**:
```bash
studium config status
```

## Usage

### Interactive Navigation
The easiest way to explore your courses:
```bash
studium browse
```
*(Use arrows or `hjkl` to navigate, `q` or `Esc` to exit)*

### Main Commands
| Command | Description |
| :--- | :--- |
| `studium courses` | List all active courses. |
| `studium assignments` | List upcoming assignments with due dates. |
| `studium announcements` | Show recent announcements across all courses. |
| `studium modules <ID>` | List modules and items for a specific course. |
| `studium download <ID>` | Download a file by its Canvas ID. |
| `studium sync` | Sync data and send desktop notifications. |
| `studium browser` | Open courses or assignments in your default web browser. |
| `studium update` | Check for and install the latest version. |

## Extensions

### Status Bars (Sketchybar, Polybar, Waybar)
The CLI can output formatted strings for status bars using `studium assignments --format sketchybar`.

#### Sketchybar (macOS)
Integration scripts are available in the [`contrib/sketchybar/`](contrib/sketchybar/) directory.

#### Linux Bars
Add a custom module that executes `studium assignments --format sketchybar` (outputs e.g., `󰑫 3`).

## Development

```bash
# Run locally
uv run studium <command>

# Run tests
uv run pytest
```
