Skip to content

feat(sheets): add chart subcommand (create, list, get, update, delete)#434

Open
andybergon wants to merge 1 commit intosteipete:mainfrom
andybergon:feat/sheets-chart
Open

feat(sheets): add chart subcommand (create, list, get, update, delete)#434
andybergon wants to merge 1 commit intosteipete:mainfrom
andybergon:feat/sheets-chart

Conversation

@andybergon
Copy link
Contributor

Summary

  • Adds sheets chart with list/get/create/update/delete subcommands
  • Charts managed via --spec-json passthrough of EmbeddedChartSpec JSON, keeping scope small while covering all chart types
  • create supports --sheet, --anchor, --width, --height for positioning
  • delete requires --force or interactive confirmation

Examples

# List all charts
gog sheets chart list <spreadsheetId>

# Get full chart definition (spec + position)
gog sheets chart get <spreadsheetId> <chartId> --json

# Backup a chart, delete it, and recreate it
gog sheets chart get <spreadsheetId> 563157883 --json > chart.json
gog sheets chart delete <spreadsheetId> 563157883 --force
gog sheets chart create <spreadsheetId> --spec-json @chart.json

# Create with explicit positioning
gog sheets chart create <spreadsheetId> --spec-json @chart.json --sheet Sheet1 --anchor E10 --width 800 --height 400

# Update a chart's spec (e.g. change title and type)
gog sheets chart update <spreadsheetId> <chartId> --spec-json '{"title":"Revenue Q1","basicChart":{"chartType":"PIE"}}'

Test plan

  • 15 unit tests covering all commands, JSON/text output, anchor positioning, validation, dry-run, and destructive confirmation
  • Manually tested against a real spreadsheet: list, get, delete, create, update all working end-to-end

Closes #432

Adds `sheets chart` with get/list/create/update/delete operations.
Charts are managed via --spec-json passthrough of EmbeddedChartSpec JSON,
keeping scope small while covering all chart types. Create supports
--sheet, --anchor, --width, --height for positioning. Delete requires
--force or interactive confirmation.

Closes steipete#432

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

feat: add sheets chart subcommand (create, list, update, delete)

1 participant