Skip to main content

Crate grabcli_core

Crate grabcli_core 

Source
Expand description

Shared core for grabcli: the parts every Grab service reuses — config, session, auth/hydra, the allowlisted HTTP client, the read-only response cache, money and output helpers.

Service crates (e.g. grabfood) depend on this, register their URL allowlist, and make calls through ctx::Context.

Re-exports§

pub use cache::Cache;
pub use cache::CacheKey;
pub use cache::CacheKind;
pub use cache::CacheMode;
pub use cache::Fetched;
pub use config::Config;
pub use ctx::Context;
pub use error::Error;
pub use error::ErrorKind;
pub use error::Result;
pub use http::Allowlist;
pub use http::Client;
pub use http::Hydra;
pub use http::Request;
pub use location::Location;
pub use money::Money;
pub use output::Format;
pub use output::Output;
pub use session::Session;

Modules§

cache
Local cache for read-only browse data, in one SQLite database at <cache dir>/cache.sqlite (WAL, mode 0600, inside a 0700 directory).
cdp
Chrome DevTools Protocol client.
config
config.toml: user settings. Every key is optional.
ctx
The runtime context shared by every command.
error
One error type for every grabcli command.
http
The shared HTTP client.
hydra
The hydra device JWT.
jwt
Minimal JWT helpers: decode the (unverified) payload, read exp.
location
The saved delivery address, read from the location cookie (URL-encoded JSON). grabcli always shows the delivery address on a quote so the user can confirm where the food is going.
login
grab auth login: a real phone login on weblogin.grab.com, driven over CDP inside an isolated browser context.
money
Money as integer minor units (centavos). Display adds the ₱ symbol and thousands separators.
output
Output context: human-readable lines vs. a single --json document, and a uniform way to emit structured errors.
paths
Where grabcli keeps its files, and private/atomic file writes.
places
Saved places (Home, Work and other saved addresses) from the account’s address book, as food.grab.com’s address picker loads them. See docs/places.md.
session
The saved Grab web session grabcli reads at runtime.
sso
Silent session refresh through the GrabID SSO cookie (grab auth refresh).