A CLI for uploading files to Dropbox and creating shared view links.
npm install -g @mjlyons/dbx-cli
# or one-off:
npx @mjlyons/dbx-cli <command>Requires Node.js >= 18.
dbx-cli authOpens your browser for Dropbox OAuth. On headless machines, use --manual to paste the code from the terminal.
dbx-cli create-shared-link <file-path>Outputs a Dropbox shared link URL to stdout.
Options:
--audience <value>— Link audience:anyone,team, orinvite-only--json— Output structured JSON (url, dropbox_path, file_id)--raw— Output a direct-access URL instead of a preview URL
dbx-cli logoutRemoves stored Dropbox credentials.
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 linkThe 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