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::prelude::*;
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(AuthConfigBuilder::new()
21 .oauth(config.oauth.clone())
22 .build()
23 .await?)
24}
25
26pub mod api;
27pub mod ask;
28pub mod auth;
29pub mod completions;
30pub mod gen_dispatch;
31pub mod generated;
32pub mod mcp;
33pub mod safety;
34pub mod setup;
35pub mod skills;
36pub mod transport;