cube-cli

2.1.1 • Public • Published

cube-cli

A CLI client for Cube

Install

> npm i -g cube-cli

Usage

cube init

You will need to use init to initialize your account.

> cube init

You will be prompted for credit card information. Since Cube is currently in test mode, you may just use the Stripe test card info:

  • Card Number: 4242424242424242
  • Expiration: 01/20
  • CVC: 123

cube deposit

Adds funds to your account so you may pay for files.

> cube deposit
> cube deposit --amount=10
> cube deposit -a 10

Options:

  • -a <amount>, --amounts=<amount> - Specify an amount of money to be deposited. If not supplied, a prompt will be given.

cube add <file>...

Adds files (or directories) to IPFS, then pins the ref on Cube.

> cube add file.jpg
> cube add a.jpg b.png
> cube add -r directory/
> cube add --private somefile

When files are pinned to Cube, they will be publicly accessible. Anyone may add credit to a file already pinned on Cube, which will increase the amount of time the data will be stored or the available bandwidth.

Options:

  • -r, --recursive - Add recursively
  • -s <days>, --storage=<days> - The number of days to store the file for. If not specified, the user will be prompted.
  • -b <MB>, --bandwidth=<MB> - The amount of bandwidth to give the file. If not specified, the user will be prompted.
  • -p, --private - Adds credit to refs privately. For more info about private refs, see Private Refs.

cube put <hash>...

Adds credit to an IPFS path or hash.

> cube put QmT5M8bpZeZMPAQXtqJ2hQp3kaEsf6zpz5qm6wvx4Sqh78
> cube put /ipfs/QmPKPZzPQRK62trV4WEnhKVNJ5miDHNz8Hr99h4zoydk7Z/README.md
> cube put /ipns/QmcgPkZSRuqDj3hbmCnf7qrYnZ5WDw4dvwVanMau58Ejob
> cube put --private QmT5M8bpZeZMPAQXtqJ2hQp3kaEsf6zpz5qm6wvx4Sqh78

put is almost identical to add, but uses a hash or path of a file that is already added to IPFS (without requiring to add the file to IPFS again, or to even have the data locally). This can be helpful when adding credit to large files.

Options:

  • -s <days>, --storage=<days> - The number of days to store the file for. If not specified, the user will be prompted.
  • -b <MB>, --bandwidth=<MB> - The amount of bandwidth to give the file. If not specified, the user will be prompted.
  • -p, --private - Adds credit to refs privately. For more info about private refs, see Private Refs.

cube stat <hash>

Shows information about a ref.

> cube stat QmT5M8bpZeZMPAQXtqJ2hQp3kaEsf6zpz5qm6wvx4Sqh78
> cube stat /ipfs/QmPKPZzPQRK62trV4WEnhKVNJ5miDHNz8Hr99h4zoydk7Z/README.md

Options:

  • -sc, --show-credit - Shows the amount of credit that was added to this ref.

cube user

Shows information about the local Cube user account.

> cube user

Private Refs

Sometimes, a ref may be commonly used by the network, e.g. a popular cat picture. When all of its bandwidth credit is consumed it will be inaccessible, which can be disruptive to any website that linked to the picture.

Credit can be added to refs privately, which will add bandwidth to a file that may only be consumed by users that have the private URL (e.g. the owner of a website that wants to ensure the cat picture will be available for his/her own users).

Add private credit using cube add -p <file> or cube put -p <file>. Anyone who has the private access URL returned by these commands will be able to access file file using the private bandwidth credits.

Readme

Keywords

none

Package Sidebar

Install

npm i cube-cli

Weekly Downloads

7

Version

2.1.1

License

MIT

Last publish

Collaborators

  • mappum