Backblaze B2 Command Line Tool (b2)

4.6.0 · active · verified Fri Apr 17

The `b2` package provides the official Command Line Tool for Backblaze B2 cloud storage. It allows users to manage files, buckets, and account settings directly from their terminal. The current version is 4.6.0, and it follows a frequent release cadence, often patching fixes and improving compatibility with newer Python versions or underlying SDK changes.

Common errors

Warnings

Install

Imports

Quickstart

First, install the `b2` CLI. Then, authorize your account using your Backblaze B2 Application Key ID and Application Key (which can be obtained from your B2 console). You can pass these as environment variables or directly. After authorization, you can list your buckets and upload files. Replace `$B2_ACCOUNT_ID`, `$B2_APPLICATION_KEY`, `my-bucket-name`, `local-file.txt`, and `remote-file-name.txt` with your actual values.

pip install b2
b2 authorize-account $B2_ACCOUNT_ID $B2_APPLICATION_KEY
b2 bucket list
b2 upload-file my-bucket-name local-file.txt remote-file-name.txt

view raw JSON →