Metadata-Version: 2.4
Name: monifa
Version: 0.1.0
Summary: Command-line client for the Monifa TOTP authenticator
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests<3,>=2.32
Requires-Dist: rich<15,>=13.9

# monifa

Command-line client for [Monifa](https://monifa.jyonn.space), the multi-SSO TOTP authenticator.

## Install

```bash
pip install monifa
```

The Python module uses the same name:

```python
import monifa
```

For development:

```bash
python -m venv .venv
.venv/bin/pip install -e .
```

## Login

Sign in through the installed Qitian CLI (`qt app oauth`):

```bash
monifa login
```

Use GitHub Device Flow instead (the CLI displays a short code and opens GitHub):

```bash
monifa login --provider github
```

You can also exchange a Qitian authorization code or an unconsumed Monifa login ticket directly:

```bash
monifa login --code 'QITIAN_AUTHORIZATION_CODE'
monifa login --ticket 'https://monifa.jyonn.space/#/auth/callback?ticket=...'
```

## Tokens

Synchronize and show all current codes:

```bash
monifa ls
```

Generate one code by entry ID, issuer, or account name:

```bash
monifa code GitHub
monifa code 12
```

The last synchronized entries remain available offline:

```bash
monifa ls --offline
monifa code GitHub --offline
```

Add an entry:

```bash
monifa add --issuer GitHub --account user@example.com --secret JBSWY3DPEHPK3PXP
monifa add --issuer Example --account user --secret SECRET --algorithm SHA256 --digits 8 --period 30
```

Delete an entry after an interactive confirmation:

```bash
monifa rm 12
monifa rm GitHub --yes
```

Other commands:

```bash
monifa sync
monifa whoami
monifa logout
```

## State And Security

The state file is `~/.config/monifa-cli/state.json` by default. It contains refresh credentials and a plaintext cache of TOTP secrets so codes remain available offline. The CLI creates it with user-only permissions (`0600`). Anyone who can read this file can generate the stored MFA codes.

Override the backend, Qitian executable, or state path with
`MONIFA_BACKEND_URL`, `MONIFA_QT_COMMAND`, and `--config`. GitHub Device Flow
must be enabled for the configured GitHub OAuth App.
