Metadata-Version: 2.4
Name: dimicheck-tui
Version: 0.1.6
Summary: DimiCheck terminal dashboard
Author: DimiCheck
Project-URL: Homepage, https://dimicheck.com
Project-URL: Repository, https://github.com/hjun1052/dimicheck4
Keywords: dimicheck,tui,textual,oauth,school
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Education
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: keyring>=25.0.0
Requires-Dist: requests<3,>=2.33.0
Requires-Dist: textual>=0.89.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"

# DimiCheck TUI

DimiCheck TUI is a terminal dashboard for DimiCheck students. It uses the public OAuth PKCE flow and calls only the student app API surface for v1.

## Install

Use `pipx` for the public install path:

```bash
pipx install dimicheck-tui
dimicheck-tui
```

The package also exposes `dimicheck` as a short alias. Prefer `dimicheck-tui` if another local deploy tool already uses the `dimicheck` command name.

For local development from this checkout:

```bash
cd packages/dimicheck-tui
uv run dimicheck-tui --help
uv run dimicheck-tui
```

Set `DIMICHECK_BASE_URL` when testing against a local or staging server:

```bash
cd packages/dimicheck-tui
DIMICHECK_BASE_URL=http://127.0.0.1:5000 uv run dimicheck-tui
```

## Authentication

The TUI never asks for a password in the terminal. On first launch it opens the browser, signs in through DimiCheck OAuth, and stores tokens through the OS credential store.

- macOS: Keychain
- Windows: Credential Manager
- Linux: Secret Service compatible keyring

If the OS keyring is unavailable, the app fails closed by default. For controlled environments you can explicitly allow a local token file:

```bash
dimicheck-tui --allow-plaintext-token
```

That fallback writes a `0600` permission file. Do not use it on shared machines.

## Commands

```bash
dimicheck-tui                 # open the TUI dashboard
dimicheck-tui login           # browser OAuth login
dimicheck-tui logout          # revoke refresh token and delete local tokens
dimicheck-tui status get      # print current status
dimicheck-tui status set toilet
dimicheck-tui status set etc --reason "상담"
dimicheck-tui schoollife      # print today's timetable and meal
```

TUI shortcuts:

- `S`: change status
- `R`: refresh dashboard
- `L`: logout
- `Q`: quit

Status modal shortcuts:

- `1`-`9`: choose a status
- `Enter`: apply
- `Esc`: cancel
- `Tab` / `Shift+Tab`: move focus between status choices, reason input, and buttons

## v1 Scope

The public v1 supports:

- current student status read/write
- today's schoollife summary
- latest class notices
- today's class and official school events
- OAuth PKCE login/logout

It intentionally does not expose routine editing, teacher/admin tools, browser session cookies, remember tokens, or `/api/mcp/state`.

## Server Notes

The server seeds a dedicated public OAuth client:

- client id: `dimicheck-tui-public`
- redirect URI ports: `45831` through `45835`
- scopes: `openid basic student_info status.read status.write`

Server deployments should happen from the repository root. This package is intentionally separate so the public TUI release does not include Flask, database, or Google Sheets dependencies.
