Metadata-Version: 2.4
Name: gatemux-signin
Version: 0.1.0
Summary: Sign in with GateMux: device-code flow and CLI
License: Apache-2.0
Project-URL: Homepage, https://gatemux.cn
Project-URL: Documentation, https://gatemux.cn/docs/sign-in-sdk
Keywords: gatemux,sign-in,oauth,pkce,device-flow,cli
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Provides-Extra: qr
Requires-Dist: segno<2,>=1.6; extra == "qr"
Dynamic: license-file

# gatemux-signin

「用 GateMux 账户登录」的 Python SDK 与命令行（Apache-2.0）。

```python
from gatemux_signin import GateMuxAuth, FileTokenStore

auth = GateMuxAuth("app_xxx", store=FileTokenStore("~/.config/gatemux/tokens.json"))
login = auth.start_device_login(scopes=["openid", "email"])
print(login.verification_uri_complete, login.user_code)
tokens = login.wait()
print(auth.userinfo())
# 90 天 PAT：没有 refresh token；到期前 30 天内用 auth.renew() 续期
```

CLI：

```sh
gatemux login --client-id app_xxx     # 打印二维码 / 链接 / 短码并轮询
gatemux login --client-id app_xxx --browser   # 直接打开授权页
gatemux whoami --client-id app_xxx
gatemux logout --client-id app_xxx
```
