google-drive

Fetch Google Sheets and Docs content via OAuth-authenticated export API calls.

3|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/OktayCopurlu/ai-shared --skill google-drive-oktaycopurlu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: google-drive
Source: https://github.com/OktayCopurlu/ai-shared/tree/main/.github/workflows/skills/google-drive
Command: npx skills add https://github.com/OktayCopurlu/ai-shared --skill google-drive-oktaycopurlu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Reading Google Sheets and Docs programmatically usually requires setting up a GCP project or an MCP server. This Skill reads spreadsheet and document content directly using locally stored OAuth credentials, with no extra infrastructure. ## Core Features & Use Cases - Spreadsheet Export: Download any Google Sheet tab as CSV by extracting the spreadsheet ID and gid from the share URL. - Document Export: Fetch Google Docs as plain text using the document export endpoint. - Token Refresh: Automatically exchanges the stored refresh token for an access token before each request. - Use Case: A teammate shares a Google Sheets link with experiment results. Paste the link and get the sheet's CSV data immediately for analysis, without downloading it manually. ## Quick Start Read the data from this Google Sheets link and show me the contents as a table.

Frequently Asked Questions about google-drive

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read a Google Sheet as CSV from the command line?▼

Extract the spreadsheet ID and gid from the share URL, then call the export endpoint https://docs.google.com/spreadsheets/d/{ID}/export?format=csv&gid={GID} with an OAuth Bearer token. The response is the sheet's CSV content.

How to export a Google Doc as plain text programmatically?▼

Use the export URL https://docs.google.com/document/d/{DOC_ID}/export?format=txt with an authorized access token in the Authorization header. The document ID comes from the standard /document/d/{DOC_ID}/edit URL.

Do I need a GCP project or MCP server to access Google Drive data?▼

No. This approach uses an existing authorized_user OAuth token stored at ~/.config/google-oauth/token.json. The refresh token is exchanged for an access token on each run, so no GCP project setup or MCP server is required.

Why do I get a 401 or 403 error when fetching a Google Sheet?▼

A 401 means the refresh token has expired and the original OAuth flow must be re-run. A 403 means the authenticated account lacks access to the document, so check the file's sharing permissions for the on-running.com account.

Can this method modify or write to Google Drive files?▼

No. The workflow is strictly read-only and only calls export endpoints to download content. It does not modify spreadsheets, documents, or any other Drive content.