Krellbot docs

Scheduling the tick

krellbot tick is a one-shot that runs every hour on the minute. The schedule itself is owned by the operating system: macOS launchd, Linux systemd user timers, or the Windows task scheduler. krellbot service and krellbot doctor install and inspect the schedule without ever talking to a live venue.

The renderers in krellbot.service.render are pure functions that take the absolute path of the krellbot executable and the home directory. They do not read Path.home() and they do not write files. Callers decide where to write; the test suite writes only under an injected root.

Renderers

Three platforms, one body shape:

Installing

krellbot service install --dry-run

Prints the unit body for the current platform and writes nothing. Use this to inspect what will land on disk before committing.

krellbot service install

Writes the unit under your real home: ~/Library/LaunchAgents on macOS, ~/.config/systemd/user on Linux, ~/Tasks on Windows. --root PATH writes there instead, which is how tests avoid touching the real home. --dry-run still writes nothing.

krellbot service uninstall

Deletes only the unit files install wrote: the plist, both Linux units, or the Windows task XML. Files outside the named set are never touched.

Inspecting health: krellbot doctor

krellbot doctor runs every health check with no network unless a clock source is injected. By default the CLI injects the public Kraken Time endpoint (https://api.kraken.com/0/public/Time, reading result.unixtime) so skew is checked against a real wall clock; tests pass a fake source and prove zero socket calls.

krellbot doctor           # text, exit 0 when ok
krellbot doctor --json    # machine-readable, same keys, same exit code

The checks, each a row in text and a field in JSON:

FieldMeaning
home_mode_okTrue if KRELLBOT_HOME is 0o700 on POSIX. null on Windows (skipped, not failed).
keychain_backendThe OS keychain backend name. A null, fail, or fake backend is a warning.
keysPer venue: present or absent. With an injected permission probe, also trade and withdraw.
service_installedTrue if the unit file exists for this platform under the write root.
last_tick_age_sSeconds since the last kind=tick journal record. null if no record.
last_tick_staleTrue when last_tick_age_s is missing or >= 2 * 3600.
clock_skew_snow - unixtime from the injected source. null if no source.
clock_warnA warning string when abs(skew) > 5. "clock not checked" when no source.
license_statusStatus from catalog/license-cache.json, or missing.
armedPer armed pack: venue, pair, cap, ok, warning. Unknown pair warns minimums not loaded.
install_readytrue when the home directory mode is not flagged, the keychain backend is real (not null / fail / fake), and a loopback bind probe succeeds. Independent of service_installed — the scheduler install is a separate concern.
trading_readyinstall_ready AND a fresh tick (last_tick_stale = false) AND at least one venue key whose probed permissions report trade = true and withdraw = false. Keys with no permission probe are unknown — unknown permissions fail closed and do not make trading_ready true.
warningsAggregated human-readable warnings. ok is true iff this list is empty.

The two readiness fields never suppress the existing warnings and never change ok. A fresh install with no keys, no tick, no scheduler, and a real keychain backend is install_ready=true and trading_ready=false — install readiness does not require stored keys or a stored tick. Live arm from the page is 403 by construction; the typed LIVE confirmation stays the CLI-only path, and the doctor's trading_ready gate is the additional machine-readable signal.

JSON keys are stable. ok is true only when warnings is empty. Exit code is 0 when ok, 1 otherwise.

What the doctor never does

← docs