watermint.org - Takayuki Okazaki's note

CLI (command-line utility) for Google Sheets

I added commands to deal with spreadsheets in watermint toolbox release 85. With these commands, you can export data from Google Sheets as CSV or JSON. Or, update Google Sheet with CSV file from the command line.

The tool runs on multiple platforms without complex dependencies. Just download & extract executable file from the archive. Currently, the tool run on Windows (x86/amd64), Linux (x86), and macOS (amd64).

Exporting data

Google Sheet Export

To retrieve data from Google Sheet, run the following command.

$ tbx services google sheets sheet export -id GOOGLE_SHEET_ID -range SHEET_NAME

If you want to specify output path, please add -data PATH_TO_EXPORT option. Please see more detail about the command at the command manual.

(Sorry for the long command name. Because the tool now has 200+ commands. :-)

Importing data

Google Sheet Import

To import data from CSV, run the following command.

$ tbx services google sheets sheet import -id GOOGLE_SHEET_ID -range SHEET_NAME -data DATA_FILE_PATH

The command changes only cell values. Please see more detail about the command at the command manual.

More commands

The latest release contains a few more commands to deal with Google Sheets.

Note:

The registration to Google is currently verification in progress.

Warning

You may see the warning on the authorization screen. Please verify safety before proceed it.