💻CLI

CLI Tool documentation

Overview

Welcome to the Protobox CLI, a powerful command-line tool designed to interact with Protobox, a decentralized storage system. This tool provides essential commands for managing your data on Protobox, including listing contents, downloading files, and uploading local or Amazon S3 data to Protobox. With similarities to AWS CLI, Protobox CLI simplifies the process of migrating your data from Amazon S3 to Protobox. Authentication

Authentication

Before using the CLI, you need to authenticate with Protobox. Run the following command and follow the prompts to enter your authentication details:

python main.py authorize \
        -b your_batch_id \
        -sig your_wallet_signature_on_specific_word \
        -e protobox_url \
        -a yor_application_name

-sig - sig parameter will take the user's signature with sign message "Sign In Protobox" without quotes. The signer should be the batch_id creator

-e - Should be the URL of the s3 gateway, for ex. https://s3.protobox.xyz

Commands

1. List Contents (LS)

Use the ls command to view the contents of your Protobox storage, including buckets, folders, and files.

python main.py ls -b bucket_name -p your_key_prefix 

2. Download file

Download files from Protobox decentralized storage using the download command. Replace <your_bucket_name> and <your_bucket_key> with the path to the file and key respectively.

python main.py download -b your_bucket_name -k your_bucket_key -dst your_destination_folder

3. Upload Local Folder to Protobox

Upload a local folder to Protobox using the upload command. Replace <your_bucket_name> and <your_local_dir> with the local folder path and Protobox destination, respectively.

python main.py upload_folder -b your_bucket_name -dir your_local_dir

4. Upload Amazon S3 Folder or Bucket to Protobox

Migrate data from Amazon S3 to Protobox by uploading a folder or bucket using the upload command. Replace <your_bucket_name> and <your_bucket_key> with the Amazon S3 bucket and key respectively.

python main.py migrate -b your_bucket_name -k your_bucket_key -aws_key_id -aws_secret_key
aws_key_id - isn't mandatory, boto3 can get it from .aws folder
aws_secret_key - isn't mandatory, boto3 can get it from .aws folder

5. Create Bucket on Protobox

Creates new Bucket on Protobox. Replace <your_bucket_name> with the Amazon S3 bucket.

python main.py create_bucket -b your_bucket_name

Last updated