CLI tool wrapping all Dropbox Paper SDK operations with local metadata caching and keyword search
Project description
dropbox-paper-cli
A Python CLI tool for managing Dropbox Paper documents from the terminal — browse files, create and edit Paper docs, read as Markdown, and search across your entire workspace with a local metadata cache.
Features
- OAuth2 Authentication — PKCE flow with automatic token refresh
- File Operations — list, create, read, write, move, copy, delete, create folders, get sharing links
- Paper Doc Creation — create new Paper documents from Markdown, HTML, or plain text
- Paper Doc Updates — overwrite, append, prepend, or revision-safe update existing Paper documents
- Paper Doc Export — read Paper documents as Markdown directly in your terminal
- Local Cache & Search — sync your full Dropbox directory tree to a local SQLite database for instant keyword search (FTS5 + CJK fallback)
- Parallel Sync — 20-concurrent-worker pipeline for large workspaces
- Team Account Support — automatic namespace detection for Dropbox Business accounts
- JSON Output —
--jsonflag on all commands for scripting
Installation
Requires Python 3.12+.
# Run directly with uvx (no install needed)
uvx dropbox-paper-cli --help
# Or install with uv (recommended)
uv tool install dropbox-paper-cli
# Or with pip
pip install dropbox-paper-cli
Setup
1. Create a Dropbox App
Go to the Dropbox App Console and create a new app:
- Choose Scoped access
- Choose Full Dropbox access type
- Give it any name you like
Under the Permissions tab, enable:
files.metadata.readfiles.content.readfiles.content.writesharing.readsharing.write
2. Configure Credentials
Use the CLI to set your app credentials:
paper config set --app-key YOUR_APP_KEY
paper config set --app-secret YOUR_APP_SECRET # optional
Or create the config file manually at ~/.config/dropbox-paper-cli/config.json:
{
"app_key": "YOUR_APP_KEY",
"app_secret": "YOUR_APP_SECRET"
}
app_secret is optional — if omitted, the PKCE flow is used (no secret needed, recommended for personal use).
Environment variables DROPBOX_APP_KEY / DROPBOX_APP_SECRET take priority over the config file.
3. Authenticate
paper auth login
Follow the browser prompt to authorize the app.
Quick Start
# 1. Authenticate with Dropbox
paper auth login
# 2. Create a Paper document
echo "# My First Doc" | paper files create /My First Doc.paper
# 3. Read it back as Markdown
paper files read "/My First Doc.paper"
# 4. Sync metadata cache for search
paper cache sync
# 5. Search for documents
paper cache search "meeting notes"
Commands
Authentication
paper auth login # OAuth2 login flow
paper auth logout # Clear stored credentials
paper auth status # Check authentication state
Configuration
paper config set --app-key KEY # Set Dropbox app key
paper config set --app-secret SECRET # Set Dropbox app secret
paper config show # Show current config
paper config path # Show config file path
File Operations
paper files list [PATH] # List files and folders
paper files metadata PATH # Get detailed metadata
paper files read PATH # Read Paper doc as Markdown
paper files create PATH # Create a new Paper document
paper files write PATH # Update a Paper document
paper files link PATH # Get/create sharing link
paper files create-folder PATH # Create a new folder
paper files move SRC DST # Move file or folder
paper files copy SRC DST # Copy file or folder
paper files delete PATH # Delete file or folder
Creating Paper Documents
# From stdin (pipe-friendly)
echo "# Meeting Notes" | paper files create /notes/Meeting.paper
# From a local file
paper files create /notes/Meeting.paper --file notes.md
# HTML format
paper files create /doc.paper --format html --file page.html
Updating Paper Documents
# Overwrite entire content (default)
echo "# Updated" | paper files write /doc.paper
# Append content to end
echo "## Appendix" | paper files write /doc.paper --policy append
# Prepend content to beginning
echo "## Header" | paper files write /doc.paper --policy prepend
# Safe update with revision check (fails if doc changed since given revision)
paper files write /doc.paper --policy update --revision 5 --file new.md
# From a local file with format
paper files write /doc.paper --file content.md --format markdown
Cache & Search
paper cache sync # Incremental sync (default)
paper cache sync --full # Full resync
paper cache sync --path "/subfolder" # Sync specific subtree
paper cache sync --concurrency 10 # Custom worker count
paper cache search QUERY # Search by keyword
paper cache search QUERY --type paper # Filter: paper docs only
paper cache search QUERY --type folder # Filter: folders only
paper cache search QUERY --type file # Filter: regular files only
paper cache search QUERY --limit 20 # Limit results
Sharing
paper sharing info FOLDER_ID_OR_URL # Get sharing info for a shared folder
Global Options
paper --json ... # JSON output for scripting
paper --verbose ... # Diagnostic output to stderr
paper --version # Show version
Data Storage
Follows the XDG Base Directory Specification:
| Purpose | Default Path | Override |
|---|---|---|
| Config (config.json, tokens) | ~/.config/dropbox-paper-cli/ |
PAPER_CLI_CONFIG_DIR |
| Data (cache DB) | ~/.local/share/dropbox-paper-cli/ |
PAPER_CLI_DATA_DIR |
Development
# Clone and install dev dependencies
git clone https://github.com/Koswu/dropbox-paper-cli.git
cd dropbox-paper-cli
uv sync --group dev
# Run tests
uv run pytest
# Lint & format
uv run ruff check src/ tests/
uv run ruff format src/ tests/
# Type check
uv run ty check
# Pre-commit hooks (ruff + ty)
uv run pre-commit install
uv run pre-commit run --all-files
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dropbox_paper_cli-0.2.0.tar.gz.
File metadata
- Download URL: dropbox_paper_cli-0.2.0.tar.gz
- Upload date:
- Size: 153.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24678afb4d20c5b086576527a2bd31370cd490238038c2929a81c88775417961
|
|
| MD5 |
da4fd5d5bc61d671f95ba8714e375915
|
|
| BLAKE2b-256 |
7257d7d59864d3ae74b25a61c0ffc0f4568399c1193087135d447a0e236c50c1
|
Provenance
The following attestation bundles were made for dropbox_paper_cli-0.2.0.tar.gz:
Publisher:
publish.yml on Koswu/dropbox-paper-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dropbox_paper_cli-0.2.0.tar.gz -
Subject digest:
24678afb4d20c5b086576527a2bd31370cd490238038c2929a81c88775417961 - Sigstore transparency entry: 1329284402
- Sigstore integration time:
-
Permalink:
Koswu/dropbox-paper-cli@67a7f19465ffccc6d7af15934ae553b9b81eb3ee -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Koswu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@67a7f19465ffccc6d7af15934ae553b9b81eb3ee -
Trigger Event:
release
-
Statement type:
File details
Details for the file dropbox_paper_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dropbox_paper_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 37.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d41a623033cbf7be1328a55ffef6e462171ee766c477084c5bb1d5a438dcaae
|
|
| MD5 |
0ce547f9cb43c0d0623b672c8abcd9d0
|
|
| BLAKE2b-256 |
a587831bb32424402e673f7967d3760f9ad92e428cb4b9dd19fb3afc7ff80a53
|
Provenance
The following attestation bundles were made for dropbox_paper_cli-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Koswu/dropbox-paper-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dropbox_paper_cli-0.2.0-py3-none-any.whl -
Subject digest:
5d41a623033cbf7be1328a55ffef6e462171ee766c477084c5bb1d5a438dcaae - Sigstore transparency entry: 1329284413
- Sigstore integration time:
-
Permalink:
Koswu/dropbox-paper-cli@67a7f19465ffccc6d7af15934ae553b9b81eb3ee -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Koswu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@67a7f19465ffccc6d7af15934ae553b9b81eb3ee -
Trigger Event:
release
-
Statement type: