Skip to content

v0.52.0

Choose a tag to compare

@errhythm errhythm released this 14 Nov 12:17
· 176 commits to main since this release
feda00d

Four new ways for ccswap to pick accounts, borrowed from magpie's account picker (#48). Only the consume-first tie-break changes anything by default; the other three are settings you turn on.

  • A warning before quota goes unused. Turn on usage.wasteWarning and ccswap auto warns when an account's weekly window resets soon with a lot left. The menu bar shows a notification, and the terminal prints a line like Account 1 (...) resets in 3h with 58% unused. The defaults are within 6 hours of the reset and at least 40% left; change them with usage.wasteWarningHours and usage.wasteWarningPct. Each account is warned once per reset, even after a restart.
  • A home account. ccswap config set autoswitch.homeAccount <num|email> names the account you prefer, such as a Teams seat. Auto-switch still moves off it when it hits a limit, but goes back once it is 10 points below every limit (your hysteresis setting), so you don't drift away from it. While you're on it, consume-first won't move you off. If a live ccswap run session or something else blocks the return, ccswap auto reports home-blocked once.
  • ccswap run can pick the account. With run.autoPick on, a bare ccswap run in a directory with no mapping starts on the account with the fewest live sessions that is under the auto-switch threshold. It skips API-key accounts and accounts whose login needs fixing. With --require-session, it refuses to start rather than fall back to the default login.
  • Consume-first ignores resets a few minutes apart. Resets in the same clock hour now count as a tie, decided by remaining quota. Consume-first no longer moves to a nearly spent account just because its week resets four minutes sooner.

Email lookups in switch, remove and config set now ignore case.