Skip to content
This repository was archived by the owner on Jul 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ AI支援開発の時代において、**トークンは新しいエネルギー*
## 機能

- **インタラクティブTUIモード** - Ratatuiによる美しいターミナルUI(デフォルトモード)
- 6つのインタラクティブビュー:概要、モデル、日別、時間別、統計、エージェント(オプションの Minutely ビューを `minutelyTabEnabled` でオプトイン可能)
- 8つのインタラクティブビュー:概要、モデル、月別、週別、日別、時間別、統計、エージェント
- キーボード&マウスナビゲーション
- 9色テーマのGitHubスタイル貢献グラフ
- リアルタイムフィルタリングとソート
Expand Down Expand Up @@ -536,21 +536,6 @@ Tokscaleは設定を`~/.config/tokscale/settings.json`に保存します:
| `nativeTimeoutMs` | number | `300000` | ネイティブサブプロセス処理の最大時間(5000-3600000ms) |
| `defaultClients` | string[] | `[]` | `--client/-c` フラグを渡さない場合に適用されるクライアントフィルター。`--client` と同じ ID を受け付けます(例: `["opencode", "claude", "zed"]`)。未知の ID は無視されます。CLI フラグが指定されるとこのリストは完全に無視されます — マージはしません。 |
| `light.writeCache` | boolean | `false` | `true` のとき、`tokscale --light` はレンダリング直後に TUI キャッシュを原子的に上書きします。CLI フラグ `--write-cache` / `--no-write-cache` が実行ごとに優先されます。 |
| `minutelyTabEnabled` | boolean | `false` | TUI に分単位の Minutely タブを表示し、データ読み込み時に分単位の集計を実行します。分単位の粒度はほとんどのユーザーにとってニッチな診断ビューであり、大規模データセットでは分単位のバケット処理に無視できないコストがかかるため、既定では無効になっています。 |

#### Minutely タブの有効化

Minutely タブはトークン使用量を分単位で表示し、バーストパターンの診断、単一セッションのデバッグ、`autoRefreshEnabled` と組み合わせたほぼリアルタイムの監視に最も有用です。分単位の集計はデータ読み込み時にすべての解析済みメッセージを処理するため、ほとんどのユーザーには不要な RAM と CPU コストが発生します。そのため既定では非表示になっています。

有効化するには、`~/.config/tokscale/settings.json` で `minutelyTabEnabled` を `true` に設定します:

```json
{
"minutelyTabEnabled": true
}
```

再起動後、タブストリップの Hourly と Stats の間に Minutely タブが表示され、Tab / BackTab / Left / Right ナビゲーションがそれを循環します。フラグを `false` に戻すとタブは再び非表示になり、集計もスキップされます。

#### キャッシュディレクトリ構成

Expand Down
17 changes: 1 addition & 16 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ AI 지원 개발 시대에 **토큰은 새로운 에너지**입니다. 토큰은
## 기능

- **인터랙티브 TUI 모드** - Ratatui 기반의 터미널 UI (기본 모드)
- 6개 인터랙티브 뷰: 개요, 모델, 일별, 시간별, 통계, 에이전트 (선택적 Minutely 뷰는 `minutelyTabEnabled`로 활성화)
- 8개 인터랙티브 뷰: 개요, 모델, 월별, 주별, 일별, 시간별, 통계, 에이전트
- 키보드 및 마우스 지원
- 9가지 테마의 GitHub 스타일 기여 그래프
- 실시간 필터링 및 정렬
Expand Down Expand Up @@ -535,21 +535,6 @@ Tokscale은 설정을 `~/.config/tokscale/settings.json`에 저장합니다:
| `nativeTimeoutMs` | number | `300000` | 네이티브 서브프로세스 처리 최대 시간 (5000-3600000ms) |
| `defaultClients` | string[] | `[]` | `--client/-c` 플래그를 전달하지 않을 때 적용되는 기본 클라이언트 필터. `--client`와 동일한 ID를 받습니다 (예: `["opencode", "claude", "zed"]`). 알 수 없는 ID는 자동으로 무시됩니다. CLI 플래그가 있으면 이 목록은 완전히 무시됩니다 — 병합되지 않습니다. |
| `light.writeCache` | boolean | `false` | `true`이면 `tokscale --light`가 렌더링 직후 TUI 캐시를 원자적으로 덮어씁니다. CLI 플래그 `--write-cache` / `--no-write-cache`가 실행별로 우선합니다. |
| `minutelyTabEnabled` | boolean | `false` | TUI에 분 단위 Minutely 탭을 표시하고 데이터 로딩 중에 분 단위 집계를 수행합니다. 대부분의 사용자에게 분 단위 세분화는 틈새/진단 뷰이며, 대규모 데이터셋에서는 분 단위 버케팅에 무시할 수 없는 비용이 들기 때문에 기본적으로 비활성화되어 있습니다. |

#### Minutely 탭 활성화

Minutely 탭은 토큰 사용량을 분 단위로 표시하며, 버스트 패턴 진단, 단일 세션 디버깅, `autoRefreshEnabled`와 함께 거의 실시간 모니터링에 가장 유용합니다. 분 단위 집계는 데이터 로딩 중 모든 파싱된 메시지를 처리하므로 대부분의 사용자에게는 불필요한 RAM과 CPU 비용이 발생합니다. 그래서 기본적으로 숨겨져 있습니다.

활성화하려면 `~/.config/tokscale/settings.json`에서 `minutelyTabEnabled`를 `true`로 설정하세요:

```json
{
"minutelyTabEnabled": true
}
```

재시작 후 탭 스트립의 Hourly와 Stats 사이에 Minutely 탭이 나타나며, Tab / BackTab / Left / Right 내비게이션이 이를 순환합니다. 플래그를 다시 `false`로 설정하면 탭이 숨겨지고 집계도 다시 건너뜁니다.

#### 캐시 디렉터리 레이아웃

Expand Down
21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ In the age of AI-assisted development, **tokens are the new energy**. They power
## Features

- **Interactive TUI Mode** - Beautiful terminal UI powered by Ratatui (default mode)
- 6 interactive views: Overview, Models, Daily, Hourly, Stats, Agents (plus optional Usage and Minutely views, opt-in via `usageTabEnabled` / `minutelyTabEnabled`)
- 8 interactive views: Overview, Models, Monthly, Weekly, Daily, Hourly, Stats, Agents (plus optional Usage, opt-in via `usageTabEnabled`)
- Keyboard & mouse navigation
- GitHub-style contribution graph with 9 color themes
- Real-time filtering and sorting
Expand Down Expand Up @@ -254,11 +254,11 @@ tokscale models --json > report.json # Save to file

The interactive TUI mode provides:

- **6 core views**: Overview (chart + top models), Models, Daily, Hourly, Stats (contribution graph), Agents. Optional Usage (subscription quotas) and Minutely views are hidden by default and can be enabled with `usageTabEnabled` / `minutelyTabEnabled` in `settings.json` — see [Configuration](#configuration)
- **8 core views**: Overview (chart + top models), Models, Monthly, Weekly, Daily, Hourly, Stats (contribution graph), Agents. Optional Usage (subscription quotas) is hidden by default and can be enabled with `usageTabEnabled` in `settings.json` — see [Configuration](#configuration)
- **Keyboard Navigation**:
- `←/→/Tab/BackTab`: Switch views
- `↑/↓` or `Home/End`: Navigate lists
- `Enter`: Open daily detail (Daily tab) / select graph cell (Stats tab)
- `Enter`: Open period/day detail (Monthly, Weekly, Daily tabs) / select graph cell (Stats tab)
- `Esc` or `Backspace`: Close dialog or exit detail view
- `c/d/t`: Sort by cost/date/tokens
- `j`: Jump to today
Expand Down Expand Up @@ -722,27 +722,12 @@ Tokscale stores settings in `~/.config/tokscale/settings.json`:
| `defaultClients` | string[] | `[]` | Client filter applied when no `--client/-c` flag is passed. Accepts the same ids as `--client` (e.g. `["opencode", "claude", "zed"]`). Unknown ids are silently dropped. CLI flags always override this list completely — no merging. |
| `light.writeCache` | boolean | `false` | When true, `tokscale --light` overwrites the TUI cache atomically after rendering. CLI flags `--write-cache` / `--no-write-cache` override per-invocation. |
| `usageTabEnabled` | boolean | `false` | Show the subscription quota Usage tab in the TUI. Default-off because local token usage is the primary TUI workflow and subscription lookups are optional. |
| `minutelyTabEnabled` | boolean | `false` | Show the per-minute Minutely tab in the TUI and aggregate per-minute usage during data loading. Default-off because minute-granularity is a niche/diagnostic view for most users and the per-minute bucketing has a non-trivial cost on large datasets. |
| `scanner.extraScanPaths` | object | `{}` | Additional per-client scan roots for sessions outside Tokscale's default home-root locations |

Use `scanner.extraScanPaths` for persistent extra roots such as project-level `.codex` directories, imported Gemini/OpenClaw histories, Hermes profile databases, or a Windows Zed data directory mounted from WSL. Hermes entries may point at a profile directory containing `state.db` or directly at a `state.db` file. Zed entries may point at a `threads` directory containing `threads.db` or directly at `threads.db`. Tokscale merges these paths with the default scan roots on every run and deduplicates overlapping roots by canonical path.

Use `defaultClients` to pin a personal default — for example, set it to `["opencode", "claude"]` if those are the only clients you use, and `tokscale` (with no flags) will scope every report to them automatically. Pass `--client` on the command line to override for a single run.

#### Enabling the Minutely tab

The Minutely tab shows a per-minute breakdown of token usage and is most useful for diagnosing burst patterns, debugging a single session, or watching activity in near-real-time alongside `autoRefreshEnabled`. It is hidden by default because the per-minute aggregation runs over every parsed message during data loading, which adds RAM and CPU cost that most users do not need.

To enable it, set `minutelyTabEnabled` to `true` in `~/.config/tokscale/settings.json`:

```json
{
"minutelyTabEnabled": true
}
```

After restart, the Minutely tab appears between Hourly and Stats in the tab strip, and Tab / BackTab / Left / Right navigation cycles through it. Set the flag back to `false` to hide the tab and skip the aggregation again.

#### Cache directory layout

The regenerable CLI/TUI/pricing/Wrapped caches now live under `~/.config/tokscale/cache/` (or `${TOKSCALE_CONFIG_DIR}/cache/` when overridden). Integration sync artifacts remain in client-specific cache roots such as `~/.config/tokscale/antigravity-cache/` and `~/.config/tokscale/trae-cache/`:
Expand Down
21 changes: 3 additions & 18 deletions README.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
## 功能

- **交互式 TUI 模式** - 由 Ratatui 驱动的精美终端 UI(默认模式)
- 6 个核心交互式视图:概览、模型、每日、每时、统计、代理(可选的 Usage 与 Minutely 视图通过 `usageTabEnabled` / `minutelyTabEnabled` 启用)
- 8 个核心交互式视图:概览、模型、每月、每周、每日、每时、统计、代理(可选的 Usage 视图通过 `usageTabEnabled` 启用)
- 键盘和鼠标导航
- 9 种颜色主题的 GitHub 风格贡献图
- 实时筛选和排序
Expand Down Expand Up @@ -254,11 +254,11 @@ tokscale models --json > report.json # 保存到文件

交互式 TUI 模式提供:

- **6 个核心视图**:概览(图表 + 热门模型)、模型、每日、每时、统计(贡献图)、代理。可选的 Usage(订阅额度)与 Minutely 视图默认隐藏,可在 `settings.json` 中通过 `usageTabEnabled` / `minutelyTabEnabled` 启用,参见[配置](#配置)
- **8 个核心视图**:概览(图表 + 热门模型)、模型、每月、每周、每日、每时、统计(贡献图)、代理。可选的 Usage(订阅额度)默认隐藏,可在 `settings.json` 中通过 `usageTabEnabled` 启用,参见[配置](#配置)
- **键盘导航**:
- `←/→/Tab/BackTab`:切换视图
- `↑/↓` 或 `Home/End`:导航列表
- `Enter`:打开每日详情(Daily 标签)/ 选择图表单元格(Stats 标签)
- `Enter`:打开周期/每日详情(Monthly、Weekly、Daily 标签)/ 选择图表单元格(Stats 标签)
- `Esc` 或 `Backspace`:关闭对话框 / 退出详情视图
- `c/d/t`:按成本/日期/Token 排序
- `j`:跳转到今天
Expand Down Expand Up @@ -567,7 +567,6 @@ Tokscale 将设置存储在 `~/.config/tokscale/settings.json`:
| `defaultClients` | string[] | `[]` | 未传递 `--client/-c` 选项时应用的客户端筛选。接受与 `--client` 相同的 ID(例如 `["opencode", "claude", "zed"]`)。未知 ID 会被静默丢弃。命令行选项会完全覆盖此列表 — 不会合并。 |
| `light.writeCache` | boolean | `false` | 为 `true` 时,`tokscale --light` 会在渲染完成后以原子方式覆盖 TUI 缓存。CLI 标志 `--write-cache` / `--no-write-cache` 会按次运行覆盖该设置。 |
| `usageTabEnabled` | boolean | `false` | 在 TUI 中显示订阅额度 Usage 标签。默认关闭,因为本地 Token 使用统计是主要 TUI 工作流,订阅额度查询是可选功能。 |
| `minutelyTabEnabled` | boolean | `false` | 在 TUI 中显示按分钟的 Minutely 标签,并在数据加载期间执行分钟级聚合。对大多数用户而言,分钟级粒度是较为小众的诊断视图,而在大数据集上分钟分桶有非平凡的代价,因此默认关闭。 |

#### 启用 Usage 标签

Expand All @@ -583,20 +582,6 @@ Usage 视图显示订阅额度与重置时间,适合在本地 Token 使用统

重启后,Usage 标签会出现在 TUI 标签栏中。也可以直接运行 `tokscale usage`、`tokscale usage --json` 或 `tokscale usage --light` 查看订阅额度。

#### 启用 Minutely 标签

Minutely 标签按分钟显示 Token 使用情况,最适合用于诊断突发模式、调试单个会话,或与 `autoRefreshEnabled` 配合进行近实时监控。分钟级聚合在数据加载期间会遍历所有已解析的消息,对大多数用户来说带来不必要的 RAM 与 CPU 开销。因此默认情况下它是隐藏的。

要启用它,请在 `~/.config/tokscale/settings.json` 中将 `minutelyTabEnabled` 设为 `true`:

```json
{
"minutelyTabEnabled": true
}
```

重启后,Minutely 标签将出现在标签栏中 Hourly 与 Stats 之间,Tab / BackTab / Left / Right 导航将会在其间循环。把该标志再设为 `false` 可隐藏标签并再次跳过聚合。

#### 缓存目录布局

可再生成的 CLI/TUI/价格/Wrapped 缓存位于 `~/.config/tokscale/cache/` 下(如果设置了 `TOKSCALE_CONFIG_DIR`,则为 `${TOKSCALE_CONFIG_DIR}/cache/`)。集成同步产物保留在各自的客户端缓存目录中,例如 `~/.config/tokscale/antigravity-cache/` 和 `~/.config/tokscale/trae-cache/`:
Expand Down
2 changes: 1 addition & 1 deletion crates/tokscale-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ fn main() -> Result<()> {
since,
until,
year,
Some(Tab::Daily),
Some(Tab::Monthly),
)
}
}
Expand Down
Loading
Loading