Dropbox Lite:无缝云文件管理 - Openclaw Skills
作者:互联网
2026-04-17
什么是 Dropbox Lite?
Dropbox Lite 是一款专门设计的集成工具,旨在弥合 AI 智能体与云存储之间的差距。通过调用 Dropbox API,该技能允许用户直接在其自动化工作流中上传、下载和搜索文件。它是 Openclaw Skills 生态系统的重要组成部分,确保智能体在无需人工干预的情况下,能够持久且安全地访问数据存储。
该技能的突出特点是其自动 OAuth 令牌刷新机制。它通过使用长效刷新令牌获取新的访问令牌,智能地处理令牌过期问题,并即时更新本地配置。这使其成为开发人员构建需要可靠云文件访问的长期运行自主流程的必备工具。
下载入口:https://github.com/openclaw/skills/tree/main/skills/thekie/dropbox-lite
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install dropbox-lite
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 dropbox-lite。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
Dropbox Lite 应用场景
- 同步本地项目资产至云存储,供团队访问。
- 自动获取文档或 PDF 数据集以供 AI 处理。
- 为智能体生成的输出结果创建自动备份程序。
- 搜索并列出远程目录内容,以映射项目结构。
- 使用 Openclaw Skills 在分布式环境中管理共享资源。
- 智能体使用环境配置中存储的应用程序凭据和访问令牌进行身份验证。
- 当发布上传或下载等命令时,该技能会向 Dropbox API v2 发起请求。
- 如果当前访问令牌已过期(通常为 4 小时后),该技能会检测到 401 Unauthorized 错误。
- 该技能会自动使用存储的刷新令牌向 Dropbox 请求新的短效访问令牌。
- 新的访问令牌将写回配置文件,并无缝重试原始请求。
Dropbox Lite 配置指南
要将其与您的 Openclaw Skills 设置集成,请遵循以下步骤:
- 在 Dropbox 开发者门户创建一个分级访问(Scoped Access)应用。
- 启用权限:
files.metadata.read、files.metadata.write、files.content.read、files.content.write和account_info.read。 - 生成带有
token_access_type=offline的授权 URL 以获取刷新令牌。 - 使用 curl 将授权码交换为令牌。
- 将您的凭据保存在
~/.config/atlas/dropbox.env中:
DROPBOX_APP_KEY=your_app_key
DROPBOX_APP_SECRET=your_app_secret
DROPBOX_REFRESH_TOKEN=your_refresh_token
Dropbox Lite 数据架构与分类体系
该技能使用结构化的环境和路径系统来管理配置和文件交互:
| 组件 | 类型 | 描述 |
|---|---|---|
| 配置文件 | .env |
在 ~/.config/atlas/dropbox.env 中存储密钥和令牌 |
| 远程路径 | 字符串 | 以 / 开头的 Dropbox 路径(例如 /Backup/data.zip) |
| 令牌类型 | OAuth2 | 同时支持短效访问令牌和长效刷新令牌 |
所有路径均不区分大小写,并遵循标准的正斜杠约定,以确保在 Openclaw Skills 内的跨平台兼容性。
name: dropbox-lite
description: Upload, download, and manage files in Dropbox with automatic OAuth token refresh.
homepage: https://www.dropbox.com/developers
Dropbox
Upload, download, list, and search files in Dropbox. Supports automatic token refresh.
Required Credentials
| Variable | Required | Description |
|---|---|---|
DROPBOX_APP_KEY |
? Yes | Your Dropbox app key |
DROPBOX_APP_SECRET |
? Yes | Your Dropbox app secret |
DROPBOX_REFRESH_TOKEN |
? Yes | OAuth refresh token (long-lived) |
DROPBOX_ACCESS_TOKEN |
Optional | Short-lived access token (auto-refreshed) |
Store in ~/.config/atlas/dropbox.env:
DROPBOX_APP_KEY=your_app_key
DROPBOX_APP_SECRET=your_app_secret
DROPBOX_REFRESH_TOKEN=xxx...
DROPBOX_ACCESS_TOKEN=sl.u.xxx...
Initial Setup (One-Time)
1. Create a Dropbox App
- Go to https://www.dropbox.com/developers/apps
- Click "Create app"
- Choose "Scoped access"
- Choose "Full Dropbox" (or "App folder" for limited access)
- Name your app
- Note the App key and App secret
2. Set Permissions
In the app settings under "Permissions", enable:
files.metadata.readfiles.metadata.writefiles.content.readfiles.content.writeaccount_info.read
Click "Submit" to save.
3. Run OAuth Flow
Generate the authorization URL:
import urllib.parse
APP_KEY = "your_app_key"
params = {
"client_id": APP_KEY,
"response_type": "code",
"token_access_type": "offline" # This gets you a refresh token!
}
auth_url = "https://www.dropbox.com/oauth2/authorize?" + urllib.parse.urlencode(params)
print(auth_url)
Give the URL to the user. They will:
- Open it in a browser
- Authorize the app
- Receive an authorization code
4. Exchange Code for Tokens
curl -X POST "https://api.dropboxapi.com/oauth2/token" r
-d "code=AUTHORIZATION_CODE" r
-d "grant_type=authorization_code" r
-d "client_id=APP_KEY" r
-d "client_secret=APP_SECRET"
Response includes:
access_token— Short-lived (~4 hours)refresh_token— Long-lived (never expires unless revoked)
Usage
# Account info
dropbox.py account
# List folder
dropbox.py ls "/path/to/folder"
# Search files
dropbox.py search "query"
# Download file
dropbox.py download "/path/to/file.pdf"
# Upload file
dropbox.py upload local_file.pdf "/Dropbox/path/remote_file.pdf"
Token Refresh
The script automatically handles token refresh:
- On 401 Unauthorized, it uses the refresh token to get a new access token
- Updates
dropbox.envwith the new access token - Retries the original request
Token Lifecycle
| Token | Lifetime | Storage |
|---|---|---|
| Access Token | ~4 hours | Updated automatically |
| Refresh Token | Never expires* | Keep secure, don't share |
*Refresh tokens only expire if explicitly revoked or app access is removed.
Troubleshooting
401 Unauthorized on refresh:
- App may have been disconnected — re-run OAuth flow from step 3
403 Forbidden:
- Check app permissions in Dropbox console
Path errors:
- Dropbox paths start with
/and are case-insensitive - Use forward slashes even on Windows
API Reference
- OAuth Guide: https://developers.dropbox.com/oauth-guide
- API Explorer: https://dropbox.github.io/dropbox-api-v2-explorer/
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
阿里云大模型服务平台百炼新人免费额度如何申请?申请与使用免费额度教程及常见问题解答
办公 AI 工具 OpenClaw 部署 Windows 系统一站式教程
Qwen3.6 正式发布!阿里云百炼同步开启“AI大模型节省计划”超值优惠
【新手零难度操作 】OpenClaw 2.6.4 安装误区规避与快速使用指南(包含最新版安装包)
OpenClaw 2.6.4 可视化部署 打造个人 AI 数字员工(包含最新版安装包)
【小白友好!】OpenClaw 2.6.4 本地 AI 智能体快速搭建教程(内有安装包)
零基础部署 OpenClaw v2.6.2,Windows 系统完整教程
【适合新手的】零基础部署 OpenClaw 自动化工具教程
开发者们的第一台自主进化的“爱马仕”来了
极简部署 OpenClaw 2.6.2 本地 AI 智能体快速启用(含最新版安装包)
AI精选
