Skip to content

feat(sheets): add --range flag to +append for tab selection#641

Open
YunChaoTsai wants to merge 1 commit intogoogleworkspace:mainfrom
YunChaoTsai:feat/sheets-append-range
Open

feat(sheets): add --range flag to +append for tab selection#641
YunChaoTsai wants to merge 1 commit intogoogleworkspace:mainfrom
YunChaoTsai:feat/sheets-append-range

Conversation

@YunChaoTsai
Copy link
Copy Markdown

@YunChaoTsai YunChaoTsai commented Mar 30, 2026

Summary

  • Add optional --range flag to sheets +append helper, allowing users to target specific sheet tabs via A1 notation (e.g. --range 'Sheet2!A1')
  • Previously, append always used hardcoded "A1" range, limiting appends to the first sheet
  • Defaults to "A1" for backward compatibility
  • Fix existing +read examples to use single quotes for range values containing !

Test plan

  • Unit tests: 11 sheets tests pass (cargo test -- sheets)
  • Clippy: no warnings
  • Manual test: append to default tab (no --range)
  • Manual test: append to named tab (--range 'hihi!A1')
  • Manual test: append to tab with CJK name (--range '中文的!A1')
  • Manual test: append with --json-values and --range

Note: Examples use single quotes for --range values containing ! to prevent zsh history expansion. In zsh, ! inside double quotes triggers history expansion per zsh spec, which can silently corrupt the range value.

🤖 Generated with Claude Code

Previously +append always used hardcoded "A1" range, limiting appends
to the first sheet. Add optional --range flag (default: "A1") to allow
appending to any sheet tab using A1 notation.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 30, 2026

🦋 Changeset detected

Latest commit: 5ad1893

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@googleworkspace-bot googleworkspace-bot added area: skills area: core Core CLI parsing, commands, error handling, utilities labels Mar 30, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the flexibility of the sheets +append command by enabling users to specify a target range for data insertion. By introducing the --range flag, users can now direct appends to specific tabs within a spreadsheet, rather than being restricted to the default first sheet. The changes include necessary updates to the CLI argument parsing, internal request construction, and comprehensive documentation to support the new functionality.

Highlights

  • New --range flag: Added an optional --range flag to the sheets +append command, allowing users to specify a target sheet tab using A1 notation.
  • Backward compatibility: The new flag defaults to 'A1', ensuring that existing workflows targeting the first sheet remain unaffected.
  • Documentation updates: Updated the CLI help text and skill documentation to include the new --range parameter and usage examples.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 30, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new --range flag to the gws sheets +append command, allowing users to specify a target range or sheet tab in A1 notation (defaulting to "A1"). The changes include updates to the CLI argument parsing, the internal configuration structure, request building logic, and comprehensive test coverage for the new parameter. Documentation in SKILL.md and a changeset file have also been updated to reflect these changes. I have no feedback to provide.

@googleworkspace-bot
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a --range flag to the gws sheets +append command, allowing users to specify a target sheet tab or range in A1 notation. The implementation involves updating the AppendConfig struct, the argument parser, and the request building logic to support this parameter, which defaults to 'A1'. Documentation and tests have also been updated to reflect these changes. I have no feedback to provide.

@YunChaoTsai YunChaoTsai force-pushed the feat/sheets-append-range branch from d7a17b0 to 5ad1893 Compare March 30, 2026 06:14
@googleworkspace-bot
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new --range flag to the sheets +append command in the Google Workspace CLI, allowing users to target specific sheet tabs using A1 notation. The implementation includes updates to the command-line argument parsing, the AppendConfig structure, and the request construction logic, alongside expanded unit tests and documentation. I have no feedback to provide as there are no review comments to evaluate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core CLI parsing, commands, error handling, utilities area: skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants