spreadit
CLI to add csv data to Google Sheet
Synopsis
spreadit {--id|-i} <spreadsheet_id> [--file|-f <file>] [--title|-t <title>] [--range|-r <range>] [--append|-a]
Options
Option |
Shorthand |
Type |
|
Description |
Default |
--id |
-i |
string |
required |
Spreadsheet ID |
|
--file |
-f |
string |
|
CSV file path. If not specified read from stdin |
|
--title |
-t |
string |
|
Sheet title |
"Sheet1" |
--range |
-r |
string |
|
Range to write. |
"A1" |
--append |
-a |
bool |
|
Append data to the end of the sheet |
false |
Examples
# specify csv file
spreadit --file data.csv --id 1X2Y3Z4W5V6U7T8S9R0Q --title 'New Sheet'
# or pipe data
cat data.csv | spreadit --id 1X2Y3Z4W5V6U7T8S9R0Q --title 'New Sheet'
# or redirect into stdin
spreadit --id 1X2Y3Z4W5V6U7T8S9R0Q --title 'New Sheet' < data.csv
Requirements
spreadit
requires the following environment variables to be set:
GOOGLE_APPLICATION_CREDENTIALS
: path to the service account key file
Install
You can install spreadit
using the following command:
go install github.com/haijima/spreadit@latest
or you can download binaries from Releases.
License
This tool is licensed under the MIT License. See the LICENSE
file for details.