Skip to content

mjlyons/dbx-cli

Repository files navigation

dbx-cli

A CLI for uploading files to Dropbox and creating shared view links.

Install

npm install -g @mjlyons/dbx-cli
# or one-off:
npx @mjlyons/dbx-cli <command>

Requires Node.js >= 18.

Authenticate

dbx-cli auth

Opens your browser for Dropbox OAuth. On headless machines, use --manual to paste the code from the terminal.

Usage

Upload and share a file

dbx-cli create-shared-link <file-path>

Outputs a Dropbox shared link URL to stdout.

Options:

  • --audience <value> — Link audience: anyone, team, or invite-only
  • --json — Output structured JSON (url, dropbox_path, file_id)
  • --raw — Output a direct-access URL instead of a preview URL

Log out

dbx-cli logout

Removes stored Dropbox credentials.

Development

Clone and build locally:

git clone git@github.com:mjlyons/dbx-cli.git
cd dbx-cli
npm install
cp .env.example .env      # then fill in DBX_CLI_CLIENT_ID
npm run build
npm link

The build step injects DBX_CLI_CLIENT_ID from .env into the compiled output via scripts/generate-client-id.mjs. Get an app key from the Dropbox App Console — create a "Scoped access" app with files.content.write and sharing.write permissions.

Run tests:

npm test

About

CLI to upload files to Dropbox and create shared links

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors