Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/feat-manual-notation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@googleworkspace/cli": minor
---

Add [MANUAL] notation to help text and runtime messages for steps requiring human interaction
10 changes: 5 additions & 5 deletions src/auth_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ fn token_cache_path() -> PathBuf {
pub async fn handle_auth_command(args: &[String]) -> Result<(), GwsError> {
const USAGE: &str = concat!(
"Usage: gws auth <login|setup|status|export|logout|list|default> [options]\n\n",
" login Authenticate via OAuth2 (opens browser)\n",
" login [MANUAL] Authenticate via OAuth2 (opens browser for consent)\n",
" --account EMAIL Associate credentials with a specific account\n",
" --readonly Request read-only scopes\n",
" --full Request all scopes incl. pubsub + cloud-platform\n",
" (may trigger restricted_client for unverified apps)\n",
" --scopes Comma-separated custom scopes\n",
" -s, --services Comma-separated service names to limit scope picker\n",
" (e.g. -s drive,gmail,sheets)\n",
" setup Configure GCP project + OAuth client (requires gcloud)\n",
" setup [MANUAL] Configure GCP project + OAuth client (requires gcloud)\n",
" --project Use a specific GCP project\n",
" status Show current authentication state\n",
" export Print decrypted credentials to stdout\n",
Expand Down Expand Up @@ -203,7 +203,7 @@ impl yup_oauth2::authenticator_delegate::InstalledFlowDelegate for CliFlowDelega
} else {
url.to_string()
};
eprintln!("Open this URL in your browser to authenticate:\n");
eprintln!("[MANUAL] Open this URL in your browser to authenticate:\n");
eprintln!(" {display_url}\n");
Ok(String::new())
})
Expand Down Expand Up @@ -508,8 +508,8 @@ fn resolve_client_credentials() -> Result<(String, String, Option<String>), GwsE
format!(
"No OAuth client configured.\n\n\
Either:\n \
1. Run `gws auth setup` to configure a GCP project and OAuth client\n \
2. Download client_secret.json from Google Cloud Console and save it to:\n \
1. [MANUAL] Run `gws auth setup` (interactive wizard, opens browser)\n \
2. [MANUAL] Download client_secret.json from Google Cloud Console and save it to:\n \
{}\n \
3. Set env vars: GOOGLE_WORKSPACE_CLI_CLIENT_ID and GOOGLE_WORKSPACE_CLI_CLIENT_SECRET",
crate::oauth_config::client_config_path().display()
Expand Down
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ pub fn print_error_json(err: &GwsError) {
{
if reason == "accessNotConfigured" {
eprintln!();
eprintln!("💡 API not enabled for your GCP project.");
eprintln!("💡 [MANUAL] API not enabled for your GCP project.");
if let Some(url) = enable_url {
eprintln!(" Enable it at: {url}");
eprintln!(" [MANUAL] Enable it at: {url}");
} else {
eprintln!(" Visit the GCP Console → APIs & Services → Library to enable the required API.");
eprintln!(" [MANUAL] Visit the GCP Console → APIs & Services → Library to enable the required API.");
}
eprintln!(" After enabling, wait a few seconds and retry your command.");
}
Expand Down
10 changes: 5 additions & 5 deletions src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ fn stage_account(ctx: &mut SetupContext) -> Result<SetupStage, GwsError> {
.unwrap()
.suspend()
.map_err(|e| GwsError::Validation(format!("TUI error: {e}")))?;
eprintln!(" → Opening browser for login...");
eprintln!(" → [MANUAL] Opening browser for login...");
gcloud_auth_login()?;
let acct = get_gcloud_account()?.ok_or_else(|| {
GwsError::Auth("Authentication failed — no active account".to_string())
Expand Down Expand Up @@ -1285,21 +1285,21 @@ fn manual_oauth_instructions(project_id: &str) -> String {

format!(
concat!(
"OAuth client creation requires manual setup in the Google Cloud Console.\n\n",
"[MANUAL] OAuth client creation requires manual setup in the Google Cloud Console.\n\n",
"Follow these steps:\n\n",
"1. Configure the OAuth consent screen (if not already done):\n",
"1. [MANUAL] Configure the OAuth consent screen (if not already done):\n",
" {consent_url}\n",
" → User Type: External\n",
" → App name: gws CLI (or your preferred name)\n",
" → Support email: your Google account email\n",
" → Save and continue through all screens\n\n",
"2. Create an OAuth client ID:\n",
"2. [MANUAL] Create an OAuth client ID:\n",
" {creds_url}\n",
" → Click 'Create Credentials' → 'OAuth client ID'\n",
" → Application type: Desktop app\n",
" → Name: gws CLI (or your preferred name)\n",
" → Click 'Create'\n\n",
"3. Copy the Client ID and Client Secret shown in the dialog.\n\n",
"3. [MANUAL] Copy the Client ID and Client Secret shown in the dialog.\n\n",
"4. Provide the credentials to gws using one of these methods:\n\n",
" Option A — Environment variables (recommended for CI/scripts):\n",
" export GOOGLE_WORKSPACE_CLI_CLIENT_ID=\"<your-client-id>\"\n",
Expand Down
Loading