script service not registered in services.rs — helper and setup exist but are unreachable

Open Beginner friendly
#625 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust
Domain
cli

Research direction

Start in crates/google-workspace/src/services.rs and compare the existing ServiceEntry definitions with the registry data in the issue. Run the provided gws script projects get reproduction, then inspect parse_service_and_version() in main.rs for the secondary error-message behavior. Done means the script aliases resolve and the command no longer reports an unknown service.

Written by the indexing model from the issue text.

Description

The Apps Script API (script.googleapis.com) has supporting infrastructure throughout the codebase but is missing from the service registry, making it impossible to use via gws script ....

What exists already
Component Location Status
API enablement during setup setup.rs ~L121 (script.googleapis.com) ✅ Enabled
ScriptHelper with +push command helpers/script.rs ✅ Implemented
Helper registration for "script" | "apps-script" helpers/mod.rs ~L122 ✅ Wired up
Discovery document script_v1.json fetches and caches fine ✅ Works
Auth scopes (script.projects, script.deployments, script.processes) Granted during gws auth login ✅ Available
What's missing

A ServiceEntry in crates/google-workspace/src/services.rs:

ServiceEntry {
    aliases: &["script", "apps-script"],
    api_name: "script",
    version: "v1",
    description: "Manage Apps Script projects and deployments",
},

Without this, resolve_service("script") returns Unknown service and all the existing helper code is dead/unreachable.

Secondary: misleading error message for unlisted APIs

The error message suggests:

Use <api>:<version> syntax for unlisted APIs.

However, parse_service_and_version() in main.rs splits on : first (L336) but then calls resolve_service() with just the service name (L343), which still rejects it. So the <api>:<version> syntax only overrides the version for already-registered services — it doesn't enable unlisted APIs as the message implies.

Steps to reproduce
gws script projects get --params '{"scriptId": "..."}'
# Error: Unknown service 'script'

gws script:v1 projects get --params '{"scriptId": "..."}'
# Error: Unknown service 'script' (same result)
Environment
  • gws v0.4.x (npm install)
  • macOS (Apple Silicon)
  • script.googleapis.com enabled in GCP project
  • script.projects scope granted
Dominant language
Rust
Stars
31.1k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleworkspace/cli

All issues in googleworkspace/cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.