Repository navigation
Installation
agentstat is a library crate for Rust applications. It requires a Tokio runtime. Rust stable is used in CI; the initial release does not promise a minimum Rust version.
For a project that already uses Tokio:
cargo add agentstat@0.1.0For a new async binary, also add Tokio:
cargo add tokio --features macros,rt-multi-threadEquivalent Cargo.toml entries:
[dependencies]
agentstat = "0.1.0"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }The default provider features are codex and claude. Enable other implemented providers by feature ID. For example:
agentstat = { version = "0.1.0", default-features = false, features = ["cursor", "local-files"] }local-files enables code for reading supported CLI credential files; your application must also call allow_local_files(true). local-probes similarly needs allow_local_probes(true) and is Unix-only. Enable only the providers and local access you need. The all-providers feature also includes planned IDs; it does not make those adapters work.
Some behavior on main, such as OpenCode Go, requires a release newer than 0.1.0. To try it locally:
git clone https://github.com/dhanushk-offl/agentstat.gitIn your application's Cargo.toml, point at the checkout:
agentstat = { path = "../agentstat", default-features = false, features = ["opencodego"] }Adjust the path to where you cloned the repository. Use cargo run or cargo test in your application as usual. For a reproducible dependency, use a specific released version or commit rather than an unpinned branch.
Run the simplest example from the agentstat checkout with a valid bearer token:
read -r -s -p "Codex OAuth token: " AGENTSTAT_TOKEN; echo
export AGENTSTAT_TOKEN
cargo run --example fetch -- codex
unset AGENTSTAT_TOKENThe example prints a JSON snapshot. It requires a Codex OAuth access token, not an ordinary OpenAI API key. For a safer first run using an existing Codex CLI login, follow Quick Start. Keep tokens out of shell history and source files.
See Provider Coverage for feature IDs and Releases and Compatibility for published versus source behavior.
Repository · Rust API docs · Issues · Releases · Security