docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body)

Open Beginner friendly
#914 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli, documentation

Research direction

Start from the gws gmail +send --draft tip generation and search for the displayed users.drafts.send or --body text. Update the printed command to use space-separated subcommands and --json, then verify that the tip matches the working command shown in the issue.

Written by the indexing model from the issue text.

Description

After gws gmail +send --draft, the CLI prints this tip:

Tip: copy the draft "id" from the response above, then send with:
  gws gmail users.drafts.send --body '{"id":"<draft-id>"}'

Both halves of that command are wrong, so following the tip fails twice:

  1. gws gmail users.drafts.send --body '{"id":"..."}'
    error: unrecognized subcommand 'users.drafts.send'
    Subcommands are space-separated: users drafts send.

  2. gws gmail users drafts send --params '{"userId":"me"}' --body '{"id":"..."}'
    error: unexpected argument '--body' found
    The request-body flag is --json, not --body.

Putting the id in --params instead returns HTTP 400 Invalid draft, since it goes to the query string rather than the request body.

What works:

gws gmail users drafts send --params '{"userId":"me"}' --json '{"id":"<draft-id>"}'

Suggested fix: update the tip's second line to the working form.

Environment: gws 0.22.5 (npm @googleworkspace/cli, current latest), macOS arm64.

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.