Buckit Manager CLI
The Buckit Manager CLI uses the bm command for object storage and
administration commands. It provides a modern alternative to UNIX commands
like ls, cat, cp, mirror, and diff with support for both
filesystems and Amazon S3-compatible cloud storage services.
The bm commandline tool is built for compatibility with the AWS S3 API and is tested with Buckit and AWS S3 for expected functionality and behavior.
Buckit provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While bm commands may work as documented, any such usage is at your own risk.
bm has the following syntax:
bm [GLOBALFLAGS] COMMAND --help
See Command Quick Reference for a list of supported commands.
Version Alignment with Buckit Server
Buckit Manager releases separately from the Buckit Server.
For best functionality and compatibility, use a Buckit Manager version released closely to your Buckit Server version. For example, a Buckit Manager version released the same day or later than your Buckit Server version.
You can install a version of Buckit Manager that is more recent than the
Buckit Server version. However, if the version skews too far from the Buckit
Server version, you may see increased warnings or errors as a result of the
differences.
For example, while core S3 APIs around copying (bm cp) may remain unchanged, some features or flags may only be available or stable if the client and server versions are aligned.
Quickstart
1) Install bm
Install the bm command line tool onto the host machine. Click the tab that corresponds to the host machine operating system or environment:
Install bm with the official Buckit Manager installer:
curl -fsSL https://buckit-io.github.io/bm/install.sh | sh
bm --help
The installer downloads the latest stable build for your operating system and architecture, verifies its SHA-256 checksum, and installs it into your user account.
Install bm with the official Buckit Manager installer:
irm https://buckit-io.github.io/bm/install.ps1 | iex
bm --help
The installer downloads the latest stable build for your operating system and architecture, verifies its SHA-256 checksum, and installs it into your user account.
2) Create an Alias for the S3-Compatible Service
Important
The following example temporarily disables the bash history to mitigate the risk of authentication credentials leaking in plain text. This is a basic security measure and does not mitigate all possible attack vectors. Defer to security best practices for your operating system for inputting sensitive information on the command line.
Use the bm alias set command to add an Amazon S3-compatible service
to the bm configuration.
bash +o history
bm alias set ALIAS HOSTNAME ACCESS_KEY SECRET_KEY
bash -o history
Replace
ALIASwith a name to associate to the S3 service.bmcommands typically requireALIASas an argument for identifying which S3 service to execute against.Replace
HOSTNAMEwith the URL endpoint or IP address of the S3 service.Replace
ACCESS_KEYandSECRET_KEYwith the access and secret keys for a user on the S3 service.
Replace each argument with the required values.
If you omit the ACCESS_KEY and SECRET_KEY, the command prompts you to enter those values in the CLI.
Each of the following tabs contains a provider-specific example:
bm alias set mybuckit https://buckitserver.example.net ACCESS_KEY SECRET_KEY
bm alias set myS3 https://s3.{your-region-code}.amazonaws.com/endpoint ACCESS_KEY SECRET_KEY
bm alias set myGCS https://storage.googleapis.com/endpoint ACCESS_KEY SECRET_KEY
3) Test the Connection
Use the bm admin info command to test the connection to
the newly added Buckit deployment:
bm admin info mybuckit
The command returns information on the S3 service if successful. If unsuccessful, check each of the following:
The host machine has connectivity to the S3 service URL (i.e. using
pingortraceroute).The specified
ACCESSKEYandSECRETKEYcorrespond to a user on the S3 service. The user must have permission to perform actions on the service.For Buckit deployments, see Access Management for more information on user access permissions. For other S3-compatible services, defer to the documentation for that service.
Command Quick Reference
The following table lists bm commands:
Note
Buckit Manager also includes an administration extension for managing Buckit deployments.
See bm admin for more complete documentation.
The below table does not include those commands.
Command |
Description |
|---|---|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The To remove only the contents of a bucket, use |
|
The |
|
The |
|
The |
|
The |
|
Use the |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
|
The |
Configuration File
bm stores aliases and other CLI settings in a JSON configuration
file.
By default, bm uses the following paths:
Linux and macOS:
~/.config/bm/config.jsonWindows:
%APPDATA%\bm\config.json
You can override the configuration directory with the global
--config-dir option or the MC_CONFIG_DIR environment variable.
Certificates
The Buckit Manager CLI stores certificates and CAs for deployments to the following paths:
Linux, macOS, and other Unix-like systems:
~/.config/bm/certs/ # certificates
~/.config/bm/certs/CAs/ # Certificate Authorities
Windows systems:
%APPDATA%\bm\certs\ # certificates
%APPDATA%\bm\certs\CAs\ # Certificate Authorities
When creating a new alias, the Buckit Manager CLI fetches the peer certificate, computes the public key fingerprint, and asks the user whether to accept the deployment’s certificate. If you decide to trust the certificate, the Buckit Manager CLI adds the certificate to the certificate authority path listed above.
Note
In testing environments, you can bypass the certificate check for selected Buckit Manager CLI commands by passing the --insecure flag.
Pattern Matching
Some commands and flags allow for pattern matching. When enabled, a pattern can include either of these wildcards for character replacement:
*to represent a string of characters to match, either in the middle or end.?to represent a single character.
For example, refer to the following examples for wildcard uses and their results.
Pattern |
Text |
Match Result |
|---|---|---|
|
ab |
Match |
|
abd |
Not a match |
|
abcd |
Match |
|
abxxc |
Match |
|
abxc |
Match |
|
abxc |
Match |
|
abc |
Match |
|
abcxdd |
Not a match |
Global Options
All commands support the following global options. You can also define some of these options using Environment Variables.
- --config-dir
The path to a
JSONformatted configuration file that bm uses for storing data. See Configuration File for more information on how bm uses the configuration file.Alternatively, set the environment variable
MC_CONFIG_DIR.
- --debug
Enables verbose output to the console.
For example, the following operation adds verbose output to the
bm lscommand:bm --debug ls play
Alternatively, set the environment variable
MC_DEBUG.
- --insecure
Disables TLS/SSL certificate verification. Allows TLS connectivity to servers with invalid certificates. Exercise caution when using this option against untrusted S3 hosts.
Alternatively, set the environment variable
MC_INSECURE.
- --json
Enables JSON lines formatted output to the console.
For example, the following operation adds JSON Lines output to the
bm lscommand:bm --json ls play
Alternatively, set the environment variable
MC_JSON.
- --no-color
Disables the built-in color theme for console output. Useful for dumb terminals.
Alternatively, set the environment variable
MC_NO_COLOR.
- --quiet
Suppresses console output.
Alternatively, set the environment variable
MC_QUIET.
- --version
Displays the current version of
bm.