CLI reference#
Installing battfeed puts a battfeed command on your path. Two global options come before the verb: -v/--verbose enables INFO-level logging to stderr (data never goes to stdout/stderr, so logs and data cannot mix), and --version prints the version.
$ battfeed --version
battfeed 0.5.0
battfeed sources#
battfeed sources
Lists every available data source — built-ins and sources contributed by other installed packages through the battfeed.sources entry-point group — with each source’s constructor options and defaults. Sources that cannot run on this machine are listed anyway, marked [unavailable: <reason>] with the concrete fix (which extra to install, what is missing from PATH).
battfeed discover#
battfeed discover [--source NAME] [--timeout SECONDS] [--opt KEY=VALUE ...] [--json]
Scans for devices the hardware sources can collect from and prints ready-to-paste collect commands. Without --source, every discovery-capable source is scanned; with it, just that one (--opt requires --source). --timeout is the budget per source scan (default 6.0 s); --json emits {source: [candidate, ...]} for scripting.
MC3000 chargers are found by their advertised FFE0 BLE service (a charger connected to another program stops advertising — close that program first). Android candidates are devices connected to adb plus wireless-debugging listeners seen over mDNS (unreliable on Windows; adb connect ip:port a phone that is not listed).
When exactly one device is in range, skip the scan-then-paste step: --opt address=auto (mc3000) and --opt serial=auto (android) resolve the single unambiguous device at start-up and fail with the candidate list otherwise — never a silent guess, so unattended runs stay deterministic.
battfeed collect#
battfeed collect --source NAME [options]
Polls a source on an interval and writes a .bdf.csv file plus its .meta.json sidecar. Ctrl-C stops gracefully and finalises the files.
Option |
Meaning |
|---|---|
|
source name (required; see |
|
how long to collect (default: until Ctrl-C) |
|
polling interval (default: 1.0) |
|
source constructor option, repeatable; values parsed as JSON when possible; overrides a |
|
output path (default: generated |
|
institution code in the generated name (default: |
|
cell name in the generated name (default: the source name) |
|
TOML file supplying source options and run parameters (details) |
battfeed import#
battfeed import --source NAME [options]
Drains a batch/file-import source into per-(series, run) .bdf.csv files. One-shot by default (stops when the source reports drained); at-least-once delivery with a content-hash dedupe ledger and quarantine (details).
Option |
Meaning |
|---|---|
|
source name (required) |
|
source constructor option, repeatable |
|
keep polling for new files until Ctrl-C / force one-shot over a config |
|
idle interval between checks for new files (default: 5.0) |
|
directory for the output files (default: current directory) |
|
institution code in the generated names (default: |
|
clear the source’s dedupe ledger before importing, re-ingesting everything (deleting output files never resets the ledger) |
|
TOML config file, as for |
Exit codes#
Code |
Meaning |
|---|---|
|
duration elapsed, source drained, or interrupted cleanly |
|
the source failed (its error budget was exhausted) |
|
configuration mistake: bad source name or options — restarting will not fix it, so always run a service’s exact command interactively once |