feat(sheets): add named ranges support#278
Merged
steipete merged 2 commits intoopenclaw:mainfrom Mar 8, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds named range support to the Sheets CLI, including CRUD commands for named ranges and allowing named range inputs where GridRange-backed operations are required.
Changes:
- Introduces a shared spreadsheet “range catalog” fetch + resolver to map either
Sheet!A1or named range name/ID into aGridRange. - Adds
gog sheets named-rangescommand group (list/get/add/update/delete). - Extends A1 parsing to support column-only, row-only, and open-ended A1 forms for GridRange operations.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cmd/sheets_validation.go | Switches validation-copy source range resolution to named-range-aware catalog; updates GridRange construction to force-send SheetId. |
| internal/cmd/sheets_update_validation_test.go | Adds test coverage for --copy-validation-from using a named range. |
| internal/cmd/sheets_range_resolve.go | New: fetches sheet+namedRanges catalog and resolves input to GridRange; resolves named ranges by name/ID. |
| internal/cmd/sheets_notes.go | Updates help text to mention named ranges for notes range argument. |
| internal/cmd/sheets_named_ranges.go | New: implements sheets named-ranges CRUD commands and output formatting. |
| internal/cmd/sheets_named_ranges_test.go | New: tests add/update/delete named range commands via mocked Sheets API. |
| internal/cmd/sheets_format.go | Allows format to accept named range inputs by resolving via catalog. |
| internal/cmd/sheets_format_test.go | Adds test coverage for format using a named range. |
| internal/cmd/sheets_a1.go | Extends A1 parsing to accept column ranges, row ranges, and open-ended forms. |
| internal/cmd/sheets_a1_test.go | Adds tests for the new A1 parsing forms. |
| internal/cmd/sheets.go | Registers named-ranges command group; updates help text to mention named ranges where applicable. |
| README.md | Updates examples to show named range usage + new named-ranges commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3bbe80a to
cea84d8
Compare
Contributor
Author
|
@steipete Please review :) |
Adds a new `sheets named-ranges` command group to list/get/add/update/delete named ranges via Sheets batchUpdate. Extends range handling so `sheets format` and data-validation copy can target named ranges, improves A1 parsing for GridRange-backed operations, and includes reviewed safety/regression updates for range resolution and SheetId force-send.
cea84d8 to
3e5972e
Compare
Collaborator
|
Landed via temp rebase onto main. Fixups in the land pass:
Thanks @TheCrazyLex! |
klodr
pushed a commit
to klodr/gogcli
that referenced
this pull request
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds named range support for Google Sheets.
User-Facing Changes
gog sheets named-ranges(list/get/add/update/delete).gog sheets format <spreadsheetId> <namedRange>gog sheets update|append ... --copy-validation-from <namedRange>Implementation Notes
sheets + namedRanges) and a resolver that maps either A1-with-sheet or named range name/ID into aGridRange.Sheet1!A:C,Sheet1!2:10,Sheet1!B5:D).sheetIdis always sent for GridRanges even when it is0(first sheet), viaForceSendFields.Docs
Testing
go test ./...formatand validation copy.