Right.codes CLI + TUI dashboard (personal usage stats) without Playwright.
Project description
Right.codes CLI Dashboard
把 right codes 的用量/套餐信息做成一个本地 CLI/TUI 看板(可配置刷新频率),尽量不依赖浏览器、不使用 Playwright 自动化登录。
说明:本项目通过网页同款的 JSON 接口获取数据(需要 Bearer token)。接口可能随网站更新而变动;本工具尽量做兼容与降级提示,但不保证长期稳定。
约束(摘要)
- 不使用 Playwright 自动化登录(只走内部 JSON 接口 + Bearer token)
- 密码不落盘:仅交互式输入用于换取 token
- token 优先写入系统 keyring;失败则兜底写入“全局数据目录”的
token.json(尽量0600;可用RIGHTCODES_DATA_DIR自定义目录) - 不提交任何敏感信息(token、密码、cookie、真实明细数据等);CLI 默认脱敏输出,TUI“使用记录明细”会显示完整 IP(个人工具场景)
功能概览
rightcodes dashboard:Textual TUI 看板(自动刷新、趋势、套餐/额度、使用记录明细)rightcodes logs:命令行查看使用明细(table/json,默认脱敏)rightcodes login:交互式登录并保存 token(密码不落盘)rightcodes doctor:端点自检(只输出 keys,不输出值;可写入.local/)
安装
方式 A:pip 安装(推荐)
pip install rightcodes-tui-dashboard
# 升级(可选)
pip install -U rightcodes-tui-dashboard
# 或(等价)
python3 -m pip install -U rightcodes-tui-dashboard
方式 B:从 GitHub 安装(无需手动下载源码)
也可以直接:
python3 -m pip install -U "rightcodes-tui-dashboard @ git+https://github.com/okwinds/rightcodes-tui-dashboard.git"
可选:启用 keyring(推荐)
默认不强依赖 keyring;如希望把 token 写入系统钥匙串/凭据管理器,可安装 extra:
python3 -m pip install -U "rightcodes-tui-dashboard[keyring]"
也可以用 pipx 安装(更适合 CLI 工具):
python3 -m pip install -U pipx
pipx install rightcodes-tui-dashboard
使用指南
1) 登录
交互式输入账号密码(不回显),用于换取 token;密码不会写入任何文件:
rightcodes login
如果你只想验证登录是否成功,但又不想打印完整 token,可用:
rightcodes login --print-token
2) 启动看板(TUI)
默认 --watch 30s 自动刷新;--watch 0s 关闭自动刷新:
rightcodes dashboard --watch 30s --range today --rate-window 6h
3) 查看明细(CLI)
默认脱敏;支持 table/json:
rightcodes logs --range 24h --format table
rightcodes logs --range 7d --format json
4) doctor(自检/排障)
只输出 keys,不输出值;默认写入 .local/rightcodes-doctor.json:
rightcodes doctor
常用参数
--base-url:覆盖服务地址(默认https://right.codes)dashboard --range:today:按本地日历日统计(当天 00:00 起算;推荐,避免跨日)24h/7d:rolling window(过去 N 小时/天)
dashboard --no-keyring:禁用 keyring(适用于无 keyring 环境)
查看完整参数:
rightcodes --help
rightcodes dashboard --help
安全与隐私
- 账号密码:只用于登录换取 token;不会落盘。
- token:优先存储到系统 keyring;否则写入“全局数据目录”的
token.json(尽量0600;可用RIGHTCODES_DATA_DIR自定义目录)。 - 本项目会在本机保存 token/doctor 输出等文件;请勿提交到 Git(本仓库默认已忽略
.local/)。
开发(可选)
python3 -m pip install -e ".[dev]"
python3 -m pytest
rightcodes --help
相关文档
- 文档索引(可提交):
docs/INDEX.md - MVP 规格:
docs/specs/tui-dashboard-mvp.md - 可行性方案:
docs/plans/2026-02-07-rightcodes-cli-dashboard-feasibility.md - 实现计划:
docs/plans/2026-02-07-tui-dashboard-implementation-plan.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rightcodes_tui_dashboard-0.1.17.tar.gz.
File metadata
- Download URL: rightcodes_tui_dashboard-0.1.17.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
610c5d3d1184abd9c3e0fe7495b4b568686d8bcb950ef0fa777441ade1ca8d77
|
|
| MD5 |
cafb09d2ca5551a70f99a3041370d2e8
|
|
| BLAKE2b-256 |
7c609357c800b0f31860aab99e7654bd30f2d0c2ab49b6019cf2bd9ddba82b2e
|
Provenance
The following attestation bundles were made for rightcodes_tui_dashboard-0.1.17.tar.gz:
Publisher:
publish.yml on okwinds/rightcodes-tui-dashboard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rightcodes_tui_dashboard-0.1.17.tar.gz -
Subject digest:
610c5d3d1184abd9c3e0fe7495b4b568686d8bcb950ef0fa777441ade1ca8d77 - Sigstore transparency entry: 937708659
- Sigstore integration time:
-
Permalink:
okwinds/rightcodes-tui-dashboard@3e5d71220cd5ef3a1ef5754a98c7eaa190a435a8 -
Branch / Tag:
refs/tags/v0.1.17 - Owner: https://github.com/okwinds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e5d71220cd5ef3a1ef5754a98c7eaa190a435a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rightcodes_tui_dashboard-0.1.17-py3-none-any.whl.
File metadata
- Download URL: rightcodes_tui_dashboard-0.1.17-py3-none-any.whl
- Upload date:
- Size: 41.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21853d630a1fa6821313d9d7f8be69035a0e4adf5f620e5799a4291d8ec02d1b
|
|
| MD5 |
5d0f575f8c12f5ecb9c8e1fa02a727e6
|
|
| BLAKE2b-256 |
0b2554e44e27292c68d96ce41944b6536961f6327a9ef51717bf70e96aac4d3e
|
Provenance
The following attestation bundles were made for rightcodes_tui_dashboard-0.1.17-py3-none-any.whl:
Publisher:
publish.yml on okwinds/rightcodes-tui-dashboard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rightcodes_tui_dashboard-0.1.17-py3-none-any.whl -
Subject digest:
21853d630a1fa6821313d9d7f8be69035a0e4adf5f620e5799a4291d8ec02d1b - Sigstore transparency entry: 937708660
- Sigstore integration time:
-
Permalink:
okwinds/rightcodes-tui-dashboard@3e5d71220cd5ef3a1ef5754a98c7eaa190a435a8 -
Branch / Tag:
refs/tags/v0.1.17 - Owner: https://github.com/okwinds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e5d71220cd5ef3a1ef5754a98c7eaa190a435a8 -
Trigger Event:
push
-
Statement type: