数据库32k · #9161
gws-drive-upload
它能做什么
这个命令可以把你电脑上的文件上传到 Google Drive。它还会自动添加文件的相关信息,比如文件类型和名称。
适用场景
- ✓当你想把重要文档保存到 Google Drive 时。
- ✓当你需要和别人分享文件时。
- ✓当你想把文件整理到 Drive 里的特定文件夹中时。
技能链接
https://github.com/googleworkspace/cli/blob/main/skills/gws-drive-upload/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/googleworkspace/cli/blob/main/skills/gws-drive-upload/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add googleworkspace/cli --skill gws-drive-upload
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/googleworkspace/cli/main/skills/gws-drive-upload/SKILL.md -o SKILL.md
可以这样问 AI
“把文件“my_report.docx”上传到我的 Google Drive。”
每周 5 个新技能,1 分钟读完。
工作原理
你告诉它要上传哪个文件、放到哪里,程序会负责上传并添加相关信息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
drive +upload
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Upload a file with automatic metadata
Usage
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
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 — Global flags and auth
- gws-drive — All manage files, folders, and shared drives commands
常见问题
它是怎么知道文件类型的?
它会看文件名末尾的后缀(比如 .pdf 或 .docx)来判断文件类型。
我可以在 Drive 上给文件换一个名字吗?
可以,使用 '--name' 选项就能指定新的名称。
我可以把文件放进指定的文件夹吗?
可以,使用 '--parent' 选项并填写文件夹的 ID 就行。
详情
热度
- GitHub 星标
- 32k
- 排名
- #9161
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/6
评论
- …