bob-rs
Unofficial. A community Rust SDK for the
bobagent CLI. Not affiliated with, sponsored by, or endorsed by the maintainers of bob.
A standalone Rust SDK for the bob agent CLI: detection
and readiness probing, streaming install, OS-keychain credential storage,
and spawning a bob run with its --output-format stream-json stream
piped back line-by-line.
No Tauri, no HTTP server, no harness abstraction — just the bob
integration logic, so it can be reused by any host. Exposing bob as a
Harness lives in the agent-harness crate's bob
module (which wraps this SDK); this crate stays a clean, standalone SDK.
Key surface:
get_readiness()→ aBobReadinessSnapshot(installed? version? Node? auth configured?).install_bob(cb)→ streams the bundled install script's progress.spawn_bob(opts, run_id, cb)/spawn_bob_raw(...)→ spawn a run, streamingProcessEvents (from thecli-streamengine) until exit; returns aProcessHandlefor cancellation.resolve_api_key()→ the bob API key, resolved asBOBSHELL_API_KEYfrom the environment first, else the OS keychain (see Authentication).read_api_key/write_api_key/delete_api_keymanage the keychain entry directly.
Authentication
bob runs with a BOBSHELL_API_KEY. resolve_api_key() (used by spawn_bob)
resolves it in this order:
- the
BOBSHELL_API_KEYenvironment variable — shell-exported, or loaded into the process env from a.envby your host (bob-rs does not parse a.envfile itself); then - the OS keychain entry (
write_api_keyto store it there).
The env var wins when both are set. So: export BOBSHELL_API_KEY, or call
bob_rs::write_api_key(&key) once to persist it in the keychain.
Example — run bob with a prompt
use sync_channel;
use ;
License
Licensed under either of MIT or Apache-2.0 at your option.