Google Sheets
The robomotion googlesheets CLI connects to Google Sheets API for spreadsheet operations. It reads and writes cell ranges, appends rows, manages worksheets, and handles spreadsheet creation and formatting.
When to use
- Read or write cell ranges and individual cells in Google Sheets
- Append rows to spreadsheets
- Create spreadsheets and manage worksheets
Prerequisites
robomotionCLI installed- Package installed:
robomotion install googlesheets - Google Sheets OAuth2 or Service Account credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install googlesheets - Connect with session:
robomotion googlesheets connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion googlesheets get_range --client-id "<client-id>" --spreadsheet-id <id> --range <A1:D10> --session-id "<session-id>" --output json - Disconnect when done:
robomotion googlesheets disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion googlesheets open_spreadsheet --spreadsheet-url --output jsonOpens a Google Spreadsheet by URL and returns its IDrobomotion googlesheets create_spreadsheet --title [--sharewith] --output jsonCreates a new Google Spreadsheetrobomotion googlesheets switch_sheet --spreadsheet-id --sheet-name --output jsonSwitches to a different sheet tab in the spreadsheetrobomotion googlesheets add_sheet --spreadsheet-id --sheet-name --output jsonAdds a new sheet tab to an existing Google Spreadsheetrobomotion googlesheets set_cell_value --spreadsheet-id --cell --cell-value --output jsonSets the value of a single cellrobomotion googlesheets get_cell_value --spreadsheet-id --cell --output jsonGets the value of a single cellrobomotion googlesheets insert_row --spreadsheet-id --start-cell --row --output jsonInserts row data at specified cell or appends to last rowrobomotion googlesheets delete_row --spreadsheet-id --row-number --output jsonDeletes an entire row from the current sheetrobomotion googlesheets insert_column --spreadsheet-id --start-cell --column --output jsonInserts column data starting at specified cellrobomotion googlesheets delete_column --spreadsheet-id --column --output jsonDeletes an entire column from the current sheetrobomotion googlesheets get_row --spreadsheet-id --row-number --output jsonGets all values from a specific rowrobomotion googlesheets get_column --spreadsheet-id --start-cell --output jsonGets all values from a column starting at specified cellrobomotion googlesheets clear_range --spreadsheet-id --start-cell --end-cell --output jsonClears all values from a specified cell range without deleting the cellsrobomotion googlesheets get_range --spreadsheet-id --from-cell --to-cell [--target] --output jsonGets data from a cell range as a tablerobomotion googlesheets set_range --spreadsheet-id --start-cell --end-cell --table --output jsonWrites table data to a cell rangerobomotion googlesheets append_range --spreadsheet-id --table --output jsonAppends table data as new rows at the end of the current sheetrobomotion googlesheets get_sheets --spreadsheet-id --output jsonGets list of all sheet tabs in the spreadsheetrobomotion googlesheets rename_sheet --spreadsheet-id --sheet-name --new-sheet-name --output jsonRenames a sheet tab in the spreadsheetrobomotion googlesheets delete_sheet --spreadsheet-id --sheet-name --output jsonDeletes a sheet tab from the spreadsheetrobomotion googlesheets format_range --spreadsheet-id --from-cell --to-cell [--format] --output jsonApplies number format (Number٫ Date٫ Time٫ Text) to a cell rangerobomotion googlesheets find_replace --spreadsheet-id --from-cell --to-cell --find --replacement [--target] --output jsonFinds and replaces text in a spreadsheet rangerobomotion googlesheets append_sheets --spreadsheet-id-1 --source-sheet-name --spreadsheet-id-2 --append-from-sheet-name --output jsonAppends data from the second sheet to the first sheet (skips header row from second sheet)robomotion googlesheets merge_sheets --spreadsheet-id-1 --first-sheet-name --spreadsheet-id-2 --second-sheet-name --output jsonMerges data from second sheet into first sheet horizontally
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)