Skip to content

Verified installs, run --best, and red-zone alerts - #6

Merged
NotAProgrammer187 merged 5 commits into
mainfrom
feat/checksums-best-and-alerts
Aug 12, 2026
Merged

NotAProgrammer187 merged 5 commits into
mainfrom
feat/checksums-best-and-alerts

Conversation

@NotAProgrammer187

Copy link
Copy Markdown
Owner

Four additions that make ccswitch safer to install and more useful to leave running:

Checksum-verified installs

  • release.yml publishes a SHA256SUMS manifest beside the release binaries.
  • ccswitch upgrade, install.ps1, and a new install.sh (curl-one-liner for macOS/Linux) all verify what they download against it before installing. Releases predating the manifest get a loud warning; once a manifest exists, a mismatch or unlisted asset is fatal and the temp file is cleaned up.

ccswitch run --best

Fetches usage for every signed-in profile in parallel and launches the one with the most rate-limit headroom. Score is the most-used window (the one that stops you first), ties go to the most recently used account, unreadable accounts are skipped, and it prints what it picked and why.

Red-zone alerts in the watch panel

A window crossing 90% rings the terminal bell and posts a desktop notification — WinRT toast on Windows, Notification Center on macOS, notify-send on Linux. One crossing is one alert: first sighting only records state, and a window re-arms only after dropping back below the threshold. Covered by TestCheckAlertsFiresOncePerCrossing.

CI

New ci.yml runs go vet + go test on Windows and Linux for every push and PR — release.yml only builds, so nothing verified changes before this.

Tests: go vet ./..., go build ./..., go test ./... all pass locally on Windows.

release.yml only builds; nothing verified a change before this. Runs on
Windows (the platform the tool targets first) and Linux (the platform
the release builds run on).
release.yml now publishes a sha256sum manifest beside the binaries, and
all three install paths check what they download against it before
putting it on the PATH: ccswitch upgrade, install.ps1, and a new
install.sh one-liner for macOS/Linux. A release from before the
manifest existed downgrades to a loud warning; once a manifest is
present, a mismatch or an unlisted asset is fatal and the temp file is
removed.
An account's score is its most-used window, since that's the one that
will stop you first; lower wins, and a tie goes to the most recently
used account. Usage is fetched for all signed-in profiles in parallel;
accounts whose usage can't be read are skipped rather than guessed at.
Prints what it picked and why before launching.
The watch panel is most useful when it isn't in view, so a window
crossing 90% now rings the terminal bell and posts a desktop
notification: a WinRT toast on Windows, Notification Center via
osascript on macOS, notify-send on Linux. Notification failures are
silent; the bell always fires.

One crossing is one alert: the first sighting of a window only records
where it is, staying in the red stays quiet, and a window has to drop
back below the threshold before it can alert again.
Also ignore the *.exe~ aside binary that ccswitch upgrade leaves
behind until the next launch.
@NotAProgrammer187
NotAProgrammer187 merged commit 7af040d into main Aug 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant