Skip to main content

Crate pitboard_core

Crate pitboard_core 

Source
Expand description

The engine behind pitboard: parking and restoring a person’s own Claude Code logins, and reading what each has left. It serves pitboard’s own front ends, the command line and the native apps, which reach it through service::Pitboard with an explicit context::Context.

Modules§

api
What pitboard asks of Anthropic: who a login belongs to and how much it has left, both read with an access token, and fresh tokens for a parked login.
audit
One line per change pitboard makes: when, which front end asked, what was asked, of what, and how it ended. Labels, codes and times only, no email addresses or account identifiers, so it is safe to paste into a bug report.
context
Everything pitboard takes from its environment, read in one place. The CLI builds a Context from the process environment once. A program linking the library builds one itself: an app started from Finder does not see a shell’s environment.
doctor
pitboard doctor: check, on this machine, that what pitboard relies on about Claude Code still holds, and say which assumption broke when one has. Gathering is kept apart from judging so every judgement can be tested.
error
Every way pitboard can fail. Each variant has a message naming the cause and an action, a stable code for programs to branch on, and an exit code.
service
pitboard’s operations, each run the way every front end must run it: a change settles any interrupted switch first and is recorded in the audit log, and what went wrong on the way is reported alongside the result, whether or not the change then succeeds.
state
Which accounts pitboard knows and where each one is parked. No secrets: the logins stay in the keychain or vault.
status
pitboard status: who is signed in, what each account has left, and which accounts can be switched to.
statusline
pitboard statusline: one line for Claude Code’s status bar, naming the account in use and what every enrolled account has left.
switch
Moving the signed-in identity from one enrolled account to another.
time
Time through jiff: epoch seconds in everything pitboard stores, the local time zone only in what it shows a person.
usage
One view of “how much is left”, whatever shape it arrived in. Usage comes as a limits[] array or as named five_hour/seven_day objects; both are normalised at the boundary, and a value that fails to normalise is dropped rather than drawn.