Skip to content

gws drive +upload doesn't work with Shared Drive folders #722

@Dan-Wilhelm

Description

@Dan-Wilhelm

Hello together,
something I've stumbled upon while using the workspace cli:

What's wrong

Trying to upload into a Shared Drive folder fails with 404 File not found,
because +upload doesn't pass supportsAllDrives: true to the Drive API.
There's also no way to add it manually — the helper rejects --params.

So the helper is effectively unusable for anyone whose Drive content lives
on a Shared Drive (which is most teams).

This is related to #327 (which is about telling agents to add the flag when
calling the raw API), but separate: that issue is about awareness, this one
is about the helper having no way to set the flag at all.

How to reproduce

CLI version: @googleworkspace/cli v0.22.5

echo "test" > /tmp/test.txt
gws drive +upload /tmp/test.txt --parent <SHARED_DRIVE_FOLDER_ID>

Result:

{
  "error": {
    "code": 404,
    "message": "File not found: <SHARED_DRIVE_FOLDER_ID>.",
    "reason": "notFound"
  }
}

Trying to add the flag manually:

gws drive +upload /tmp/test.txt --parent <FOLDER_ID> \
  --params '{"supportsAllDrives": true}'

also fails:

error[validation]: error: unexpected argument '--params' found

What works

Skip the helper, use the raw API:

gws drive files create \
  --params '{"supportsAllDrives": true}' \
  --json '{"name": "test.txt", "parents": ["<FOLDER_ID>"]}' \
  --upload /tmp/test.txt

Suggested fixes (any one would resolve)

  1. Set supportsAllDrives: true by default in +upload. The flag is
    safe for non-shared drives — it has no effect when the parent isn't on
    a Shared Drive — so passing it unconditionally costs nothing and fixes
    the helper.
  2. Add a --shared-drive boolean flag that opts in.
  3. Allow --params as an escape hatch on +upload (and other helpers,
    for consistency with the raw API surface).

Option 1 is least friction for users (they don't need to know Shared Drives
are a thing); option 3 is most consistent with the rest of the CLI.

Environment

  • OS: Windows 10 (Git Bash)
  • gws CLI: 0.22.5

Cheers
Dan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions