OpenClaw skill that processes receipt/invoice photos from any chat channel, extracts expense data, and logs it to a Google Spreadsheet.
Clawshier supports OCR via:
- OpenAI Vision (default) using
gpt-4o - Ollama (local) using
llama3.2-vision:latest
By default, OCR uses OpenAI:
CLAWSHIER_VISION_PROVIDER=openaiSet CLAWSHIER_VISION_PROVIDER=ollama to use a local Ollama model instead, or auto to try Ollama first and fall back to OpenAI.
- Node.js 18+
- Google Cloud service account with Sheets API enabled
- OpenAI API key for OCR and structuring
- Optional: Ollama running locally with
llama3.2-vision:latest(if using ollama provider)
In your OpenClaw chat:
- Run
/clawhubto make sure ClawHub is configured - Run
/clawhub install clawshier - Ask OpenClaw to verify Clawshier is set up correctly
cd ~/.openclaw/workspace/skills
git clone https://github.com/fdocr/clawshier.git
cd clawshier
npm install
cp .env.example .env # then fill in your keysExample .env:
CLAWSHIER_VISION_PROVIDER=openai
CLAWSHIER_OLLAMA_MODEL=llama3.2-vision:latest
CLAWSHIER_OLLAMA_HOST=http://127.0.0.1:11434
CLAWSHIER_OLLAMA_MAX_DIMENSION=512
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4o
GOOGLE_SHEETS_ID=
GOOGLE_SERVICE_ACCOUNT_KEY=path/to/service-account.jsonProvider modes:
openai— use OpenAI only (default)ollama— use Ollama onlyauto— try Ollama first, fall back to OpenAI
For local Ollama OCR, Clawshier downsizes images on macOS with sips before sending them to the model. Use CLAWSHIER_OLLAMA_MAX_DIMENSION to tune that behavior.
For debugging, you can ask OpenClaw to process a receipt in verbose mode to include the per-step trace in the reply. You can also enable handler-level tracing with CLAWSHIER_TRACE=1.
For automation, prefer the built-in pipeline runner instead of shell-piping untrusted OCR/LLM output between handlers:
node scripts/run_pipeline.js --image /path/to/receipt.jpg --date 2026-03-25The individual handlers still work for testing, and now also support --input-file / --output-file for safer composition.
- Create a Google Cloud service account and download the JSON key file
- Go to Service Accounts in the Google Cloud Console
- Click Create Service Account, give it a name, and click through to finish
- On the service account's Keys tab, click Add Key > Create new key > JSON and save the downloaded file
- Enable the Google Sheets API in your project
- Create an empty spreadsheet and share it with the service account email
- Add the spreadsheet ID and key file path to
.env- Suggestion: Place the JSON file in ~/.openclaw/credentials and use a fully resolved path in the
.envkey instead of the the~shortcut
- Suggestion: Place the JSON file in ~/.openclaw/credentials and use a fully resolved path in the
The skill automatically manages all sheet tabs (monthly expense sheets, Invoice Archive Breakdown, and Summary with chart). The default "Sheet1" tab is deleted on first use.
MIT
