Replies: 1 comment 1 reply
-
|
sounds fine |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
The library API is currently CLI-shaped:
Config::load_smart+get_secrets(profile)+ per-secretSecretConfig+secret_resolver::resolve_secret. Consumers that just want "give me this secret" have to replicate whatGetCommand::rundoes in their own codebase.We hit this when wiring fnox into a Rust agent (bglusman/zeroclawed) — the path of least resistance was a subprocess wrapper around the
fnoxbinary, even though that adds PATH dependency, fork-per-call latency, and an argv-leak surface. Library mode would be strictly better, but the boilerplate to use it is non-trivial.Proposal
Add a top-level convenience API to
fnox::lib.rs:Implementation can wrap the existing
GetCommand::run/SetCommand::run/ListCommand::runlogic — minus stdin/stdout/println. The CLI commands then become a thin binary-side adapter over the same Fnox type.Why now
We have a proof-of-concept in crates/onecli-client/src/fnox_library.rs —
get+listwork;setdeliberately not implemented because that orchestration is the bulk of what should land upstream rather than per consumer.If you would welcome it, happy to send a PR.
Concrete pain points the convenience API removes
config.get_secrets(profile)?.get(name)boilerplate at every call siteThanks for the work on fnox.
Beta Was this translation helpful? Give feedback.
All reactions