You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<api>:<version> syntax for unlisted APIs is advertised but not implemented #670
The error message instructs users to use <api>:<version> syntax to access unlisted APIs, but this syntax does not actually work — it produces the same error.
Steps to Reproduce
$ gws admob:v1 --help
{
"error": {
"code": 400,
"message": "Unknown service 'admob'. Known services: drive, sheets, gmail, ... Use '<api>:<version>' syntax for unlisted APIs.",
"reason": "validationError"
}
}
Expected Behavior
gws admob:v1 <resource> <method> should dynamically fetch the Discovery Document from https://www.googleapis.com/discovery/v1/apis/admob/v1/rest and expose the API commands, similar to how known services work.
Actual Behavior
The CLI parses the colon correctly (the error says Unknown service 'admob', not 'admob:v1', so splitting is happening), but resolve_service() only looks up the hardcoded SERVICES list and rejects any name not found there — with no fallback path for arbitrary Discovery API names.
The Discovery URL (https://www.googleapis.com/discovery/v1/apis/) is present in the binary, so the infrastructure exists.
Environment
gws v0.16.0 and v0.22.5 (x86_64-unknown-linux-musl)
Debian GNU/Linux 12 (bookworm)
Additional Context
APIs like admob:v1 and analyticsdata:v1beta are registered in Google's Discovery Service and would be useful to access via this CLI. The feature as described in the error message would unlock any Google API that exposes a Discovery Document, not just Workspace APIs.
+1 — confirming this still happens on v0.22.5 (macOS arm64, installed via brew install googleworkspace-cli).
Another concrete use case: YouTube Data API v3
Hit this today trying to read public YouTube video metadata via gws:
$ gws youtube:v3 videos list --params '{"part":"snippet","id":"Zh17z6Omn-s"}'
error[validation]: Unknown service 'youtube'. Known services: drive, sheets, ...
Use '<api>:<version>' syntax for unlisted APIs.
$ gws schema youtube:v3.videos.list
error[validation]: Unknown service 'youtube:v3'. ...
Noticed a small inconsistency: the main command parser splits on : (the error says 'youtube'), but gws schema does not split (the error says 'youtube:v3' — treating it as a single token).
The gws schema command path in schema.rs:43 calls resolve_service(service_name) directly without the colon-split preprocessing from main.rs, which is why error text differs between the two commands.
Suggested paths forward
Option A (quick — ~1h): Fix the error message in services.rs:153 to describe current behavior only. Remove the <api>:<version> fallback hint since it's not implemented. Stops costing users debugging time. 2-line change.
Option B (real feature — larger): When resolve_service(svc) fails AND the user provided a version via : syntax, attempt to fetch the Discovery document from https://www.googleapis.com/discovery/v1/apis/{svc}/{version}/rest and build the command tree dynamically. Unlocks any Google API with a Discovery Document (YouTube, AdMob, Analytics, Ads, etc.) but raises questions about OAuth scope selection and consent screen configuration for non-Workspace APIs.
Also worth fixing alongside either option: make gws schema use the same colon-split preprocessing as the main command parser, so error messages are consistent.
Happy to send a small PR for Option A if maintainers prefer the quick win — it's a tiny change and removes UX friction immediately. Option B is worth a design discussion.
Thanks @s2mr for the original report and thanks to the gws team — tool is otherwise delightful to use.
Context: found this while pair-debugging gws setup with Claude Code for a Thai-language tutorial. Happy to share the full write-up if useful.
Activity
boatnoy commentedon Apr 11, 2026
+1 — confirming this still happens on v0.22.5 (macOS arm64, installed via
brew install googleworkspace-cli).Another concrete use case: YouTube Data API v3
Hit this today trying to read public YouTube video metadata via
gws:Noticed a small inconsistency: the main command parser splits on
:(the error says'youtube'), butgws schemadoes not split (the error says'youtube:v3'— treating it as a single token).Source code pointers (for anyone fixing)
Colon-splitting happens in
crates/google-workspace-cli/src/main.rs:335-343:But
resolve_serviceincrates/google-workspace/src/services.rs:142-157is a hard lookup against theSERVICESconstant — no Discovery fallback path.The
gws schemacommand path inschema.rs:43callsresolve_service(service_name)directly without the colon-split preprocessing frommain.rs, which is why error text differs between the two commands.Suggested paths forward
Option A (quick — ~1h): Fix the error message in
services.rs:153to describe current behavior only. Remove the<api>:<version>fallback hint since it's not implemented. Stops costing users debugging time. 2-line change.Option B (real feature — larger): When
resolve_service(svc)fails AND the user provided a version via:syntax, attempt to fetch the Discovery document fromhttps://www.googleapis.com/discovery/v1/apis/{svc}/{version}/restand build the command tree dynamically. Unlocks any Google API with a Discovery Document (YouTube, AdMob, Analytics, Ads, etc.) but raises questions about OAuth scope selection and consent screen configuration for non-Workspace APIs.Also worth fixing alongside either option: make
gws schemause the same colon-split preprocessing as the main command parser, so error messages are consistent.Happy to send a small PR for Option A if maintainers prefer the quick win — it's a tiny change and removes UX friction immediately. Option B is worth a design discussion.
Thanks @s2mr for the original report and thanks to the
gwsteam — tool is otherwise delightful to use.Context: found this while pair-debugging
gwssetup with Claude Code for a Thai-language tutorial. Happy to share the full write-up if useful.feat: implement <api>:<version> syntax for unlisted Discovery APIs
fix: honor explicit version in <api>:<version> syntax for unlisted se…