Add Google Sheets integration with full CRUD operations#8
Merged
Conversation
Implements Google Sheets integration based on gogcli's sheets functionality: - list: List recent spreadsheets - get: Get values from a range - update: Update values in a range - append: Append values to a range - clear: Clear values in a range - metadata: Get spreadsheet metadata (sheets, properties) - create: Create a new spreadsheet with optional sheet names - copy: Copy a spreadsheet (via Drive API) - export: Export to xlsx/pdf/csv/ods/tsv formats Features: - Supports both simple value format (pipe/comma delimited) and JSON arrays - URL or ID input for spreadsheet identification - OAuth integration with Sheets and Drive APIs - Profile management with auto-detected email naming https://claude.ai/code/session_01LLvpSDsbSSEpfR2jh6g9Nu
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
This PR adds comprehensive Google Sheets support to the CLI, enabling users to manage spreadsheets directly from the command line. The implementation includes OAuth authentication, spreadsheet listing, CRUD operations on cell values, metadata retrieval, and export functionality.
Key Changes
OAuth & Authentication
gsheetsservice to OAuth configuration with appropriate scopes for spreadsheet access, Drive file management, and user email retrievalOAuthServicetype to include'gsheets'New Google Sheets Client
GSheetsClientclass (src/services/gsheets/client.ts) implementing theServiceClientinterfaceget()- retrieve values from ranges with formatting optionsupdate()- replace values,append()- add rowsclear()- clear ranges,metadata()- get spreadsheet structurecreate()- new spreadsheets with optional sheets,copy()- duplicate spreadsheetsexport()- download in multiple formats (xlsx, pdf, csv, ods, tsv)list()- search and filter spreadsheets with Drive query syntaxCLI Commands
gsheets:list- search spreadsheets with Drive query filtersget- retrieve cell values with render optionsupdate- modify cell values with input optionsappend- add rows with insert strategiesclear- clear cell rangesmetadata- view spreadsheet structurecreate- create new spreadsheets with optional sheet namescopy- duplicate spreadsheets to foldersexport- download in various formatsprofile add- authenticate and configure profilesValue Parsing
"a|b,c|d")--values-jsonflagType Definitions
src/types/gsheets.tswith complete type definitions for credentials, operations, and resultsServiceNametype to include'gsheets'Output Formatting
src/utils/output.ts:printGSheetsList()- formatted spreadsheet listingsprintGSheetsMetadata()- spreadsheet structure displayprintGSheetsValues()- tab-separated cell valuesprintGSheetsUpdateResult()- update operation summaryprintGSheetsAppendResult()- append operation summaryprintGSheetsClearResult()- clear operation confirmationprintGSheetsCreated()- creation/copy result displayNotable Implementation Details
!character in A1 notationhttps://claude.ai/code/session_01LLvpSDsbSSEpfR2jh6g9Nu