dbxcli: Dropbox from the command line

dbxcli is a scriptable Dropbox CLI for files, shared links, teams, and
automation workflows. It is built for humans in the terminal, scripts, CI jobs,
and agent-style workflows.
Why use dbxcli?
- Work with Dropbox from the terminal
- Upload and download files, folders, and streams
- Create, inspect, update, revoke, and download shared links
- Use JSON output for scripts and automation
- Pipe generated content directly into Dropbox
- Manage team workflows with member-scoped access
Quickstart
dbxcli login
dbxcli ls /
dbxcli put local.txt /remote.txt
dbxcli get /remote.txt ./remote.txt
dbxcli share-link create /remote.txt
On team accounts where / is not writable, run dbxcli ls / and use a
writable personal or team folder instead.
For automation, use structured command output and JSON help discovery:
dbxcli ls --output=json /
dbxcli --help --output=json
dbxcli put --help --output=json
Stable JSON envelopes, error codes, and process exit codes are documented in
Automation and JSON output.
JSON output
For commands that support structured execution output, --output=json runs the
command and emits stable schema v1 success and error envelopes for automation.
JSON help is the machine-readable command-discovery surface. Use it to discover
command paths, arguments, flags, aliases, input schemas, auth behavior,
stdin/stdout behavior, schema references, and whether structured command
execution output is supported:
dbxcli --help --output=json
dbxcli put --help --output=json
See the
JSON schema v1 docs
for schemas, stability policy, command contracts, and examples.
Common workflows
Upload a file:
dbxcli put report.pdf /Reports/report.pdf
Upload without overwriting:
dbxcli put --if-exists fail report.md /Reports/report.md
Upload from a pipe:
tar cz ./project | dbxcli put - /Backups/project.tgz
Download to stdout:
dbxcli get /Backups/project.tgz - | tar tz
Create a shared link:
dbxcli share-link create /Reports/report.pdf
In text mode, share-link create prints only the shared-link URL to stdout:
url="$(dbxcli share-link create /Reports/report.pdf)"
Troubleshooting
Using an App Folder app
Dropbox apps can use Full Dropbox or App Folder access. For an App Folder
app, pass --app-folder on each command that accesses Dropbox:
dbxcli --app-folder ls /
This disables automatic path-root selection, which Dropbox rejects for App
Folder apps with Path root is not supported for sandbox app. Paths are relative
to the app folder: / lists /Apps/<app-name>/ in Dropbox. Do not prepend
/Apps/<app-name> to paths. The option works with saved login credentials and
DBXCLI_ACCESS_TOKEN. For automation:
export DBXCLI_ACCESS_TOKEN=<token>
export DBXCLI_APP_FOLDER=true
dbxcli ls /
dbxcli put report.pdf /report.pdf
dbxcli get /report.pdf ./report.pdf
DBXCLI_APP_FOLDER accepts Go boolean values such as true, false, 1, and 0.
An explicit --app-folder or --app-folder=false overrides the environment
variable, even if its value is invalid. With neither setting, behavior is unchanged.
Your app must already use App Folder access in the Dropbox App Console; this
setting grants no additional permissions and does not convert a Full Dropbox app.
Why can uploading to /remote.txt fail on team accounts?
Some team accounts may not have a writable Dropbox root namespace. Run
dbxcli ls / first, then upload under a writable folder, such as your personal
folder or a team folder.
Proxy configuration
dbxcli uses Go's standard HTTP proxy behavior, so HTTPS_PROXY,
HTTP_PROXY, and NO_PROXY apply to Dropbox API requests and OAuth token
exchange/refresh requests made by the CLI.
For Dropbox API and OAuth requests, set HTTPS_PROXY:
HTTPS_PROXY=http://127.0.0.1:8080 dbxcli ls /
For a shell session:
export HTTPS_PROXY=http://proxy.company.example:8080
export NO_PROXY=localhost,127.0.0.1,.company.example
dbxcli login
On Windows PowerShell:
$env:HTTPS_PROXY = "http://127.0.0.1:8080"
dbxcli login
On Windows cmd: