clui 0.3.0

TUI for Claude Code and Codex usage limits
# clui

A ratatui TUI that renders Claude Code and Codex (OpenAI) usage limits as a
grid of cards, each with a circular progress gauge, the limit name, and a
human-friendly reset time.

```
 Claude Code · Usage Limits
╭──────────────────────────────╮╭────────────────────────────────────╮
│     ⢀⣀⣤⣤⣤⣄⣀                  ││     ⢀⣀⣤⣤⣤⣄⣀                        │
│   ⣤⣾⣿⠿⠛⠛⠛⠻⢿⣿⣦⡄               ││   ⣤⣾⣿⠿⠛⠛⠛⠻⢿⣿⣦⡄                     │
│ ⣼⣿⠃          ⢻⣿⡄  5-Hour     ││ ⣼⣿⠃          ⢻⣿⡄  7-Day Rolling    │
│ ⣿⣿    10%    ⢸⣿⡇  Block      ││ ⣿⣿    10%    ⢸⣿⡇  Resets Mon 02:00 │
│ ⢹⣿⣆         ⢀⣾⣿⠁  Resets in  ││ ⢹⣿⣆         ⢀⣾⣿⠁  · 41% through    │
│   ⠉⠻⢿⣿⣶⣶⣶⣾⣿⠿⠋⁁   3h 54m     ││   ⠉⠻⢿⣿⣶⣶⣶⣾⣿⠿⠋⁁   week             │
╰──────────────────────────────╯╰────────────────────────────────────╯
 Codex · Plus
╭──────────────────────────────╮╭────────────────────────────────────╮
│ ⣼⣿⠃          ⢻⣿⡄  Session    ││ ⣼⣿⠃          ⢻⣿⡄  Weekly           │
│ ⣿⣿     1%    ⢸⣿⡇  Resets in  ││ ⣿⣿     0%    ⢸⣿⡇  Resets Jun 17    │
│ ⢹⣿⣆         ⢀⣾⣿⠁  4h 59m     ││ ⢹⣿⣆         ⢀⣾⣿⠁  22:21            │
╰──────────────────────────────╯╰────────────────────────────────────╯
 q quit  r refresh  ·  updated 22:21:30
```

## Install

```sh
cargo install clui
```

Or from a checkout:

```sh
cargo install --path .
```

## Usage

```sh
clui
```

```
clui [OPTIONS]

  -t, --theme <NAME>        Color theme to start with (default: default,
                            which adapts to the terminal background)
      --themes-file <PATH>  Custom themes JSON (default: ~/.config/clui/themes.json)
      --list-themes         Print available themes and exit
```

Keys: `q`/`Esc` quit, `r` refresh now, `t`/`T` next/previous theme.

The `default` theme adapts to the terminal background: clui asks the terminal
for its background color (OSC 11) at startup and every couple of seconds
while running, so toggling the terminal between dark and light mode — as
lasso does by repainting the xterm.js palette in place — is picked up live.
Terminals that don't answer the query get the dark palette. Redefining
`default` in the themes file turns the adaptation off.

Successful fetches are cached in `~/.cache/clui/cache.json`, so a fresh
launch paints immediately and quick restarts don't spend extra API requests
(Anthropic rate-limits its usage endpoint aggressively). When a refresh
fails while data is on screen, the retry is noted dimly next to the
provider title rather than as an error.