Skip to content

Guide · Agent skill

How to export a Google Sheet as CSV with an agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains the Export a Google Sheet as CSV agent skill, which gives an AI agent a step-by-step recipe for saving a Google Sheets spreadsheet as a plain CSV file. It is written for readers who have not used agent skills before. By the end you will know what the skill does, how to install it, what it needs, and how to ask an agent to run it.

Export Google Sheet as CSVgoogleworkspace/cli · Apache-2.0

Quick start

  1. 1Install the gws tool. Install the Google Workspace CLI (gws) and confirm it can access your Google account. The source does not give these steps, so follow the Google Workspace CLI project instructions.
  2. 2Install the companion skills. Make sure the gws-sheets and gws-drive skills are also installed, since this recipe loads them.
  3. 3Download and unzip this skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder.
  4. 4Find the spreadsheet ID. Copy the ID from the spreadsheet's URL, the string between /d/ and the next slash.
  5. 5Ask the agent for a CSV export. Describe the result you want and include the ID, for example a local backup of the sheet as CSV.
  6. 6Check the file. Open the CSV in Excel or another data tool and confirm the values match the sheet.

What the skill makes the agent do

A CSV file is a simple text format that opens in Excel or almost any data tool. This skill tells the agent how to produce one from a Google Sheets spreadsheet, either as a local backup copy or as input for further processing.

The skill is a recipe. It names the Google Workspace command-line tool (gws) commands the agent should run: one to read the spreadsheet's details, one to export the file as CSV, and one to read its values directly in CSV format. It relies on two other skills, gws-sheets and gws-drive, for the underlying Sheets and Drive operations.

Install the Export Google Sheet as CSV skill

Download the ZIP file from this page. The package contains a single file, SKILL.md. Unzip it so the skill folder ends up in one of these locations:

Use ~/.claude/skills/ to make the skill available to Claude Code across your projects, or use a project's .claude/skills/ folder to limit it to that project.

If you use the Claude apps instead, upload the ZIP under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/
  • Project install: the .claude/skills/ folder inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

What you need before it will work

The recipe cannot run without the tools it depends on. The skill's metadata lists the gws command-line tool as a required binary, and the gws-sheets and gws-drive skills as required skills. Your Google account must also have access to the spreadsheet you want to export.

This source does not describe how to install gws or the two companion skills, so check the Google Workspace CLI project for those steps.

  • gws command-line tool (Google Workspace CLI)
  • gws-sheets skill
  • gws-drive skill
  • A Google account with access to the target spreadsheet

The three commands the recipe uses

The recipe gives the agent three options. The first reads the spreadsheet's details, which is useful for confirming the spreadsheet ID and structure before exporting. The second exports the whole file as CSV through the Drive export command. The third reads the cell values directly in CSV format for a named range.

Replace SHEET_ID with the spreadsheet's ID. The ID is the long string in the spreadsheet's URL between /d/ and the next slash.

  • Get details: gws sheets spreadsheets get with a spreadsheetId parameter
  • Export the file: gws drive files export with fileId and mimeType set to text/csv
  • Read values: gws sheets +read with --spreadsheet, --range and --format csv
gws drive files export --params '{"fileId": "SHEET_ID", "mimeType": "text/csv"}'

How to ask the agent to use it

You do not need to name the commands. Describe what you want in plain language and include the spreadsheet ID or a link to the sheet. Examples of requests that fit this skill:

Name the output you want, such as a local backup or a CSV for a script, so the agent picks the matching option.

  • Back up my sales tracker sheet (ID 1AbC...) to a CSV file on my computer.
  • Export the Sheet1 range of this spreadsheet as CSV so I can load it into a Python script.
  • Save a CSV copy of this Google Sheet before I make big changes to it.

Safety notes: scripts and network access

The skill's metadata marks it as running scripts and using the network. In practice, the agent will run gws commands that read your spreadsheet and its metadata from Google over the internet, using your authorised Google account. Only install skills from sources you trust, and check which spreadsheet ID the agent is about to export.

Check the skill's SKILL.md file before installing if you want to see exactly which commands it can run. The source is licensed under Apache-2.0.

  • Runs scripts: yes
  • Uses network: yes
  • Only the spreadsheet your account can access can be exported.

Limits and tips

CSV holds only plain values from one sheet. It does not keep formatting, charts or formulas as formatting, and it is not a full copy of a multi-tab workbook. The file does not say how spreadsheets with several tabs are handled, so test with your own file before relying on the output.

If you want a quick check, ask for the details command first to confirm the ID and sheet names, then ask for the export.

  • Use the range option when you only need one tab or block of cells.
  • Keep the CSV as a dated copy if you use it as a backup.
  • Test on a copy of your spreadsheet first.

What people use it for

  • Keeping a local CSV backup of a shared Google Sheet before major edits.
  • Pulling spreadsheet values into a Python or other script for analysis.
  • Exporting one range of cells as CSV for use in another data tool.
  • Creating a plain-text copy of a sheet for archiving.

Frequently asked questions

Is the Export Google Sheet as CSV skill free?

The source is licensed under Apache-2.0, which covers the skill's code and files. The source does not list prices for the gws tool or other services, so check those separately.

What do I need to use this skill?

You need the gws command-line tool, the gws-sheets and gws-drive skills, and a Google account with access to the spreadsheet. The recipe cannot run without these.

How do I install an agent skill like this one?

Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, you can upload the ZIP under Settings → Capabilities → Skills.

Can it export formatting, charts or multiple tabs?

No. CSV holds only plain values from one sheet, so formatting and charts are not kept. The file does not say how multi-tab spreadsheets are handled, so test with your file first.

What are the alternatives to this skill?

You can export a sheet as CSV by hand from Google Sheets, or run the gws commands yourself without an agent. The source does not compare this skill with other tools.

Why does the agent fail to export my spreadsheet?

Check that gws is installed, that the gws-sheets and gws-drive skills are present, and that your Google account can open the spreadsheet. Confirm the spreadsheet ID is correct before you ask for the export.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits people who want a plain CSV backup of a Google Sheet, analysts feeding data into scripts, and developers who already use the gws tool. It is not suitable if you do not have gws and a Google account with Sheets and Drive access, or if you need formatting, charts or multiple tabs preserved.

Download the skill