b2-tools
Manage Backblaze B2 Cloud Storage
TLDR
Access your account
List the existing buckets in your account
Create a bucket, provide the bucket name, and access type (e.g. allPublic or allPrivate)
Upload a file. Choose a file, bucket, and a folder
Upload a source directory to a Backblaze B2 bucket destination
Copy a file from one bucket to another bucket
Show the files in your bucket
Remove a "folder" or a set of files matching a pattern
SYNOPSIS
b2 [global-options] <subcommand> [<args>]
PARAMETERS
-h, --help
Show help message and exit
--version
Show program's version and exit
--debug={0,1,2,3}
Set debug verbosity level (0=off, 3=max)
--log-level={debug,info,warning,error,critical}
Set logging level
--application-key-id ID
Override cached key ID for auth
--application-key KEY
Override cached application key
DESCRIPTION
b2-tools installs the b2 command, a versatile Python-based CLI for managing Backblaze B2 object storage. It supports full bucket and file operations: create/delete buckets, upload/download files (including large files via multipart chunking), list contents, delete files/buckets, set lifecycle rules, manage file versions, ACLs, and server-side encryption.
Authentication uses application keys via b2 authorize_account, caching credentials locally for reuse. Ideal for backups, syncing, and automation, it integrates with pipes for streaming, offers progress bars, dry-run modes, threading for parallel transfers, and configurable retries for reliability.
Handles B2-specific features like hide/unhide files, copy within B2, and large-file ID retrieval. Logging levels aid debugging. Cross-platform, but requires Python 3.5+. Widely used in scripts with tools like restic or duplicity.
CAVEATS
Requires prior b2 authorize_account for auth cache.
Rate-limited by B2 API; use --threads wisely.
Not for interactive use; scripting-focused.
INSTALLATION
pip install b2 or apt install b2-tools (Debian/Ubuntu). Requires Python 3.5+.
KEY SUBCOMMANDS
authorize_account, upload_file, download_file, ls, rm, cp, sync, bucket create.
HISTORY
Released by Backblaze in 2016 as open-source CLI. Actively maintained on GitHub/backblaze/b2-cli; evolved from internal tools to support all B2 v2 API features.


