Skip to content

feat(sheets): add insert subcommand for rows and columns#203

Merged
steipete merged 3 commits intoopenclaw:mainfrom
andybergon:feat/sheets-insert-rows
Feb 16, 2026
Merged

feat(sheets): add insert subcommand for rows and columns#203
steipete merged 3 commits intoopenclaw:mainfrom
andybergon:feat/sheets-insert-rows

Conversation

@andybergon
Copy link
Copy Markdown
Contributor

@andybergon andybergon commented Feb 8, 2026

Closes #202

Summary

Adds gog sheets insert <spreadsheetId> <sheet> <rows|cols> <start> [--count N] [--after] to insert empty rows or columns at a specific position in a sheet.

Uses the Sheets API InsertDimensionRequest via batchUpdate, following the same pattern as format and copy-validation-from.

Usage

# Insert 3 empty rows before row 2
gog sheets insert <id> "Sheet1" rows 2 --count 3

# Insert 1 column after column 3
gog sheets insert <id> "Sheet1" cols 3 --after

New flags

Flag Description Default
--count Number of rows/columns to insert 1
--after Insert after the specified position instead of before false

Testing

  • Unit tests with httptest mock server covering rows before/after, cols before/after, and invalid dimension
  • make ci passes (fmt, lint, all tests)

@andybergon andybergon changed the title feat(sheets): add insert-rows subcommand feat(sheets): add insert-rows and insert-cols subcommands Feb 8, 2026
@andybergon andybergon changed the title feat(sheets): add insert-rows and insert-cols subcommands feat(sheets): add insert subcommand for rows and columns Feb 8, 2026
@andybergon andybergon force-pushed the feat/sheets-insert-rows branch 2 times, most recently from ab5b5ed to 3703c20 Compare February 8, 2026 05:20
@andybergon
Copy link
Copy Markdown
Contributor Author

This PR is ready for review.

Note: I squashed and force-pushed — the initial version only had insert-rows, but since the Sheets API InsertDimensionRequest supports both rows and columns via the Dimension field, I consolidated it into a single insert subcommand that handles both with a rows/cols argument.

Adds `gog sheets insert <id> <sheet> <rows|cols> <start>` to insert
empty rows or columns at a specific position using the Sheets API
InsertDimensionRequest via batchUpdate.

Supports --count for multiple rows/columns and --after to insert after
the specified position instead of before.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andybergon andybergon force-pushed the feat/sheets-insert-rows branch from 3703c20 to bbc17b6 Compare February 15, 2026 05:26
andybergon and others added 2 commits February 15, 2026 05:35
Pass context to outfmt.WriteJSON (signature changed upstream) and
use normalizeGoogleID for spreadsheet ID consistency.
@steipete steipete merged commit 039e296 into openclaw:main Feb 16, 2026
4 checks passed
@steipete
Copy link
Copy Markdown
Collaborator

Landed via temp rebase onto main.

Thanks @andybergon!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature(sheets): Insert rows/columns at a specific position

2 participants