CLI

CLI

Permanently store files on Arweave using Irys' Command Line Interface (CLI).

Prerequisites

To install our CLI, you will need to install a current version of node (opens in a new tab) first.

Installing the CLI

Install our CLI globally using the -g flag. Depending on your setup, you may or may not need to use sudo.

npm i -g @irys/sdk
sudo npm i -g @irys/sdk

Using private keys

When executing CLI commands involving funding nodes or signing transactions, you must provide a private key.

Use the -w flag to specify a private key along with the -t flag to indicate the token you'll use.

irys -w <wallet-file-name> -t <token>

The methods for supplying private keys differ for Ethereum and Solana compared to Arweave.

Ethereum / Solana

For Ethereum and Solana, specify the private key directly in the command line every time you execute a CLI command. Note that the CLI does not store the private key, it needs to be included with each command.

irys fund 1000000000000000 -t ethereum -w bf20......c9885307 -n mainnet

Arweave

When using Arweave, the private key is typically stored in a file (commonly named wallet.json). This file is then referenced in the CLI command, instead of specifying the private key directly.

irys fund 1000000000000000 -t arweave -w wallet.json -n mainnet

Funding

Use the fund command to fund a node.

irys fund 1000000000000000 -n mainnet -t ethereum -w bf20......c9885307

Withdrawing funds

Use the withdraw command to withdraw funds from a node.

irys withdraw 1000000000000000 -n mainnet -t ethereum -w bf20......c9885307

Uploading a file

Use the upload command to upload a file.

irys upload myImage.png -n mainnet -t ethereum -w bf20......c9885307

Uploading a folder

Use the upload-dir command to upload a folder.

irys upload-dir ./myImages -n mainnet -t ethereum -w bf20......c9885307

Using tags

Use the -t option, followed by a series of name / value pairs to append metadata tags to your upload.

Irys supports adding any optional metadata tags to each upload. When uploading files with a filename extension, the related Content-Type (opens in a new tab) (MIME type) tag is automatically added.

irys upload myImage.png -t tagName1 tagValue1 tagName2 tagValue2 -n mainnet -t ethereum -w bf20......c9885307

Pricing

Use the price command, followed by a number of bytes to get the cost to upload that number of bytes. You must also provide a token (-t) and a node URL (-h)

irys price 1000000 -t ethereum -n mainnet