Ryan Lisse

Dropbox Manager

开发编程v1.0.0
作者:Ryan Lisse更新于 2026-05-18dropbox@clawhub_ryanlisse/dropbox
脚本工具#Sdk

据 AlphaMoat 统计,截至 2026-09,Dropbox Manager 累计下载 3,929 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 2,632 位,在「开发编程」分类(577 个)中排名第 343 位。

累计安装
123
累计下载
3,929
星标
-
全站排名
#2,632
全站前 52% · 「开发编程」前 60%
平台累计安装累计下载星标评论
ClawHub ↗1233,741--
SkillHub ↗1233,929-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

文档说明通过 Swift CLI 或 MCP 服务器执行 Dropbox 列表、搜索、上传、下载、文本读取和删除操作。配置需要构建 Dropbook 并提供 Dropbox 应用凭据。建议使用 OAuth 和 Keychain 保存;Keychain 不可用时会回退到 ~/.dropbook/auth.json,文档也列出旧式环境变量令牌方案。读取、更改或删除文件前核对账户权限范围及具体路径。

资料发布于 2026-10-29

可以用来做什么

  • 查找或列出 Dropbox 文件
  • 在本地与 Dropbox 之间上传或下载文件
  • 规划文本文件读取或删除操作

什么时候用

  • 用户授权访问相应 Dropbox 内容,且文件读写范围已明确时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

只读列出指定 Dropbox 目录,不要上传、下载或删除文件。
在执行删除前列出目标路径、受影响内容和需要确认的事项。

月度数据趋势

累计下载3,929
2,4003,2214,0422026-03 · 累计下载 2,5132026-05 · 累计下载 3,1092026-07 · 累计下载 3,5612026-08 · 累计下载 3,6892026-09 · 累计下载 3,92926-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,929—-
2026-083,689+3.6%-
2026-073,561—-
2026-053,109—-
2026-032,513—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

10 KB · ClawHub v1.0.0
# Dropbox Manager Skill

Manage Dropbox files via MCP server and CLI. Swift-native implementation using SwiftyDropbox SDK with OAuth 2.0 PKCE and secure Keychain token storage.

## Setup

### Prerequisites

```bash
# Clone and build Dropbook
展开全部(共 412 行)
git clone https://github.com/RyanLisse/Dropbook.git
cd Dropbook
make build
```

### Authentication

#### Option 1: OAuth Login with Keychain (Recommended)

Use the interactive OAuth flow with secure Keychain storage:

```bash
export DROPBOX_APP_KEY="your_dropbox_app_key"
export DROPBOX_APP_SECRET="your_dropbox_app_secret"
make login
# or: swift run dropbook login
```

This will:
1. Generate PKCE code verifier and challenge (SHA256, RFC 7636)
2. Open an authorization URL with state parameter (CSRF protection)
3. Prompt you to paste the authorization code
4. Exchange code for access and refresh tokens
5. **Save tokens to macOS Keychain** (hardware-backed encryption)
6. Fall back to `~/.dropbook/auth.json` if Keychain unavailable
7. Enable automatic token refreshing

**Security Features (RFC 9700 compliant):**
- PKCE with S256 challenge method
- State parameter for CSRF protection
- Keychain storage with `kSecAttrAccessibleWhenUnlocked`
- CryptoKit for cryptographic operations

#### Option 2: Environment Variables (Legacy)

```bash
export DROPBOX_APP_KEY="your_dropbox_app_key"
export DROPBOX_APP_SECRET="your_dropbox_app_secret"
export DROPBOX_ACCESS_TOKEN="your_dropbox_access_token"
```

**Note**: Manual tokens don't support automatic refreshing. Use OAuth login for production use.

### Logout

Clear stored tokens from both Keychain and file storage:

```bash
make logout
# or: swift run dropbook logout
```

## MCP Server (Recommended)

Start the MCP server:

```bash
make mcp
# or: ./.build/debug/dropbook mcp
```

### MCP Tools

| Tool | Description |
|------|-------------|
| `list_directory` | List files and folders in a Dropbox directory |
| `search` | Search for files by name or content |
| `upload` | Upload a file to Dropbox |
| `download` | Download a file from Dropbox |
| `delete` | Delete a file or folder (moves to trash) |
| `get_account_info` | Get account name and email |
| `read_file` | Read contents of a text file |

#### list_directory

List files and folders in a Dropbox directory.

**Parameters:**
- `path` (string, optional): Directory path. Default: "/"

**Response:**
```json
{
  "files": [
    {"type": "file", "name": "doc.pdf", "path": "/Docs/doc.pdf", "size": 1024},
    {"type": "folder", "name": "Projects", "path": "/Projects"}
  ]
}
```

#### search

Search for files by name or content.

**Parameters:**
- `query` (string, required): Search term
- `path` (string, optional): Path to search within. Default: "/"

**Response:**
```json
{
  "count": 2,
  "results": [
    {"matchType": "filename", "metadata": {"name": "report.pdf", "path": "/Docs/report.pdf"}}
  ]
}
```

#### upload

Upload a file to Dropbox.

**Parameters:**
- `localPath` (string, required): Absolute path to local file
- `remotePath` (string, required): Destination in Dropbox
- `overwrite` (boolean, optional): Replace if exists. Default: false

**Response:**
```json
{
  "uploaded": true,
  "name": "file.txt",
  "path": "/Uploads/file.txt",
  "size": 5000
}
```

#### download

Download a file from Dropbox.

**Parameters:**
- `remotePath` (string, required): File path in Dropbox
- `localPath` (string, required): Local destination path

**Response:**
```json
{
  "downloaded": true,
  "to": "/tmp/report.pdf"
}
```

#### delete

Delete a file or folder from Dropbox (moves to trash).

**Parameters:**
- `path` (string, required): Path to delete in Dropbox

**Response:**
```json
{
  "deleted": true,
  "path": "/Docs/old-file.pdf"
}
```

#### get_account_info

Get Dropbox account information.

**Parameters:** None

**Response:**
```json
{
  "name": "Ryan Lisse",
  "email": "[email protected]"
}
```

#### read_file

Read and return the contents of a text file from Dropbox.

**Parameters:**
- `path` (string, required): Path to file in Dropbox

**Response:**
Returns the file contents as text. Only works with UTF-8 encoded text files.

## CLI Commands

```bash
# Authentication
make login                 # OAuth login with Keychain storage
make logout                # Clear stored tokens

# File operations
make list                  # List root directory
swift run dropbook list /path

# Search files
swift run dropbook search "query" [path]

# Upload file
swift run dropbook upload /local/path /remote/path [--overwrite]

# Download file
swift run dropbook download /remote/path /local/path

# Start MCP server
make mcp
```

## MCP Client Configuration

### Claude Code (Project-level)

The project includes a `.mcp.json` file that configures the MCP server:

```json
{
  "mcpServers": {
    "dropbox": {
      "command": "/path/to/Dropbook/.build/debug/dropbook",
      "args": ["mcp"],
      "env": {
        "DROPBOX_APP_KEY": "${DROPBOX_APP_KEY}",
        "DROPBOX_APP_SECRET": "${DROPBOX_APP_SECRET}"
      }
    }
  }
}
```

Enable project MCP servers in Claude Code settings.json:
```json
{
  "enableAllProjectMcpServers": true
}
```

### Claude Desktop

```json
{
  "mcpServers": {
    "dropbox": {
      "command": "/path/to/dropbook/.build/debug/dropbook",
      "args": ["mcp"],
      "env": {
        "DROPBOX_APP_KEY": "${DROPBOX_APP_KEY}",
        "DROPBOX_APP_SECRET": "${DROPBOX_APP_SECRET}"
      }
    }
  }
}
```

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| `notConfigured` | Missing env vars | Set DROPBOX_APP_KEY, DROPBOX_APP_SECRET |
| `invalidArguments` | Missing required params | Check tool parameters |
| `notFound` | Path doesn't exist | Use `list_directory` to verify paths |
| `itemNotFound` | No token in Keychain | Run `make login` to authenticate |

## Architecture

```
Dropbook/
├── Sources/
│   ├── DropbookCore/           # Business logic (actor-based)
│   │   ├── Auth/               # Keychain & file token storage
│   │   ├── Config/             # Configuration management
│   │   ├── Models/             # Domain models
│   │   └── Services/           # DropboxService actor
│   ├── DropbookCLI/            # CLI adapter
│   │   └── Commands/           # Login, logout, file commands
│   └── DropbookMCP/            # MCP server
├── dropbox-skill/              # Skill documentation
├── Makefile                    # Build automation
├── .mcp.json                   # MCP server configuration
└── Package.swift
```

## Bulk Operations with rclone

For large-scale operations like backups, syncing, or bulk transfers, use [rclone](https://rclone.org/) - a powerful cloud sync tool with native Dropbox support.

### Install rclone

```bash
brew install rclone
```

### Configure rclone for Dropbox

```bash
# Interactive setup (opens browser for OAuth)
rclone authorize dropbox

# Save the token output to config
mkdir -p ~/.config/rclone
cat > ~/.config/rclone/rclone.conf << 'EOF'
[dropbox]
type = dropbox
token = {"access_token":"...paste token here..."}
EOF
```

### Backup to Network Drive / Time Capsule

```bash
# Full backup with progress
rclone copy dropbox: /Volumes/TimeCapsule/Dropbox-Backup \
    --progress \
    --transfers 4 \
    --checkers 8 \
    --retries 10 \
    --log-file /tmp/dropbox-backup.log

# Sync (mirror - deletes files not in source)
rclone sync dropbox: /Volumes/Backup/Dropbox --progress

# Check what would be copied (dry run)
rclone copy dropbox: /Volumes/Backup --dry-run
```

### Common rclone Commands

```bash
# List remote contents
rclone lsd dropbox:              # List directories
rclone ls dropbox:               # List all files
rclone size dropbox:             # Calculate total size

# Copy operations
rclone copy dropbox:folder /local/path    # Download folder
rclone copy /local/path dropbox:folder    # Upload folder

# Sync (bidirectional)
rclone bisync dropbox: /local/path --resync

# Mount as filesystem (macOS - requires macFUSE)
rclone mount dropbox: /mnt/dropbox --vfs-cache-mode full
```

### rclone Flags for Reliability

| Flag | Description |
|------|-------------|
| `--progress` | Show real-time transfer progress |
| `--transfers 4` | Number of parallel transfers |
| `--checkers 8` | Number of parallel checkers |
| `--retries 10` | Retry failed operations |
| `--low-level-retries 20` | Retry low-level errors |
| `--log-file path` | Write logs to file |
| `--dry-run` | Show what would be done |
| `--checksum` | Verify with checksums |

### Rate Limiting

Dropbox has strict API rate limits. If you see `too_many_requests` errors:

```bash
# Use bandwidth limiting
rclone copy dropbox: /backup --bwlimit 1M

# Or add delays between operations
rclone copy dropbox: /backup --tpslimit 2
```

rclone handles rate limits automatically with exponential backoff.

## Best Practices

1. **Use OAuth login** - Secure Keychain storage with automatic token refresh
2. **Use MCP for agents** - More reliable for programmatic access
3. **Use rclone for bulk ops** - Better for backups and large transfers
4. **Validate paths first** - Use `list_directory` before operations
5. **Handle errors gracefully** - Check responses for error fields
6. **Respect rate limits** - Add delays between bulk operations
7. **Use absolute paths** - Always provide full paths for file operations

## Security

- **Keychain Storage**: Tokens stored with hardware-backed encryption
- **PKCE**: Proof Key for Code Exchange prevents authorization code interception
- **State Parameter**: CSRF protection for OAuth flow
- **Token Refresh**: Automatic refresh before expiration
- **CryptoKit**: Modern Swift cryptographic library

## Dependencies

- **SwiftyDropbox** (v10.2.4+): Official Dropbox Swift SDK
- **MCP (swift-sdk)**: Model Context Protocol SDK
- **CryptoKit**: Apple's cryptographic framework
- **rclone** (optional): For bulk operations and backups (`brew install rclone`)

## See Also

- [Dropbook GitHub](https://github.com/RyanLisse/Dropbook)
- [CLAUDE.md](../CLAUDE.md) - Full project documentation
- [Dropbox API Docs](https://www.dropbox.com/developers/documentation)
- [rclone Dropbox Docs](https://rclone.org/dropbox/) - Bulk sync and backup
- [RFC 7636 - PKCE](https://datatracker.ietf.org/doc/html/rfc7636)
- [RFC 9700 - OAuth 2.0 Security Best Practices](https://datatracker.ietf.org/doc/html/rfc9700)

「开发编程」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。