Skip to main content
command

gws-drive-upload — Claude Code command: what it does, how to install

Uploads local files to Google Drive using the gws CLI with automatic MIME detection.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command google-workspace/gws-drive-upload
Open on GitHub

What gws-drive-upload does

This command directs Claude Code on executing file uploads to Google Drive via the gws command-line tool. The workflow starts by checking prerequisites: testing gws --version and verifying credentials with gws auth status. If method parameters require validation, it inspects schemas with gws schema before sending data.

The core upload action runs gws drive +upload <file>. It detects the MIME type automatically and retains the original filename unless overridden with --name. Target directories are specified through the --parent flag alongside the folder ID.

Because this is a write operation, the instructions require Claude Code to confirm the action with the user before executing. Without a configured and authenticated gws CLI installation, uploads will fail.

What it helps with

  • Upload local documents and archives to Google Drive from the terminal
  • Target specific Google Drive folders using a parent folder ID
  • Rename files during upload without modifying the local source

Example prompts for the agent

  • Upload ./report.pdf to Google Drive inside folder FOLDER_ID
  • Send ./data.csv to Google Drive with target name Sales Data.csv
  • Verify gws auth status and upload ./archive.tar.gz to Drive

How to install gws-drive-upload

1claude-code-templates

npx claude-code-templates@latest --command google-workspace/gws-drive-upload

2Manually: put the files in place

.claude/commands/gws-drive-upload.md

Call it with /gws-drive-upload. For all projects use ~/.claude/commands/

Questions about gws-drive-upload

How to install gws-drive-upload in Claude Code?

Run npx claude-code-templates@latest --command google-workspace/gws-drive-upload or place the template at .claude/commands/gws-drive-upload.md.

What does gws-drive-upload do?

It guides Claude Code to inspect the gws CLI schema, verify authentication, and upload files to Google Drive with automatic metadata.

What dependencies are required for gws-drive-upload?

You must have the Google Workspace CLI (gws) installed and authenticated via gws auth status.

Source text

gws-drive-upload.md · MIT
---
allowed-tools: Bash, Read, Write, Edit
argument-hint: "[resource] [method] [flags]"
description: "Google Drive: Upload a file with automatic metadata."
---

# Google Workspace Drive Upload

Execute Google Workspace Drive Upload operations: $ARGUMENTS

## Prerequisites

- Google Workspace CLI (`gws`) must be installed
- Authentication configured: Run `gws auth status` to verify
- Review `gws drive-upload --help` for all available commands

## Available Resources and Methods

# drive +upload

> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.

Upload a file with automatic metadata

## Usage

```bash
gws drive +upload <file>
```

## Flags

| Flag | Required | Default | Description |
|------|----------|---------|-------------|
| `<file>` | ✓ | — | Path to file to upload |
| `--parent` | — | — | Parent folder ID |
| `--name` | — | — | Target filename (defaults to source filename) |

## Examples

```bash
gws drive +upload ./report.pdf
gws drive +upload ./report.pdf --parent FOLDER_ID
gws drive +upload ./data.csv --name 'Sales Data.csv'
```

## Tips

- MIME type is detected automatically.
- Filename is inferred from the local path unless --name is given.

> [!CAUTION]
> This is a **write** command — confirm with the user before executing.

## See Also

- [gws-shared](../gws-shared/SKILL.md) — Global flags and auth
- [gws-drive](../gws-drive/SKILL.md) — All manage files, folders, and shared drives commands

## Usage

```bash
# List available resources and methods
gws drive-upload --help

# Inspect method schema before calling
gws schema drive-upload.<resource>.<method>

# Execute command with arguments
gws drive-upload $ARGUMENTS
```

## Task

Execute the requested Drive Upload operation: $ARGUMENTS

1. **Verify Prerequisites**
   - Check `gws` is installed: `gws --version`
   - Verify authentication: `gws auth status`
   - Review available commands: `gws drive-upload --help`

2. **Inspect Method Schema**
   - Before calling any method, inspect its parameters
   - Use `gws schema` to understand required fields
   - Review parameter types and constraints

3. **Execute Operation**
   - Build command with appropriate flags
   - Use `--params` for query/path parameters
   - Use `--json` for request body
   - Handle pagination with `--max-results` or `--page-token`

4. **Error Handling**
   - Check command output for errors
   - Review API quotas and rate limits
   - Handle authentication issues
   - Retry transient failures

---

**License**: Apache License 2.0
**Source**: [Google Workspace CLI](https://github.com/googleworkspace/cli)
**Original Skill**: `gws-drive-upload`

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Notes, tasks and projects →

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor