Skip to content

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

@andybergon

Description

@andybergon

Problem

There's no way to insert rows or columns at a specific position in a sheet to shift existing data down/right.

gog sheets append creates new rows but always at the bottom of existing data. gog sheets update writes to existing cells in place without shifting anything. There's no command that pushes existing rows down or columns right to make room.

Use case

When maintaining a sheet sorted by date (newest first), new entries need to go after the header row, not at the bottom. Currently the only option is to append at the bottom and manually re-sort, or orchestrate a read-shift-write cycle externally. Similarly, inserting a new column between existing ones requires manually shifting all data right.

Proposed solution

Add a single insert subcommand:

gog sheets insert <spreadsheetId> <sheet> <rows|cols> <start> [--count N] [--after]

Uses the Sheets API InsertDimensionRequest via batchUpdate. The dimension argument (rows or cols) controls whether rows or columns are inserted. The API already supports this — it's just not exposed in the CLI.

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