CLI Complete Guide
This page is a single, end-to-end reference for HolySheets CLI public read mode.
HolySheets CLI supports two equivalent command shapes:
bash
# implicit source (default = google-sheets)
holysheets read <operation> [flags]
# explicit source
holysheets google-sheets read <operation> [flags]Quickstart (Pokemon Public Sheet)
You can test with this public spreadsheet:
- Spreadsheet ID:
1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY - Tabs:
pokemon,moves
bash
holysheets read describe \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet pokemonSupported Operations
find-manyfind-firstfind-uniquefind-lastfind-many-or-throwfind-first-or-throwfind-unique-or-throwfind-last-or-throwdescribe
Common Flags
| Flag | Description | Default |
|---|---|---|
--config <path> | Path to JSON config file | - |
--spreadsheet-id <id> | Google Spreadsheet ID | - |
--sheet <name> | Sheet/tab name | - |
--header-row <number> | Header row index (1-based) | 1 |
--skip-sheet-validation | Skip public sheet-name validation (escape hatch) | false |
--format <json|csv|ndjson> | Output serialization format | json |
--output <path> | Write output to file | stdout |
--pretty | Pretty-print JSON | false |
--select <field> | Include only selected fields (repeatable) | all |
--omit <field> | Exclude fields (repeatable) | none |
Important:
--selectand--omitcannot be used together.--skip-sheet-validationis faster but less safe. With invalid--sheet, Google public endpoints may silently fallback.
Schema
You can pass schema in exactly one source:
--schema-file <path>--schema-json <json-string>- Repeatable schema flags
Supported schema types are:
stringnumberbooleandate
Schema via file
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet moves \
--schema-file ./schema/moves.schema.jsonSchema via JSON string
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet moves \
--schema-json '[{"key":"move_name","type":"string"},{"key":"power","type":"number","nullable":true}]'Schema via explicit blocks
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet moves \
--schema-field move_name --schema-type string \
--schema-field power --schema-type number --schema-nullable \
--schema-field accuracy --schema-type number --schema-nullable \
--schema-field pp --schema-type numberBlock rule:
- Each
--schema-fieldstarts a new block. --schema-type,--schema-nullable,--schema-aliasapply to the latest block.
Where Filters
Supported operators:
equalsnotinnotInltltegtgtecontainsstartsWithendsWithsearch
Single filter
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet pokemon \
--where-field name --where-op contains --where-value saurMultiple filters (AND)
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet moves \
--where-field type --where-op equals --where-value fire \
--where-field power --where-op gte --where-value 80Filter block rule:
- Each
--where-fieldstarts a new block. --where-opand--where-valueapply to the latest block.
Select and Omit
Select
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet pokemon \
--select name \
--select types \
--select attackOmit
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet pokemon \
--omit description \
--omit cry_url \
--omit sprite_urlOutput
--format controls serialization. --output controls destination.
- No
--output: prints to stdout - With
--output: writes to file
JSON to file
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet pokemon \
--format json \
--pretty \
--output ./out/pokemon.jsonCSV export
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet moves \
--format csv \
--output ./out/moves.csvNDJSON export
bash
holysheets read find-many \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet pokemon \
--format ndjson \
--output ./out/pokemon.ndjsonNote:
csvis supported for list operations (find-many/find-many-or-throw).
Describe
describe returns metadata and does not return row data.
bash
holysheets read describe \
--spreadsheet-id 1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY \
--sheet movesFor describe:
--where-*is not allowed--selectis not allowed--omitis not allowed--format csvis not allowed
Config File
Example holysheets.config.json:
json
{
"defaults": {
"spreadsheetId": "1E0NPuF242etl5WaEa1A5W90I2NjY5WSBE_0eSkHrZbY",
"sheet": "pokemon",
"headerRow": 1,
"skipSheetValidation": false,
"format": "json",
"pretty": false
}
}Usage:
bash
holysheets read find-first \
--config ./holysheets.config.json \
--where-field name --where-op equals --where-value pikachuPrecedence:
CLI flags > config.defaults > internal defaults
Error Examples
- Invalid command: unknown operation for
read - Missing required:
--spreadsheet-id,--sheet - Invalid
--where-op - Invalid/partial schema blocks
- Config file not found or invalid JSON
- Schema file not found or invalid JSON
- Invalid
--formatfor operation (for example,describe+csv)