diff --git a/.changeset/461e1845e9c8.md b/.changeset/461e1845e9c8.md deleted file mode 100644 index 008b1cd..0000000 --- a/.changeset/461e1845e9c8.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -docs(auth): add manual Google Cloud OAuth client setup and browser-assisted login guidance - -Adds step-by-step guidance for creating a Desktop OAuth client in Google Cloud Console, -where to place `client_secret.json`, and how humans/agents can complete browser consent -(including unverified app and scope-selection prompts). diff --git a/.changeset/9df09438f1eb.md b/.changeset/9df09438f1eb.md deleted file mode 100644 index ae644e4..0000000 --- a/.changeset/9df09438f1eb.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -Narrow default OAuth scopes to avoid `Error 403: restricted_client` on unverified apps and add a `--full` flag for broader access (fixes #25). Replace the cryptic non-interactive setup error with actionable step-by-step OAuth console instructions (fixes #24). diff --git a/.changeset/access-not-configured-guidance.md b/.changeset/access-not-configured-guidance.md deleted file mode 100644 index a1caf9f..0000000 --- a/.changeset/access-not-configured-guidance.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -feat(error): detect disabled APIs and guide users to enable them - -When the Google API returns a 403 `accessNotConfigured` error (i.e., the -required API has not been enabled for the GCP project), `gws` now: - -- Extracts the GCP Console enable URL from the error message body. -- Prints the original error JSON to stdout (machine-readable, unchanged shape - except for an optional new `enable_url` field added to the error object). -- Prints a human-readable hint with the direct enable URL to stderr, along - with instructions to retry after enabling. - -This prevents a dead-end experience where users see a raw 403 JSON blob -with no guidance. The JSON output is backward-compatible; only an optional -`enable_url` field is added when the URL is parseable from the message. - -Fixes #31 diff --git a/.changeset/ci-auto-generate-skills.md b/.changeset/ci-auto-generate-skills.md deleted file mode 100644 index eef64b5..0000000 --- a/.changeset/ci-auto-generate-skills.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -ci: auto-generate and commit skills on PR branch pushes diff --git a/.changeset/docs-community-guidance.md b/.changeset/docs-community-guidance.md deleted file mode 100644 index 4bd5fb5..0000000 --- a/.changeset/docs-community-guidance.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -docs: add community guidance to gws-shared skill and gws --help output - -Encourages agents and users to star the repository and directs bug reports -and feature requests to GitHub Issues, with guidance to check for existing -issues before opening new ones. diff --git a/.changeset/fix-atomic-credential-writes.md b/.changeset/fix-atomic-credential-writes.md deleted file mode 100644 index 87ffbcf..0000000 --- a/.changeset/fix-atomic-credential-writes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -fix: atomic credential file writes to prevent corruption on crash or Ctrl-C diff --git a/.changeset/fix-auth-help-flag.md b/.changeset/fix-auth-help-flag.md deleted file mode 100644 index e20b849..0000000 --- a/.changeset/fix-auth-help-flag.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -fix(auth): support --help / -h flag on auth subcommand diff --git a/.changeset/fix-table-flatten-and-unicode.md b/.changeset/fix-table-flatten-and-unicode.md deleted file mode 100644 index a3dce0d..0000000 --- a/.changeset/fix-table-flatten-and-unicode.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -fix: flatten nested objects in table output and fix multi-byte char truncation panic diff --git a/.changeset/fix-unknown-format-warning.md b/.changeset/fix-unknown-format-warning.md deleted file mode 100644 index bc561da..0000000 --- a/.changeset/fix-unknown-format-warning.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -fix: warn to stderr when unknown --format value is provided diff --git a/.changeset/fix-yaml-block-scalar-and-page-all-headers.md b/.changeset/fix-yaml-block-scalar-and-page-all-headers.md deleted file mode 100644 index f8bf33a..0000000 --- a/.changeset/fix-yaml-block-scalar-and-page-all-headers.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -fix: YAML block scalar for strings with `#`/`:`, and repeated CSV/table headers with `--page-all` - -**Bug 1 — YAML output: `drive#file` rendered as block scalar** - -Strings containing `#` or `:` (e.g. `drive#file`, `https://…`) were -incorrectly emitted as YAML block scalars (`|`), producing output like: - -```yaml -kind: | - drive#file -``` - -Block scalars add an implicit trailing newline which changes the string -value and produces invalid-looking output. The fix restricts block -scalar to strings that genuinely contain newlines; all other strings -are double-quoted, which is safe for any character sequence. - -**Bug 2 — `--page-all` with `--format csv` / `--format table` repeats headers** - -When paginating with `--page-all`, each page printed its own header row, -making the combined output unusable for downstream processing: - -``` -id,kind,name ← page 1 header -1,drive#file,foo.txt -id,kind,name ← page 2 header (unexpected!) -2,drive#file,bar.txt -``` - -Column headers (and the table separator line) are now emitted only for -the first page; continuation pages contain data rows only. diff --git a/.changeset/fix-yaml-pagination-separators.md b/.changeset/fix-yaml-pagination-separators.md deleted file mode 100644 index 0784012..0000000 --- a/.changeset/fix-yaml-pagination-separators.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -fix: add YAML document separators (---) when paginating with --page-all --format yaml diff --git a/.changeset/skip-smoketest.md b/.changeset/skip-smoketest.md deleted file mode 100644 index 5c98dc9..0000000 --- a/.changeset/skip-smoketest.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@googleworkspace/cli": patch ---- - -ci: skip smoketest on fork pull requests diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7a36c..769f609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,79 @@ # @googleworkspace/cli +## 0.2.2 + +### Patch Changes + +- f281797: docs(auth): add manual Google Cloud OAuth client setup and browser-assisted login guidance + + Adds step-by-step guidance for creating a Desktop OAuth client in Google Cloud Console, + where to place `client_secret.json`, and how humans/agents can complete browser consent + (including unverified app and scope-selection prompts). + +- ee2e216: Narrow default OAuth scopes to avoid `Error 403: restricted_client` on unverified apps and add a `--full` flag for broader access (fixes #25). Replace the cryptic non-interactive setup error with actionable step-by-step OAuth console instructions (fixes #24). +- de2787e: feat(error): detect disabled APIs and guide users to enable them + + When the Google API returns a 403 `accessNotConfigured` error (i.e., the + required API has not been enabled for the GCP project), `gws` now: + + - Extracts the GCP Console enable URL from the error message body. + - Prints the original error JSON to stdout (machine-readable, unchanged shape + except for an optional new `enable_url` field added to the error object). + - Prints a human-readable hint with the direct enable URL to stderr, along + with instructions to retry after enabling. + + This prevents a dead-end experience where users see a raw 403 JSON blob + with no guidance. The JSON output is backward-compatible; only an optional + `enable_url` field is added when the URL is parseable from the message. + + Fixes #31 + +- 9935dde: ci: auto-generate and commit skills on PR branch pushes +- 4b868c7: docs: add community guidance to gws-shared skill and gws --help output + + Encourages agents and users to star the repository and directs bug reports + and feature requests to GitHub Issues, with guidance to check for existing + issues before opening new ones. + +- 0603bce: fix: atomic credential file writes to prevent corruption on crash or Ctrl-C +- 666f9a8: fix(auth): support --help / -h flag on auth subcommand +- bcd2401: fix: flatten nested objects in table output and fix multi-byte char truncation panic +- ee35e4a: fix: warn to stderr when unknown --format value is provided +- e094b02: fix: YAML block scalar for strings with `#`/`:`, and repeated CSV/table headers with `--page-all` + + **Bug 1 — YAML output: `drive#file` rendered as block scalar** + + Strings containing `#` or `:` (e.g. `drive#file`, `https://…`) were + incorrectly emitted as YAML block scalars (`|`), producing output like: + + ```yaml + kind: | + drive#file + ``` + + Block scalars add an implicit trailing newline which changes the string + value and produces invalid-looking output. The fix restricts block + scalar to strings that genuinely contain newlines; all other strings + are double-quoted, which is safe for any character sequence. + + **Bug 2 — `--page-all` with `--format csv` / `--format table` repeats headers** + + When paginating with `--page-all`, each page printed its own header row, + making the combined output unusable for downstream processing: + + ``` + id,kind,name ← page 1 header + 1,drive#file,foo.txt + id,kind,name ← page 2 header (unexpected!) + 2,drive#file,bar.txt + ``` + + Column headers (and the table separator line) are now emitted only for + the first page; continuation pages contain data rows only. + +- 173d155: fix: add YAML document separators (---) when paginating with --page-all --format yaml +- 214fc18: ci: skip smoketest on fork pull requests + ## 0.2.1 ### Patch Changes diff --git a/Cargo.lock b/Cargo.lock index f55108b..b9bfdb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -845,7 +845,7 @@ dependencies = [ [[package]] name = "gws" -version = "0.2.1" +version = "0.2.2" dependencies = [ "aes-gcm", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index b758e64..5732a0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ [package] name = "gws" -version = "0.2.1" +version = "0.2.2" edition = "2021" description = "Google Workspace CLI — dynamic command surface from Discovery Service" license = "Apache-2.0" diff --git a/package.json b/package.json index 264719b..48b08cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@googleworkspace/cli", - "version": "0.2.1", + "version": "0.2.2", "private": true, "description": "Google Workspace CLI — dynamic command surface from Discovery Service", "license": "Apache-2.0",