Skip to main content

grr_cli/commands/
mod.rs

1//! CLI command modules.
2//!
3//! Every service command lives in `generated.rs` (compiled from the
4//! Discovery index) and is dispatched by `gen_dispatch.rs`; the rest are
5//! the hand-written account-level commands.
6
7use crate::core::{GoogleAuth, GrrConfig};
8use anyhow::Result;
9
10/// Build a fresh `GoogleAuth` from the loaded config. One credential backs
11/// every service (and `grr mcp`); the token store is shared, so this is a
12/// cheap read.
13pub(crate) async fn build_auth(config: &GrrConfig) -> Result<GoogleAuth> {
14    // Fail here rather than letting an empty client_id reach Google's
15    // token endpoint and come back as an opaque 400.
16    if config.oauth.client_id.trim().is_empty() {
17        anyhow::bail!(crate::core::config::NO_CLIENT_HELP);
18    }
19
20    Ok(GoogleAuth::new(config.oauth.clone()).await?)
21}
22
23pub mod api;
24pub mod ask;
25pub mod auth;
26pub mod completions;
27pub mod gen_dispatch;
28pub mod generated;
29pub mod mcp;
30pub mod safety;
31pub mod setup;
32pub mod skills;
33pub mod transport;