---
id: ssh-gws-drive-upload
name: "gws-drive-upload"
url: https://skills.yangsir.net/skill/ssh-gws-drive-upload
author: googleworkspace
domain: data-ai
tags: ["Google Drive API", "File Upload Automation", "Cloud Storage", "Google Workspace"]
install_count: 7665
rating: 4.50 (307 reviews)
github: https://github.com/googleworkspace/cli
---

# gws-drive-upload

> 用于将文件上传到Google Drive，并自动处理文件元数据，简化文件管理。

**Stats**: 7,665 installs · 4.5/5 (307 reviews)

## Before / After 对比

### Google Drive文件上传与管理自动化：通过自动处理元数据，简化文件处理流程，提升工作效率

## Readme

# 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


---
*Source: https://skills.yangsir.net/skill/ssh-gws-drive-upload*
*Markdown mirror: https://skills.yangsir.net/api/skill/ssh-gws-drive-upload/markdown*