Skip to content

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

@richardhowes

Description

@richardhowes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions