Skip to content

dropbox/dbxcli

Repository files navigation

dbxcli: A command line tool for Dropbox users and team admins [UNOFFICIAL]

CI Go Report Card

⚠️ WARNING: This project is NOT official. What does this mean?

  • There is no formal Dropbox support for this project
  • Bugs may or may not get fixed
  • Not all SDK features may be implemented and implemented features may be buggy or incorrect

Features

  • Supports basic file operations like ls, cp, mkdir, mv, rm (via the Files API)
  • Supports search with sorting and flexible time formatting
  • Supports file revisions and file restore
  • Chunked uploads for large files, paginated listing for large directories
  • Recursive directory uploads (put -r) and downloads (get -r)
  • Retry with exponential backoff for uploads and downloads
  • Supports a growing set of Team operations

Installation

Homebrew (macOS and Linux)

brew install dbxcli

Linux

Download the archive for your architecture, verify its checksum, and install. Replace X.Y.Z with the latest version from the Releases page (without the leading v).

curl -LO https://github.com/dropbox/dbxcli/releases/download/vX.Y.Z/dbxcli_X.Y.Z_linux_amd64.tar.gz
curl -LO https://github.com/dropbox/dbxcli/releases/download/vX.Y.Z/SHA256SUMS
grep 'dbxcli_X.Y.Z_linux_amd64.tar.gz' SHA256SUMS | sha256sum -c -
tar -xzf dbxcli_X.Y.Z_linux_amd64.tar.gz
sudo mv dbxcli_X.Y.Z_linux_amd64/dbxcli /usr/local/bin/

For ARM systems, use linux_arm64 or linux_arm instead of linux_amd64.

macOS (manual)

If you prefer not to use Homebrew:

curl -LO https://github.com/dropbox/dbxcli/releases/download/vX.Y.Z/dbxcli_X.Y.Z_darwin_arm64.tar.gz
curl -LO https://github.com/dropbox/dbxcli/releases/download/vX.Y.Z/SHA256SUMS
grep 'dbxcli_X.Y.Z_darwin_arm64.tar.gz' SHA256SUMS | shasum -a 256 -c -
tar -xzf dbxcli_X.Y.Z_darwin_arm64.tar.gz
sudo mv dbxcli_X.Y.Z_darwin_arm64/dbxcli /usr/local/bin/

Use darwin_amd64 for Intel Macs.

Windows

Download dbxcli_X.Y.Z_windows_amd64.zip from the Releases page, extract it, and add the directory to your PATH.

Release assets

All release archives are available at the releases page:

  • dbxcli_X.Y.Z_darwin_amd64.tar.gz
  • dbxcli_X.Y.Z_darwin_arm64.tar.gz
  • dbxcli_X.Y.Z_linux_amd64.tar.gz
  • dbxcli_X.Y.Z_linux_arm64.tar.gz
  • dbxcli_X.Y.Z_linux_arm.tar.gz
  • dbxcli_X.Y.Z_openbsd_amd64.tar.gz
  • dbxcli_X.Y.Z_windows_amd64.zip
  • SHA256SUMS

Instructions for building yourself

  1. Make sure git and go are installed.
  2. Install the latest released version:
    $ go install github.com/dropbox/dbxcli@latest
  3. Or build from source:
    $ git clone https://github.com/dropbox/dbxcli.git
    $ cd dbxcli
    $ go build .

To use your own Dropbox app while developing, provide its app key when logging in:

$ dbxcli login --app-key=your-app-key

Usage

dbxcli is largely self documenting. Run dbxcli -h for a list of supported commands:

$ dbxcli --help
Use dbxcli to quickly interact with your Dropbox, upload/download files,
manage your team and more. It is easy, scriptable and works on all platforms!

Usage:
  dbxcli [command]

Available Commands:
  account     Display account information
  completion  Generate the autocompletion script for the specified shell
  cp          Copy a file or folder to a different location
  du          Display usage information
  get         Download a file or folder
  login       Log in and save Dropbox credentials
  logout      Log out of the current session
  ls          List files and folders
  mkdir       Create a new directory
  mv          Move files
  put         Upload files or directories
  restore     Restore files
  revs        List file revisions
  rm          Remove files
  search      Search
  share       Sharing commands
  team        Team management commands
  version     Print version information

Flags:
      --as-member string   Member ID to perform action as
  -v, --verbose            Enable verbose logging

Use "dbxcli [command] --help" for more information about a command.

Authentication

By default, dbxcli stores OAuth credentials in ~/.config/dbxcli/auth.json. Run dbxcli login to authorize dbxcli and save credentials:

$ dbxcli login

Commands require saved credentials. If no saved credentials are available, run dbxcli login first or provide a token with DBXCLI_ACCESS_TOKEN.

Personal and team logins use bundled Dropbox app keys by default. You can pass a custom app key as an option:

$ dbxcli login --app-key=your-app-key

You can also set custom app keys with environment variables:

$ DROPBOX_PERSONAL_APP_KEY=your-app-key dbxcli login
$ DROPBOX_TEAM_APP_KEY=your-app-key dbxcli login team-access
$ DROPBOX_MANAGE_APP_KEY=your-app-key dbxcli login team-manage

Saved login credentials include a Dropbox refresh token and are refreshed automatically when the access token expires. If saved credentials are revoked or need to be replaced, run dbxcli login again.

Set DBXCLI_AUTH_FILE to use a different credentials file:

$ DBXCLI_AUTH_FILE=/path/to/auth.json dbxcli login

For automation with short-lived Dropbox access tokens, set DBXCLI_ACCESS_TOKEN. This token is used directly and is not saved or refreshed. If it expires, the command fails and you must provide a fresh token:

$ DBXCLI_ACCESS_TOKEN=sl.xxxxxx dbxcli ls /

Listing files

$ dbxcli ls -l /Photos
Revision              Size    Last modified Path
abc123                1.2 MiB 3 weeks ago   /Photos/vacation.jpg
def456                4.5 MiB 1 month ago   /Photos/family.png

Time format

By default, ls -l, search -l, and revs -l show relative timestamps ("3 weeks ago"). Use --time-format for absolute dates:

$ dbxcli ls -l --time-format=short /Photos
Revision              Size    Last modified    Path
abc123                1.2 MiB 2026-05-15 10:30 /Photos/vacation.jpg

$ dbxcli ls -l --time-format=rfc3339 /Photos
Revision              Size    Last modified        Path
abc123                1.2 MiB 2026-05-15T10:30:00Z /Photos/vacation.jpg

Use --time=client to display client-modified time instead of server-modified (default):

$ dbxcli ls -l --time=client --time-format=short /Photos

Sorting

Sort results with --sort and optionally --reverse:

$ dbxcli ls -l --sort=size /Documents          # smallest first
$ dbxcli ls -l --sort=size --reverse /Documents # largest first
$ dbxcli ls -l --sort=name /Documents           # alphabetical
$ dbxcli ls -l --sort=time /Documents           # oldest first
$ dbxcli ls -l --sort=type /Documents           # folders, files, deleted

Searching

$ dbxcli search -l --time-format=short --sort=size "report"

All --sort, --reverse, --time, and --time-format flags work with both ls and search. The --time and --time-format flags also work with revs -l.

Team management

$ dbxcli team --help
Team management commands

Usage:
  dbxcli team [command]

Available Commands:
  add-member    Add a new member to a team
  info          Get team information
  list-groups   List groups
  list-members  List team members
  remove-member Remove member from a team

Global Flags:
      --as-member string   Member ID to perform action as
  -v, --verbose            Enable verbose logging

Use "dbxcli team [command] --help" for more information about a command.

The --verbose option will turn on verbose logging and is useful for debugging.

Uploading files and directories

$ dbxcli put file.txt /destination/file.txt        # upload a single file
$ dbxcli put -r ./project /backup/project          # recursively upload a directory
$ dbxcli put -r -w 8 ./large-folder /backup/large  # use 8 workers per large file

Downloading files and directories

$ dbxcli get /remote/file.txt ./local-file.txt     # download a single file
$ dbxcli get -r /remote/folder ./local-folder      # recursively download a folder

Piping with stdin/stdout

Use - as the local operand to stream through pipes:

$ printf 'hello' | dbxcli put - /hello.txt         # upload from stdin
$ tar cz ./src | dbxcli put - /backups/src.tgz     # pipe archive to Dropbox
$ dbxcli get /backups/src.tgz - | tar tz           # download to stdout and list
$ dbxcli get /file.txt - > local-copy.txt          # download to stdout, redirect to file

Stdin uploads are spooled to a temp file before uploading, so disk space up to the full input size is required. Stdout downloads are byte-clean: all progress and diagnostic output goes to stderr.

A bare - means stream only when it is the local operand. Dropbox paths named - are valid, for example dbxcli put - /- and dbxcli get /- -. To upload a local file literally named -, use ./-.

Removing files and folders

$ dbxcli rm /remote/file.txt                       # move a file to Dropbox trash
$ dbxcli rm -r /remote/folder                      # remove a non-empty folder
$ dbxcli rm --permanent /remote/file.txt           # permanently delete when Dropbox permits it

Creating directories

$ dbxcli mkdir /projects/2026/reports   # creates all intermediate directories
$ dbxcli mkdir -p /projects/2026/reports # no error if directory already exists

Contributing

Useful Resources

About

A command line client for Dropbox built using the Go SDK

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages