# Kubo command-line
Generated on 2024-11-21 17:35:59, from kubo 0.32.1
This document was autogenerated from CLI help text in kubo 0.32.1 (opens new window) For issues and support, check out the generate-cli-docs.sh (opens new window) script on GitHub.
IPFS can run in either online or offline mode. Online mode is when you have IPFS running separately as a daemon process. If you do not have an IPFS daemon running, you are in offline mode. Some commands, like ipfs swarm peers
, are only supported when online.
The command-line quickstart guide explains how to start the IPFS daemon and take your node online.
# Alignment with Kubo RPC API
Every command usable from the CLI is also available through the RPC API v0. For example:
> ipfs swarm peers
/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx
/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z
> curl -X POST http://127.0.0.1:5001/api/v0/swarm/peers
{
"Strings": [
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/ip4/104.236.151.122/tcp/4001/p2p/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx",
"/ip4/104.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
]
}
# ipfs
USAGE
ipfs - Global p2p merkle-dag filesystem.
SYNOPSIS
ipfs [--config=<config> | -c] [--debug | -D] [--help] [-h] [--api=<api>] [--offline] [--cid-base=<base>] [--upgrade-cidv0-in-output] [--encoding=<encoding> | --enc] [--timeout=<timeout>] <command> ...
OPTIONS
--repo-dir string - Path to the repository directory to use.
--config-file string - Path to the configuration file to use.
-c, --config string - [DEPRECATED] Path to the configuration
file to use.
-D, --debug bool - Operate in debug mode.
--help bool - Show the full command help text.
-h bool - Show a short version of the command help
text.
-L, --local bool - Run the command locally, instead of using
the daemon. DEPRECATED: use --offline.
--offline bool - Run the command offline.
--api string - Use a specific API instance (defaults to
/ip4/127.0.0.1/tcp/5001).
--api-auth string - Optional RPC API authorization secret
(defined as AuthSecret in
API.Authorizations config).
--cid-base string - Multibase encoding used for version 1
CIDs in output.
--upgrade-cidv0-in-output bool - Upgrade version 0 to version 1 CIDs in
output.
--enc, --encoding string - The encoding type the output should be
encoded with (json, xml, or text).
Default: text.
--stream-channels bool - Stream channel output.
--timeout string - Set a global timeout on the command.
SUBCOMMANDS
BASIC COMMANDS
init Initialize local IPFS configuration
add <path> Add a file to IPFS
cat <ref> Show IPFS object data
get <ref> Download IPFS objects
ls <ref> List links from an object
refs <ref> List hashes of links from an object
DATA STRUCTURE COMMANDS
dag Interact with IPLD DAG nodes
files Interact with files as if they were a unix filesystem
block Interact with raw blocks in the datastore
TEXT ENCODING COMMANDS
cid Convert and discover properties of CIDs
multibase Encode and decode data with Multibase format
ADVANCED COMMANDS
daemon Start a long-running daemon process
shutdown Shut down the daemon process
resolve Resolve any type of content path
name Publish and resolve IPNS names
key Create and list IPNS name keypairs
pin Pin objects to local storage
repo Manipulate the IPFS repository
stats Various operational stats
p2p Libp2p stream mounting (experimental)
filestore Manage the filestore (experimental)
mount Mount an IPFS read-only mount point (experimental)
NETWORK COMMANDS
id Show info about IPFS peers
bootstrap Add or remove bootstrap peers
swarm Manage connections to the p2p network
dht Query the DHT for values or peers
routing Issue routing commands
ping Measure the latency of a connection
bitswap Inspect bitswap state
pubsub Send and receive messages via pubsub
TOOL COMMANDS
config Manage configuration
version Show IPFS version information
diag Generate diagnostic reports
update Download and apply go-ipfs updates
commands List all available commands
log Manage and show logs of running daemon
Use 'ipfs <command> --help' to learn more about each command.
ipfs uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
environment variable:
export IPFS_PATH=/path/to/ipfsrepo
EXIT STATUS
The CLI will exit with one of the following values:
0 Successful execution.
1 Failed executions.
For more information about each command, use:
'ipfs <subcmd> --help'
# ipfs add
USAGE
ipfs add <path>... - Add a file or directory to IPFS.
SYNOPSIS
ipfs add [--recursive | -r] [--dereference-args] [--stdin-name=<stdin-name>]
[--hidden | -H] [--ignore=<ignore>]...
[--ignore-rules-path=<ignore-rules-path>] [--quiet | -q]
[--quieter | -Q] [--silent] [--progress | -p] [--trickle | -t]
[--only-hash | -n] [--wrap-with-directory | -w]
[--chunker=<chunker> | -s] [--raw-leaves] [--nocopy] [--fscache]
[--cid-version=<cid-version>] [--hash=<hash>] [--inline]
[--inline-limit=<inline-limit>] [--pin=false] [--to-files=<to-files>]
[--preserve-mode] [--preserve-mtime] [--mode=<mode>]
[--mtime=<mtime>] [--mtime-nsecs=<mtime-nsecs>] [--] <path>...
ARGUMENTS
<path>... - The path to a file to be added to IPFS.
OPTIONS
-r, --recursive bool - Add directory paths recursively.
--dereference-args bool - Symlinks supplied in arguments are
dereferenced.
--stdin-name string - Assign a name if the file source is stdin.
-H, --hidden bool - Include files that are hidden. Only takes
effect on recursive add.
--ignore array - A rule (.gitignore-stype) defining which
file(s) should be ignored (variadic,
experimental).
--ignore-rules-path string - A path to a file with .gitignore-style
ignore rules (experimental).
-q, --quiet bool - Write minimal output.
-Q, --quieter bool - Write only final hash.
--silent bool - Write no output.
-p, --progress bool - Stream progress data.
-t, --trickle bool - Use trickle-dag format for dag generation.
-n, --only-hash bool - Only chunk and hash - do not write to
disk.
-w, --wrap-with-directory bool - Wrap files with a directory object.
-s, --chunker string - Chunking algorithm, size-[bytes],
rabin-[min]-[avg]-[max] or buzhash.
--raw-leaves bool - Use raw blocks for leaf nodes.
--nocopy bool - Add the file using filestore. Implies
raw-leaves. (experimental).
--fscache bool - Check the filestore for pre-existing
blocks. (experimental).
--cid-version int - CID version. Defaults to 0 unless an
option that depends on CIDv1 is passed.
Passing version 1 will cause the
raw-leaves option to default to true.
--hash string - Hash function to use. Implies CIDv1 if
not sha2-256. (experimental).
--inline bool - Inline small blocks into CIDs.
(experimental).
--inline-limit int - Maximum block size to inline.
(experimental). Default: 32.
--pin bool - Pin locally to protect added files from
garbage collection. Default: true.
--to-files string - Add reference to Files API (MFS) at the
provided path.
--preserve-mode bool - Apply existing POSIX permissions to
created UnixFS entries. Disables
raw-leaves. (experimental).
--preserve-mtime bool - Apply existing POSIX modification time to
created UnixFS entries. Disables
raw-leaves. (experimental).
--mode uint - Custom POSIX file mode to store in
created UnixFS entries. Disables
raw-leaves. (experimental).
--mtime int64 - Custom POSIX modification time to store
in created UnixFS entries (seconds before
or after the Unix Epoch). Disables
raw-leaves. (experimental).
--mtime-nsecs uint - Custom POSIX modification time (optional
time fraction in nanoseconds).
DESCRIPTION
Adds the content of <path> to IPFS. Use -r to add directories.
Note that directories are added recursively, to form the IPFS
MerkleDAG.
If the daemon is not running, it will just add locally.
If the daemon is started later, it will be advertised after a few
seconds when the reprovider runs.
The wrap option, '-w', wraps the file (or files, if using the
recursive option) in a directory. This directory contains only
the files which have been added, and means that the file retains
its filename. For example:
> ipfs add example.jpg
added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH example.jpg
> ipfs add example.jpg -w
added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH example.jpg
added QmaG4FuMqEBnQNn3C8XJ5bpW8kLs7zq2ZXgHptJHbKDDVx
You can now refer to the added file in a gateway, like so:
/ipfs/QmaG4FuMqEBnQNn3C8XJ5bpW8kLs7zq2ZXgHptJHbKDDVx/example.jpg
Files imported with 'ipfs add' are protected from GC (implicit '--pin=true'),
but it is up to you to remember the returned CID to get the data back later.
Passing '--to-files' creates a reference in Files API (MFS), making it easier
to find it in the future:
> ipfs files mkdir -p /myfs/dir
> ipfs add example.jpg --to-files /myfs/dir/
> ipfs files ls /myfs/dir/
example.jpg
See 'ipfs files --help' to learn more about using MFS
for keeping track of added files and directories.
The chunker option, '-s', specifies the chunking strategy that dictates
how to break files into blocks. Blocks with same content can
be deduplicated. Different chunking strategies will produce different
hashes for the same file. The default is a fixed block size of
256 * 1024 bytes, 'size-262144'. Alternatively, you can use the
Buzhash or Rabin fingerprint chunker for content defined chunking by
specifying buzhash or rabin-[min]-[avg]-[max] (where min/avg/max refer
to the desired chunk sizes in bytes), e.g. 'rabin-262144-524288-1048576'.
The following examples use very small byte sizes to demonstrate the
properties of the different chunkers on a small file. You'll likely
want to use a 1024 times larger chunk sizes for most files.
> ipfs add --chunker=size-2048 ipfs-logo.svg
added QmafrLBfzRLV4XSH1XcaMMeaXEUhDJjmtDfsYU95TrWG87 ipfs-logo.svg
> ipfs add --chunker=rabin-512-1024-2048 ipfs-logo.svg
added Qmf1hDN65tR55Ubh2RN1FPxr69xq3giVBz1KApsresY8Gn ipfs-logo.svg
You can now check what blocks have been created by:
> ipfs object links QmafrLBfzRLV4XSH1XcaMMeaXEUhDJjmtDfsYU95TrWG87
QmY6yj1GsermExDXoosVE3aSPxdMNYr6aKuw3nA8LoWPRS 2059
Qmf7ZQeSxq2fJVJbCmgTrLLVN9tDR9Wy5k75DxQKuz5Gyt 1195
> ipfs object links Qmf1hDN65tR55Ubh2RN1FPxr69xq3giVBz1KApsresY8Gn
QmY6yj1GsermExDXoosVE3aSPxdMNYr6aKuw3nA8LoWPRS 2059
QmerURi9k4XzKCaaPbsK6BL5pMEjF7PGphjDvkkjDtsVf3 868
QmQB28iwSriSUSMqG2nXDTLtdPHgWb4rebBrU7Q1j4vxPv 338
Finally, a note on hash (CID) determinism and 'ipfs add' command.
Almost all the flags provided by this command will change the final CID, and
new flags may be added in the future. It is not guaranteed for the implicit
defaults of 'ipfs add' to remain the same in future Kubo releases, or for other
IPFS software to use the same import parameters as Kubo.
If you need to back up or transport content-addressed data using a non-IPFS
medium, CID can be preserved with CAR files.
See 'dag export' and 'dag import' for more information.
# ipfs bitswap
USAGE
ipfs bitswap - Interact with the bitswap agent.
SYNOPSIS
ipfs bitswap
SUBCOMMANDS
ipfs bitswap ledger <peer> - Show the current ledger for a peer.
ipfs bitswap reprovide - Trigger reprovider.
ipfs bitswap stat - Show some diagnostic information on the bitswap
agent.
ipfs bitswap wantlist - Show blocks currently on the wantlist.
For more information about each command, use:
'ipfs bitswap <subcmd> --help'
# ipfs bitswap ledger
USAGE
ipfs bitswap ledger <peer> - Show the current ledger for a peer.
SYNOPSIS
ipfs bitswap ledger [--] <peer>
ARGUMENTS
<peer> - The PeerID (B58) of the ledger to inspect.
DESCRIPTION
The Bitswap decision engine tracks the number of bytes exchanged between IPFS
nodes, and stores this information as a collection of ledgers. This command
prints the ledger associated with a given peer.
# ipfs bitswap reprovide
USAGE
ipfs bitswap reprovide - Trigger reprovider.
SYNOPSIS
ipfs bitswap reprovide
DESCRIPTION
Trigger reprovider to announce our data to network.
# ipfs bitswap stat
USAGE
ipfs bitswap stat - Show some diagnostic information on the bitswap agent.
SYNOPSIS
ipfs bitswap stat [--verbose | -v] [--human]
OPTIONS
-v, --verbose bool - Print extra information.
--human bool - Print sizes in human readable format (e.g., 1K 234M 2G).
# ipfs bitswap wantlist
USAGE
ipfs bitswap wantlist - Show blocks currently on the wantlist.
SYNOPSIS
ipfs bitswap wantlist [--peer=<peer> | -p]
OPTIONS
-p, --peer string - Specify which peer to show wantlist for. Default: self.
DESCRIPTION
Print out all blocks currently on the bitswap wantlist for the local peer.
# ipfs block
USAGE
ipfs block - Interact with raw IPFS blocks.
SYNOPSIS
ipfs block
DESCRIPTION
'ipfs block' is a plumbing command used to manipulate raw IPFS blocks.
Reads from stdin or writes to stdout. A block is identified by a Multihash
passed with a valid CID.
SUBCOMMANDS
ipfs block get <cid> - Get a raw IPFS block.
ipfs block put <data>... - Store input as an IPFS block.
ipfs block rm <cid>... - Remove IPFS block(s) from the local datastore.
ipfs block stat <cid> - Print information of a raw IPFS block.
For more information about each command, use:
'ipfs block <subcmd> --help'
# ipfs block get
USAGE
ipfs block get <cid> - Get a raw IPFS block.
SYNOPSIS
ipfs block get [--] <cid>
ARGUMENTS
<cid> - The CID of an existing block to get.
DESCRIPTION
'ipfs block get' is a plumbing command for retrieving raw IPFS blocks.
It takes a <cid>, and outputs the block to stdout.
# ipfs block put
USAGE
ipfs block put <data>... - Store input as an IPFS block.
SYNOPSIS
ipfs block put [--cid-codec=<cid-codec>] [--mhtype=<mhtype>] [--mhlen=<mhlen>]
[--pin] [--allow-big-block] [--format=<format> | -f] [--]
<data>...
ARGUMENTS
<data>... - The data to be stored as an IPFS block.
OPTIONS
--cid-codec string - Multicodec to use in returned CID. Default: raw.
--mhtype string - Multihash hash function.
--mhlen int - Multihash hash length. Default: -1.
--pin bool - Pin added blocks recursively. Default: false.
--allow-big-block bool - Disable block size check and allow creation of
blocks bigger than 1MiB. WARNING: such blocks
won't be transferable over the standard bitswap.
Default: false.
-f, --format string - Use legacy format for returned CID (DEPRECATED).
DESCRIPTION
'ipfs block put' is a plumbing command for storing raw IPFS blocks.
It reads data from stdin, and outputs the block's CID to stdout.
Unless cid-codec is specified, this command returns raw (0x55) CIDv1 CIDs.
Passing alternative --cid-codec does not modify imported data, nor run any
validation. It is provided solely for convenience for users who create blocks
in userland.
NOTE:
Do not use --format for any new code. It got superseded by --cid-codec and left
only for backward compatibility when a legacy CIDv0 is required (--format=v0).
# ipfs block rm
USAGE
ipfs block rm <cid>... - Remove IPFS block(s) from the local datastore.
SYNOPSIS
ipfs block rm [--force | -f] [--quiet | -q] [--] <cid>...
ARGUMENTS
<cid>... - CIDs of block(s) to remove.
OPTIONS
-f, --force bool - Ignore nonexistent blocks.
-q, --quiet bool - Write minimal output.
DESCRIPTION
'ipfs block rm' is a plumbing command for removing raw ipfs blocks.
It takes a list of CIDs to remove from the local datastore..
# ipfs block stat
USAGE
ipfs block stat <cid> - Print information of a raw IPFS block.
SYNOPSIS
ipfs block stat [--] <cid>
ARGUMENTS
<cid> - The CID of an existing block to stat.
DESCRIPTION
'ipfs block stat' is a plumbing command for retrieving information
on raw IPFS blocks. It outputs the following to stdout:
Key - the CID of the block
Size - the size of the block in bytes
# ipfs bootstrap
USAGE
ipfs bootstrap - Show or edit the list of bootstrap peers.
SYNOPSIS
ipfs bootstrap
DESCRIPTION
Running 'ipfs bootstrap' with no arguments will run 'ipfs bootstrap list'.
SECURITY WARNING:
The bootstrap command manipulates the "bootstrap list", which contains
the addresses of bootstrap nodes. These are the *trusted peers* from
which to learn about other peers in the network. Only edit this list
if you understand the risks of adding or removing nodes from this list.
SUBCOMMANDS
ipfs bootstrap add [<peer>]... - Add peers to the bootstrap list.
ipfs bootstrap list - Show peers in the bootstrap list.
ipfs bootstrap rm [<peer>]... - Remove peers from the bootstrap list.
For more information about each command, use:
'ipfs bootstrap <subcmd> --help'
# ipfs bootstrap add
USAGE
ipfs bootstrap add [<peer>]... - Add peers to the bootstrap list.
SYNOPSIS
ipfs bootstrap add [--default] [--] [<peer>...]
ARGUMENTS
[<peer>]... - A peer to add to the bootstrap list (in the format
'<multiaddr>/<peerID>')
OPTIONS
--default bool - Add default bootstrap nodes. (Deprecated, use 'default'
subcommand instead).
DESCRIPTION
Outputs a list of peers that were added (that weren't already
in the bootstrap list).
SECURITY WARNING:
The bootstrap command manipulates the "bootstrap list", which contains
the addresses of bootstrap nodes. These are the *trusted peers* from
which to learn about other peers in the network. Only edit this list
if you understand the risks of adding or removing nodes from this list.
SUBCOMMANDS
ipfs bootstrap add default - Add default peers to the bootstrap list.
For more information about each command, use:
'ipfs bootstrap add <subcmd> --help'
# ipfs bootstrap add default
USAGE
ipfs bootstrap add default - Add default peers to the bootstrap list.
SYNOPSIS
ipfs bootstrap add default
DESCRIPTION
Outputs a list of peers that were added (that weren't already
in the bootstrap list).
# ipfs bootstrap list
USAGE
ipfs bootstrap list - Show peers in the bootstrap list.
SYNOPSIS
ipfs bootstrap list
DESCRIPTION
Peers are output in the format '<multiaddr>/<peerID>'.
# ipfs bootstrap rm
USAGE
ipfs bootstrap rm [<peer>]... - Remove peers from the bootstrap list.
SYNOPSIS
ipfs bootstrap rm [--all] [--] [<peer>...]
ARGUMENTS
[<peer>]... - A peer to add to the bootstrap list (in the format
'<multiaddr>/<peerID>')
OPTIONS
--all bool - Remove all bootstrap peers. (Deprecated, use 'all' subcommand).
DESCRIPTION
Outputs the list of peers that were removed.
SECURITY WARNING:
The bootstrap command manipulates the "bootstrap list", which contains
the addresses of bootstrap nodes. These are the *trusted peers* from
which to learn about other peers in the network. Only edit this list
if you understand the risks of adding or removing nodes from this list.
SUBCOMMANDS
ipfs bootstrap rm all - Remove all peers from the bootstrap list.
For more information about each command, use:
'ipfs bootstrap rm <subcmd> --help'
# ipfs bootstrap rm all
USAGE
ipfs bootstrap rm all - Remove all peers from the bootstrap list.
SYNOPSIS
ipfs bootstrap rm all
DESCRIPTION
Outputs the list of peers that were removed.
# ipfs cat
USAGE
ipfs cat <ipfs-path>... - Show IPFS object data.
SYNOPSIS
ipfs cat [--offset=<offset> | -o] [--length=<length> | -l] [--progress=false]
[--] <ipfs-path>...
ARGUMENTS
<ipfs-path>... - The path to the IPFS object(s) to be outputted.
OPTIONS
-o, --offset int64 - Byte offset to begin reading from.
-l, --length int64 - Maximum number of bytes to read.
-p, --progress bool - Stream progress data. Default: true.
DESCRIPTION
Displays the data contained by an IPFS or IPNS object(s) at the given path.
# ipfs cid
USAGE
ipfs cid - Convert and discover properties of CIDs
SYNOPSIS
ipfs cid
SUBCOMMANDS
ipfs cid base32 <cid>... - Convert CIDs to Base32 CID version 1.
ipfs cid bases - List available multibase encodings.
ipfs cid codecs - List available CID multicodecs.
ipfs cid format <cid>... - Format and convert a CID in various useful ways.
ipfs cid hashes - List available multihashes.
For more information about each command, use:
'ipfs cid <subcmd> --help'
# ipfs cid base32
USAGE
ipfs cid base32 <cid>... - Convert CIDs to Base32 CID version 1.
SYNOPSIS
ipfs cid base32 [--] <cid>...
ARGUMENTS
<cid>... - CIDs to convert.
DESCRIPTION
'ipfs cid base32' normalizes passed CIDs to their canonical case-insensitive encoding.
Useful when processing third-party CIDs which could come with arbitrary formats.
# ipfs cid bases
USAGE
ipfs cid bases - List available multibase encodings.
SYNOPSIS
ipfs cid bases [--prefix] [--numeric]
OPTIONS
--prefix bool - also include the single letter prefixes in addition to the
code.
--numeric bool - also include numeric codes.
DESCRIPTION
'ipfs cid bases' relies on https://github.com/multiformats/go-multibase
# ipfs cid codecs
USAGE
ipfs cid codecs - List available CID multicodecs.
SYNOPSIS
ipfs cid codecs [--numeric | -n] [--supported | -s]
OPTIONS
-n, --numeric bool - also include numeric codes.
-s, --supported bool - list only codecs supported by go-ipfs commands.
DESCRIPTION
'ipfs cid codecs' relies on https://github.com/multiformats/go-multicodec
# ipfs cid format
USAGE
ipfs cid format <cid>... - Format and convert a CID in various useful ways.
SYNOPSIS
ipfs cid format [-f=<f>] [-v=<v>] [--mc=<mc>] [-b=<b>] [--] <cid>...
ARGUMENTS
<cid>... - CIDs to format.
OPTIONS
-f string - Printf style format string. Default: %s.
-v string - CID version to convert to.
--mc string - CID multicodec to convert to.
-b string - Multibase to display CID in.
DESCRIPTION
Format and converts <cid>'s in various useful ways.
The optional format string is a printf style format string:
%% literal %
%b multibase name
%B multibase code
%v version string
%V version number
%c codec name
%C codec code
%h multihash name
%H multihash code
%L hash digest length
%m multihash encoded in base %b (with multibase prefix)
%M multihash encoded in base %b without multibase prefix
%d hash digest encoded in base %b (with multibase prefix)
%D hash digest encoded in base %b without multibase prefix
%s cid string encoded in base %b (1)
%S cid string encoded in base %b without multibase prefix
%P cid prefix: %v-%c-%h-%L
(1) For CID version 0 the multibase must be base58btc and no prefix is
used. For Cid version 1 the multibase prefix is included.
# ipfs cid hashes
USAGE
ipfs cid hashes - List available multihashes.
SYNOPSIS
ipfs cid hashes [--numeric | -n] [--supported | -s]
OPTIONS
-n, --numeric bool - also include numeric codes.
-s, --supported bool - list only codecs supported by go-ipfs commands.
DESCRIPTION
'ipfs cid hashes' relies on https://github.com/multiformats/go-multihash
# ipfs commands
USAGE
ipfs commands - List all available commands.
SYNOPSIS
ipfs commands [--flags | -f]
OPTIONS
-f, --flags bool - Show command flags.
DESCRIPTION
Lists all available commands (and subcommands) and exits.
SUBCOMMANDS
ipfs commands completion - Generate shell completions.
For more information about each command, use:
'ipfs commands <subcmd> --help'
# ipfs commands completion
USAGE
ipfs commands completion - Generate shell completions.
SYNOPSIS
ipfs commands completion
SUBCOMMANDS
ipfs commands completion bash - Generate bash shell completions.
ipfs commands completion fish - Generate fish shell completions.
ipfs commands completion zsh - Generate zsh shell completions.
For more information about each command, use:
'ipfs commands completion <subcmd> --help'
# ipfs commands completion bash
USAGE
ipfs commands completion bash - Generate bash shell completions.
SYNOPSIS
ipfs commands completion bash
DESCRIPTION
Generates command completions for the bash shell.
The simplest way to see it working is write the completions
to a file and then source it:
> ipfs commands completion bash > ipfs-completion.bash
> source ./ipfs-completion.bash
To install the completions permanently, they can be moved to
/etc/bash_completion.d or sourced from your ~/.bashrc file.
# ipfs commands completion fish
USAGE
ipfs commands completion fish - Generate fish shell completions.
SYNOPSIS
ipfs commands completion fish
DESCRIPTION
Generates command completions for the fish shell.
The simplest way to see it working is write the completions
to a file and then source it:
> ipfs commands completion fish > ipfs-completion.fish
> source ./ipfs-completion.fish
To install the completions permanently, they can be moved to
/etc/fish/completions or ~/.config/fish/completions or sourced from your ~/.config/fish/config.fish file.
# ipfs commands completion zsh
USAGE
ipfs commands completion zsh - Generate zsh shell completions.
SYNOPSIS
ipfs commands completion zsh
DESCRIPTION
Generates command completions for the zsh shell.
The simplest way to see it working is write the completions
to a file and then source it:
> ipfs commands completion zsh > ipfs-completion.zsh
> source ./ipfs-completion.zsh
To install the completions permanently, they can be moved to
/etc/zsh/completions or sourced from your ~/.zshrc file.
# ipfs config
USAGE
ipfs config <key> [<value>] - Get and set IPFS config values.
SYNOPSIS
ipfs config [--bool] [--json] [--] <key> [<value>]
ARGUMENTS
<key> - The key of the config entry (e.g. "Addresses.API").
[<value>] - The value to set the config entry to.
OPTIONS
--bool bool - Set a boolean value.
--json bool - Parse stringified JSON.
DESCRIPTION
'ipfs config' controls configuration variables. It works
much like 'git config'. The configuration values are stored in a config
file inside your IPFS repository (IPFS_PATH).
Examples:
Get the value of the 'Datastore.Path' key:
$ ipfs config Datastore.Path
Set the value of the 'Datastore.Path' key:
$ ipfs config Datastore.Path ~/.ipfs/datastore
SUBCOMMANDS
ipfs config edit - Open the config file for editing in $EDITOR.
ipfs config profile - Apply profiles to config.
ipfs config replace <file> - Replace the config with <file>.
ipfs config show - Output config file contents.
For more information about each command, use:
'ipfs config <subcmd> --help'
# ipfs config edit
USAGE
ipfs config edit - Open the config file for editing in $EDITOR.
SYNOPSIS
ipfs config edit
DESCRIPTION
To use 'ipfs config edit', you must have the $EDITOR environment
variable set to your preferred text editor.
# ipfs config profile
USAGE
ipfs config profile - Apply profiles to config.
SYNOPSIS
ipfs config profile
DESCRIPTION
Available profiles:
'server':
Disables local host discovery, recommended when
running IPFS on machines with public IPv4 addresses.
'default-networking':
Restores default network settings.
Inverse profile of the test profile.
'lowpower':
Reduces daemon overhead on the system. May affect node
functionality - performance of content discovery and data
fetching may be degraded.
'announce-on':
Re-enables Reprovide system (reverts announce-off profile).
'randomports':
Use a random port number for swarm.
'badgerds':
Configures the node to use the legacy badgerv1 datastore.
NOTE: this is badger 1.x, which has known bugs and is no longer supported by the upstream team.
It is provided here only for pre-existing users, allowing them to migrate away to more modern datastore.
Other caveats:
* This datastore will not properly reclaim space when your datastore is
smaller than several gigabytes. If you run IPFS with --enable-gc, you plan
on storing very little data in your IPFS node, and disk usage is more
critical than performance, consider using flatfs.
* This datastore uses up to several gigabytes of memory.
* Good for medium-size datastores, but may run into performance issues
if your dataset is bigger than a terabyte.
See configuration documentation at:
https://github.com/ipfs/kubo/blob/master/docs/datastores.md#badgerds
NOTE: This profile may only be applied when first initializing node at IPFS_PATH
via 'ipfs init --profile badgerds'
'announce-off':
Disables Reprovide system (and announcing to Amino DHT).
USE WITH CAUTION:
The main use case for this is setups with manual Peering.Peers config.
Data from this node will not be announced on the DHT. This will make
DHT-based routing an data retrieval impossible if this node is the only
one hosting it, and other peers are not already connected to it.
'flatfs':
Configures the node to use the flatfs datastore.
This is the most battle-tested and reliable datastore.
You should use this datastore if:
* You need a very simple and very reliable datastore, and you trust your
filesystem. This datastore stores each block as a separate file in the
underlying filesystem so it's unlikely to loose data unless there's an issue
with the underlying file system.
* You need to run garbage collection in a way that reclaims free space as soon as possible.
* You want to minimize memory usage.
* You are ok with the default speed of data import, or prefer to use --nocopy.
See configuration documentation at:
https://github.com/ipfs/kubo/blob/master/docs/datastores.md#flatfs
NOTE: This profile may only be applied when first initializing node at IPFS_PATH
via 'ipfs init --profile flatfs'
'pebbleds':
Configures the node to use the pebble high-performance datastore.
Pebble is a LevelDB/RocksDB inspired key-value store focused on performance
and internal usage by CockroachDB.
You should use this datastore if:
- You need a datastore that is focused on performance.
- You need reliability by default, but may choose to disable WAL for maximum performance when reliability is not critical.
- This datastore is good for multi-terabyte data sets.
- May benefit from tuning depending on read/write patterns and throughput.
- Performance is helped significantly by running on a system with plenty of memory.
See configuration documentation at:
https://github.com/ipfs/kubo/blob/master/docs/datastores.md#pebbleds
NOTE: This profile may only be applied when first initializing node at IPFS_PATH
via 'ipfs init --profile pebbleds'
'legacy-cid-v0':
Makes UnixFS import produce legacy CIDv0 with no raw leaves, sha2-256 and 256 KiB chunks.
'test-cid-v1':
Makes UnixFS import produce modern CIDv1 with raw leaves, sha2-256 and 1 MiB chunks.
'local-discovery':
Sets default values to fields affected by the server
profile, enables discovery in local networks.
'test':
Reduces external interference of IPFS daemon, this
is useful when using the daemon in test environments.
'default-datastore':
Configures the node to use the default datastore (flatfs).
Read the "flatfs" profile description for more information on this datastore.
This profile may only be applied when first initializing the node.
SUBCOMMANDS
ipfs config profile apply <profile> - Apply profile to config.
For more information about each command, use:
'ipfs config profile <subcmd> --help'
# ipfs config profile apply
USAGE
ipfs config profile apply <profile> - Apply profile to config.
SYNOPSIS
ipfs config profile apply [--dry-run] [--] <profile>
ARGUMENTS
<profile> - The profile to apply to the config.
OPTIONS
--dry-run bool - print difference between the current config and the config
that would be generated.
# ipfs config replace
USAGE
ipfs config replace <file> - Replace the config with <file>.
SYNOPSIS
ipfs config replace [--] <file>
ARGUMENTS
<file> - The file to use as the new config.
DESCRIPTION
Make sure to back up the config file first if necessary, as this operation
can't be undone.
# ipfs config show
USAGE
ipfs config show - Output config file contents.
SYNOPSIS
ipfs config show
DESCRIPTION
NOTE: For security reasons, this command will omit your private key and remote services. If you would like to make a full backup of your config (private key included), you must copy the config file from your repo.
# ipfs daemon
USAGE
ipfs daemon - Run a network-connected IPFS node.
SYNOPSIS
ipfs daemon [--init] [--init-config=<init-config>]
[--init-profile=<init-profile>] [--routing=<routing>] [--mount]
[--mount-ipfs=<mount-ipfs>] [--mount-ipns=<mount-ipns>]
[--unrestricted-api] [--disable-transport-encryption]
[--enable-gc] [--manage-fdlimit=false] [--migrate]
[--enable-pubsub-experiment] [--enable-namesys-pubsub]
[--enable-mplex-experiment]
[--agent-version-suffix=<agent-version-suffix>]
OPTIONS
--init bool - Initialize Kubo with default
settings if not already initialized.
--init-config string - Path to existing configuration file
to be loaded during --init.
--init-profile string - Configuration profiles to apply for
--init. See ipfs init --help for
more.
--routing string - Overrides the routing option.
Default: default.
--mount bool - Mounts IPFS to the filesystem using
FUSE (experimental).
--mount-ipfs string - Path to the mountpoint for IPFS (if
using --mount). Defaults to config
setting.
--mount-ipns string - Path to the mountpoint for IPNS (if
using --mount). Defaults to config
setting.
--unrestricted-api bool - Allow RPC API access to unlisted
hashes.
--disable-transport-encryption bool - Disable transport encryption (for
debugging protocols).
--enable-gc bool - Enable automatic periodic repo
garbage collection.
--manage-fdlimit bool - Check and raise file descriptor
limits if needed. Default: true.
--migrate bool - If true, assume yes at the migrate
prompt. If false, assume no.
--enable-pubsub-experiment bool - DEPRECATED.
--enable-namesys-pubsub bool - Enable IPNS over pubsub. Implicitly
enables pubsub, overrides
Ipns.UsePubsub config.
--enable-mplex-experiment bool - DEPRECATED.
--agent-version-suffix string - Optional suffix to the AgentVersion
presented by `ipfs id` and exposed
via libp2p identify protocol.
DESCRIPTION
The Kubo daemon will start listening on ports on the network, which are
documented in (and can be modified through) 'ipfs config Addresses'.
For example, to change the 'Gateway' port:
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8082
The RPC API address can be changed the same way:
ipfs config Addresses.API /ip4/127.0.0.1/tcp/5002
Make sure to restart the daemon after changing addresses.
By default, the gateway is only accessible locally. To expose it to
other computers in the network, use 0.0.0.0 as the ip address:
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
Be careful if you expose the RPC API. It is a security risk, as anyone could
control your node remotely. If you need to control the node remotely,
make sure to protect the port as you would other services or database
(firewall, authenticated proxy, etc), or at least set API.Authorizations.
If you do not want to open any ports for RPC, and only want to use
kubo CLI client, it is possible to expose the RPC over Unix socket:
ipfs config Addresses.API /unix/var/run/kubo.socket
HTTP Headers
Kubo supports passing arbitrary headers to the RPC API and Gateway. You can
do this by setting headers on the API.HTTPHeaders and Gateway.HTTPHeaders
keys:
ipfs config --json API.HTTPHeaders.X-Special-Header "[\"so special :)\"]"
ipfs config --json Gateway.HTTPHeaders.X-Special-Header "[\"so special :)\"]"
Note that the value of the keys is an _array_ of strings. This is because
headers can have more than one value, and it is convenient to pass through
to other libraries.
CORS Headers (for RPC API)
You can setup CORS headers the same way:
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"example.com\"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "[\"PUT\", \"GET\", \"POST\"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "[\"true\"]"
Shutdown
To shut down the daemon, send a SIGINT signal to it (e.g. by pressing 'Ctrl-C')
or send a SIGTERM signal to it (e.g. with 'kill'). It may take a while for the
daemon to shutdown gracefully, but it can be killed forcibly by sending a
second signal.
IPFS_PATH environment variable
Kubo uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
environment variable:
export IPFS_PATH=/path/to/ipfsrepo
DEPRECATION NOTICE
Previously, Kubo used an environment variable as seen below:
export API_ORIGIN="http://localhost:8888/"
This is deprecated. It is still honored in this version, but will be removed
in a future version, along with this notice. Please move to setting the HTTP
Headers.
# ipfs dag
USAGE
ipfs dag - Interact with IPLD DAG objects.
SYNOPSIS
ipfs dag
DESCRIPTION
'ipfs dag' is used for creating and manipulating DAG objects/hierarchies.
This subcommand is intended to deprecate and replace
the existing 'ipfs object' command moving forward.
SUBCOMMANDS
ipfs dag export <root> - Streams the selected DAG as a .car stream on
stdout.
ipfs dag get <ref> - Get a DAG node from IPFS.
ipfs dag import <path>... - Import the contents of .car files
ipfs dag put <object data>... - Add a DAG node to IPFS.
ipfs dag resolve <ref> - Resolve IPLD block.
ipfs dag stat <root>... - Gets stats for a DAG.
For more information about each command, use:
'ipfs dag <subcmd> --help'
# ipfs dag export
USAGE
ipfs dag export <root> - Streams the selected DAG as a .car stream on stdout.
SYNOPSIS
ipfs dag export [--progress | -p] [--] <root>
ARGUMENTS
<root> - CID of a root to recursively export
OPTIONS
-p, --progress bool - Display progress on CLI. Defaults to true when STDERR
is a TTY.
DESCRIPTION
'ipfs dag export' fetches a DAG and streams it out as a well-formed .car file.
Note that at present only single root selections / .car files are supported.
The output of blocks happens in strict DAG-traversal, first-seen, order.
CAR file follows the CARv1 format: https://ipld.io/specs/transport/car/carv1/
# ipfs dag get
USAGE
ipfs dag get <ref> - Get a DAG node from IPFS.
SYNOPSIS
ipfs dag get [--output-codec=<output-codec>] [--] <ref>
ARGUMENTS
<ref> - The object to get
OPTIONS
--output-codec string - Format that the object will be encoded as. Default:
dag-json.
DESCRIPTION
'ipfs dag get' fetches a DAG node from IPFS and prints it out in the specified
format.
# ipfs dag import
USAGE
ipfs dag import <path>... - Import the contents of .car files
SYNOPSIS
ipfs dag import [--pin-roots=false] [--silent] [--stats] [--allow-big-block]
[--] <path>...
ARGUMENTS
<path>... - The path of a .car file.
OPTIONS
--pin-roots bool - Pin optional roots listed in the .car headers after
importing. Default: true.
--silent bool - No output.
--stats bool - Output stats.
--allow-big-block bool - Disable block size check and allow creation of
blocks bigger than 1MiB. WARNING: such blocks won't
be transferable over the standard bitswap. Default:
false.
DESCRIPTION
'ipfs dag import' imports all blocks present in supplied .car
( Content Address aRchive ) files, recursively pinning any roots
specified in the CAR file headers, unless --pin-roots is set to false.
Note:
This command will import all blocks in the CAR file, not just those
reachable from the specified roots. However, these other blocks will
not be pinned and may be garbage collected later.
The pinning of the roots happens after all car files are processed,
permitting import of DAGs spanning multiple files.
Pinning takes place in offline-mode exclusively, one root at a time.
If the combination of blocks from the imported CAR files and what is
currently present in the blockstore does not represent a complete DAG,
pinning of that individual root will fail.
Maximum supported CAR version: 2
Specification of CAR formats: https://ipld.io/specs/transport/car/
# ipfs dag put
USAGE
ipfs dag put <object data>... - Add a DAG node to IPFS.
SYNOPSIS
ipfs dag put [--store-codec=<store-codec>] [--input-codec=<input-codec>]
[--pin] [--hash=<hash>] [--allow-big-block] [--] <object data>...
ARGUMENTS
<object data>... - The object to put
OPTIONS
--store-codec string - Codec that the stored object will be encoded
with. Default: dag-cbor.
--input-codec string - Codec that the input object is encoded in.
Default: dag-json.
--pin bool - Pin this object when adding.
--hash string - Hash function to use.
--allow-big-block bool - Disable block size check and allow creation of
blocks bigger than 1MiB. WARNING: such blocks
won't be transferable over the standard bitswap.
Default: false.
DESCRIPTION
'ipfs dag put' accepts input from a file or stdin and parses it
into an object of the specified format.
# ipfs dag resolve
USAGE
ipfs dag resolve <ref> - Resolve IPLD block.
SYNOPSIS
ipfs dag resolve [--] <ref>
ARGUMENTS
<ref> - The path to resolve
DESCRIPTION
'ipfs dag resolve' fetches a DAG node from IPFS, prints its address and remaining path.
# ipfs dag stat
USAGE
ipfs dag stat <root>... - Gets stats for a DAG.
SYNOPSIS
ipfs dag stat [--progress=false] [--] <root>...
ARGUMENTS
<root>... - CID of a DAG root to get statistics for
OPTIONS
-p, --progress bool - Return progressive data while reading through the DAG.
Default: true.
DESCRIPTION
'ipfs dag stat' fetches a DAG and returns various statistics about it.
Statistics include size and number of blocks.
Note: This command skips duplicate blocks in reporting both size and the number of blocks
# ipfs dht
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs dht - Issue commands directly through the DHT.
SYNOPSIS
ipfs dht
DEPRECATED SUBCOMMANDS
ipfs dht query <peerID>... - Find the closest Peer IDs to a given Peer ID by
querying the DHT.
REMOVED SUBCOMMANDS
ipfs dht findpeer - Removed, use 'ipfs routing' instead.
ipfs dht findprovs - Removed, use 'ipfs routing' instead.
ipfs dht get - Removed, use 'ipfs routing' instead.
ipfs dht provide - Removed, use 'ipfs routing' instead.
ipfs dht put - Removed, use 'ipfs routing' instead.
# ipfs dht findpeer
WARNING: REMOVED, command is no longer available
USAGE
ipfs dht findpeer - Removed, use 'ipfs routing' instead.
SYNOPSIS
ipfs dht findpeer
# ipfs dht findprovs
WARNING: REMOVED, command is no longer available
USAGE
ipfs dht findprovs - Removed, use 'ipfs routing' instead.
SYNOPSIS
ipfs dht findprovs
# ipfs dht get
WARNING: REMOVED, command is no longer available
USAGE
ipfs dht get - Removed, use 'ipfs routing' instead.
SYNOPSIS
ipfs dht get
# ipfs dht provide
WARNING: REMOVED, command is no longer available
USAGE
ipfs dht provide - Removed, use 'ipfs routing' instead.
SYNOPSIS
ipfs dht provide
# ipfs dht put
WARNING: REMOVED, command is no longer available
USAGE
ipfs dht put - Removed, use 'ipfs routing' instead.
SYNOPSIS
ipfs dht put
# ipfs dht query
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs dht query <peerID>... - Find the closest Peer IDs to a given Peer ID by
querying the DHT.
SYNOPSIS
ipfs dht query [--verbose | -v] [--] <peerID>...
ARGUMENTS
<peerID>... - The peerID to run the query against.
OPTIONS
-v, --verbose bool - Print extra information.
DESCRIPTION
Outputs a list of newline-delimited Peer IDs.
# ipfs diag
USAGE
ipfs diag - Generate diagnostic reports.
SYNOPSIS
ipfs diag
SUBCOMMANDS
ipfs diag cmds - List commands run on this IPFS node.
ipfs diag profile - Collect a performance profile for debugging.
ipfs diag sys - Print system diagnostic information.
For more information about each command, use:
'ipfs diag <subcmd> --help'
# ipfs diag cmds
USAGE
ipfs diag cmds - List commands run on this IPFS node.
SYNOPSIS
ipfs diag cmds [--verbose | -v]
OPTIONS
-v, --verbose bool - Print extra information.
DESCRIPTION
Lists running and recently run commands.
SUBCOMMANDS
ipfs diag cmds clear - Clear inactive requests from the log.
ipfs diag cmds set-time <time> - Set how long to keep inactive requests in
the log.
For more information about each command, use:
'ipfs diag cmds <subcmd> --help'
# ipfs diag cmds clear
USAGE
ipfs diag cmds clear - Clear inactive requests from the log.
SYNOPSIS
ipfs diag cmds clear
# ipfs diag cmds set-time
USAGE
ipfs diag cmds set-time <time> - Set how long to keep inactive requests in
the log.
SYNOPSIS
ipfs diag cmds set-time [--] <time>
ARGUMENTS
<time> - Time to keep inactive requests in log.
# ipfs diag profile
USAGE
ipfs diag profile - Collect a performance profile for debugging.
SYNOPSIS
ipfs diag profile [--output=<output> | -o] [--collectors=<collectors>]...
[--profile-time=<profile-time>]
[--mutex-profile-fraction=<mutex-profile-fraction>]
[--block-profile-rate=<block-profile-rate>]
OPTIONS
-o, --output string - The path where the output .zip should be
stored. Default:
./ipfs-profile-[timestamp].zip.
--collectors array - The list of collectors to use for
collecting diagnostic data. Default:
[goroutines-stack goroutines-pprof version
heap allocs bin cpu mutex block trace].
--profile-time string - The amount of time spent profiling. If
this is set to 0, then sampling profiles
are skipped. Default: 30s.
--mutex-profile-fraction int - The fraction 1/n of mutex contention
events that are reported in the mutex
profile. Default: 4.
--block-profile-rate string - The duration to wait between sampling
goroutine-blocking events for the blocking
profile. Default: 1ms.
DESCRIPTION
Collects profiles from a running go-ipfs daemon into a single zipfile.
To aid in debugging, this command also attempts to include a copy of
the running go-ipfs binary.
Profiles can be examined using 'go tool pprof', some tips can be found at
https://github.com/ipfs/kubo/blob/master/docs/debug-guide.md.
Privacy Notice:
The output file includes:
- A list of running goroutines.
- A CPU profile.
- A heap inuse profile.
- A heap allocation profile.
- A mutex profile.
- A block profile.
- Your copy of go-ipfs.
- The output of 'ipfs version --all'.
It does not include:
- Any of your IPFS data or metadata.
- Your config or private key.
- Your IP address.
- The contents of your computer's memory, filesystem, etc.
However, it could reveal:
- Your build path, if you built go-ipfs yourself.
- If and how a command/feature is being used (inferred from running functions).
- Memory offsets of various data structures.
- Any modifications you've made to go-ipfs.
# ipfs diag sys
USAGE
ipfs diag sys - Print system diagnostic information.
SYNOPSIS
ipfs diag sys
DESCRIPTION
Prints out information about your computer to aid in easier debugging.
# ipfs files
USAGE
ipfs files - Interact with unixfs files.
SYNOPSIS
ipfs files [--flush=false]
OPTIONS
-f, --flush bool - Flush target and ancestors after write. Default: true.
DESCRIPTION
Files is an API for manipulating IPFS objects as if they were a Unix
filesystem.
The files facility interacts with MFS (Mutable File System). MFS acts as a
single, dynamic filesystem mount. MFS has a root CID that is transparently
updated when a change happens (and can be checked with "ipfs files stat /").
All files and folders within MFS are respected and will not be deleted
during garbage collections. However, a DAG may be referenced in MFS without
being fully available locally (MFS content is lazy loaded when accessed).
MFS is independent from the list of pinned items ("ipfs pin ls"). Calls to
"ipfs pin add" and "ipfs pin rm" will add and remove pins independently of
MFS. If MFS content that was additionally pinned is removed by calling
"ipfs files rm", it will still remain pinned.
Content added with "ipfs add" (which by default also becomes pinned), is not
added to MFS. Any content can be lazily referenced from MFS with the command
"ipfs files cp /ipfs/<cid> /some/path/" (see ipfs files cp --help).
NOTE:
Most of the subcommands of 'ipfs files' accept the '--flush' flag. It defaults
to true. Use caution when setting this flag to false. It will improve
performance for large numbers of file operations, but it does so at the cost
of consistency guarantees. If the daemon is unexpectedly killed before running
'ipfs files flush' on the files in question, then data may be lost. This also
applies to run 'ipfs repo gc' concurrently with '--flush=false'
operations.
SUBCOMMANDS
ipfs files chcid [<path>] - Change the CID version or hash function of
the root node of a given path.
ipfs files cp <source> <dest> - Add references to IPFS files and directories
in MFS (or copy within MFS).
ipfs files flush [<path>] - Flush a given path's data to disk.
ipfs files ls [<path>] - List directories in the local mutable
namespace.
ipfs files mkdir <path> - Make directories.
ipfs files mv <source> <dest> - Move files.
ipfs files read <path> - Read a file from MFS.
ipfs files rm <path>... - Remove a file from MFS.
ipfs files stat <path> - Display file status.
ipfs files write <path> <data> - Append to (modify) a file in MFS.
For more information about each command, use:
'ipfs files <subcmd> --help'
EXPERIMENTAL SUBCOMMANDS
ipfs files chmod <mode> <path> - Change optional POSIX mode permissions
ipfs files touch <path> - Set or change optional POSIX modification
times.
# ipfs files chcid
USAGE
ipfs files chcid [<path>] - Change the CID version or hash function of the
root node of a given path.
SYNOPSIS
ipfs files chcid [--cid-version=<cid-version> | --cid-ver] [--hash=<hash>]
[--] [<path>]
ARGUMENTS
[<path>] - Path to change. Default: '/'.
OPTIONS
--cid-ver, --cid-version int - Cid version to use. (experimental).
--hash string - Hash function to use. Will set Cid version
to 1 if used. (experimental).
DESCRIPTION
Change the CID version or hash function of the root node of a given path.
# ipfs files chmod
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs files chmod <mode> <path> - Change optional POSIX mode permissions
SYNOPSIS
ipfs files chmod [--] <mode> <path>
ARGUMENTS
<mode> - Mode to apply to node (numeric notation)
<path> - Path to apply mode
DESCRIPTION
The mode argument must be specified in Unix numeric notation.
$ ipfs files chmod 0644 /foo
$ ipfs files stat /foo
...
Type: file
Mode: -rw-r--r-- (0644)
...
# ipfs files cp
USAGE
ipfs files cp <source> <dest> - Add references to IPFS files and directories
in MFS (or copy within MFS).
SYNOPSIS
ipfs files cp [--parents | -p] [--] <source> <dest>
ARGUMENTS
<source> - Source IPFS or MFS path to copy.
<dest> - Destination within MFS.
OPTIONS
-p, --parents bool - Make parent directories as needed.
DESCRIPTION
"ipfs files cp" can be used to add references to any IPFS file or directory
(usually in the form /ipfs/<CID>, but also any resolvable path) into MFS.
This performs a lazy copy: the full DAG will not be fetched, only the root
node being copied.
It can also be used to copy files within MFS, but in the case when an
IPFS-path matches an existing MFS path, the IPFS path wins.
In order to add content to MFS from disk, you can use "ipfs add" to obtain the
IPFS Content Identifier and then "ipfs files cp" to copy it into MFS:
$ ipfs add --quieter --pin=false <your file>
# ...
# ... outputs the root CID at the end
$ ipfs files cp /ipfs/<CID> /your/desired/mfs/path
If you wish to fully copy content from a different IPFS peer into MFS, do not
forget to force IPFS to fetch the full DAG after doing a "cp" operation. i.e:
$ ipfs files cp /ipfs/<CID> /your/desired/mfs/path
$ ipfs pin add <CID>
The lazy-copy feature can also be used to protect partial DAG contents from
garbage collection. i.e. adding the Wikipedia root to MFS would not download
all the Wikipedia, but will prevent any downloaded Wikipedia-DAG content from
being GC'ed.
# ipfs files flush
USAGE
ipfs files flush [<path>] - Flush a given path's data to disk.
SYNOPSIS
ipfs files flush [--] [<path>]
ARGUMENTS
[<path>] - Path to flush. Default: '/'.
DESCRIPTION
Flush a given path to the disk. This is only useful when other commands
are run with the '--flush=false'.
# ipfs files ls
USAGE
ipfs files ls [<path>] - List directories in the local mutable namespace.
SYNOPSIS
ipfs files ls [--long | -l] [-U] [--] [<path>]
ARGUMENTS
[<path>] - Path to show listing for. Defaults to '/'.
OPTIONS
-l, --long bool - Use long listing format.
-U bool - Do not sort; list entries in directory order.
DESCRIPTION
List directories in the local mutable namespace (works on both IPFS and MFS paths).
Examples:
$ ipfs files ls /welcome/docs/
about
contact
help
quick-start
readme
security-notes
$ ipfs files ls /myfiles/a/b/c/d
foo
bar
# ipfs files mkdir
USAGE
ipfs files mkdir <path> - Make directories.
SYNOPSIS
ipfs files mkdir [--parents | -p] [--cid-version=<cid-version> | --cid-ver]
[--hash=<hash>] [--] <path>
ARGUMENTS
<path> - Path to dir to make.
OPTIONS
-p, --parents bool - No error if existing, make parent
directories as needed.
--cid-ver, --cid-version int - Cid version to use. (experimental).
--hash string - Hash function to use. Will set Cid version
to 1 if used. (experimental).
DESCRIPTION
Create the directory if it does not already exist.
The directory will have the same CID version and hash function of the
parent directory unless the --cid-version and --hash options are used.
NOTE: All paths must be absolute.
Examples:
$ ipfs files mkdir /test/newdir
$ ipfs files mkdir -p /test/does/not/exist/yet
# ipfs files mv
USAGE
ipfs files mv <source> <dest> - Move files.
SYNOPSIS
ipfs files mv [--] <source> <dest>
ARGUMENTS
<source> - Source file to move.
<dest> - Destination path for file to be moved to.
DESCRIPTION
Move files around. Just like the traditional Unix mv.
Example:
$ ipfs files mv /myfs/a/b/c /myfs/foo/newc
# ipfs files read
USAGE
ipfs files read <path> - Read a file from MFS.
SYNOPSIS
ipfs files read [--offset=<offset> | -o] [--count=<count> | -n] [--] <path>
ARGUMENTS
<path> - Path to file to be read.
OPTIONS
-o, --offset int64 - Byte offset to begin reading from.
-n, --count int64 - Maximum number of bytes to read.
DESCRIPTION
Read a specified number of bytes from a file at a given offset. By default,
it will read the entire file similar to the Unix cat.
Examples:
$ ipfs files read /test/hello
hello
# ipfs files rm
USAGE
ipfs files rm <path>... - Remove a file from MFS.
SYNOPSIS
ipfs files rm [--recursive | -r] [--force] [--] <path>...
ARGUMENTS
<path>... - File to remove.
OPTIONS
-r, --recursive bool - Recursively remove directories.
--force bool - Forcibly remove target at path; implies -r for
directories.
DESCRIPTION
Remove files or directories.
$ ipfs files rm /foo
$ ipfs files ls /bar
cat
dog
fish
$ ipfs files rm -r /bar
# ipfs files stat
USAGE
ipfs files stat <path> - Display file status.
SYNOPSIS
ipfs files stat [--format=<format>] [--hash] [--size] [--with-local] [--]
<path>
ARGUMENTS
<path> - Path to node to stat.
OPTIONS
--format string - Print statistics in given format. Allowed tokens:
<hash> <size> <cumulsize> <type> <childs> and optional
<mode> <mode-octal> <mtime> <mtime-secs>
<mtime-nsecs>.Conflicts with other format options.
Default: <hash>
Size: <size>
CumulativeSize:
<cumulsize>
ChildBlocks: <childs>
Type: <type>
Mode:
<mode> (<mode-octal>)
Mtime: <mtime>.
--hash bool - Print only hash. Implies '--format=<hash>'. Conflicts
with other format options.
--size bool - Print only size. Implies '--format=<cumulsize>'.
Conflicts with other format options.
--with-local bool - Compute the amount of the dag that is local, and if
possible the total size.
# ipfs files touch
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs files touch <path> - Set or change optional POSIX modification times.
SYNOPSIS
ipfs files touch [--mtime=<mtime>] [--mtime-nsecs=<mtime-nsecs>] [--] <path>
ARGUMENTS
<path> - Path of target to update.
OPTIONS
--mtime int64 - Modification time in seconds before or since the Unix
Epoch to apply to created UnixFS entries.
--mtime-nsecs uint - Modification time fraction in nanoseconds.
DESCRIPTION
Examples:
# set modification time to now.
$ ipfs files touch /foo
# set a custom modification time.
$ ipfs files touch --mtime=1630937926 /foo
# ipfs files write
USAGE
ipfs files write <path> <data> - Append to (modify) a file in MFS.
SYNOPSIS
ipfs files write [--offset=<offset> | -o] [--create | -e] [--parents | -p]
[--truncate | -t] [--count=<count> | -n] [--raw-leaves]
[--cid-version=<cid-version> | --cid-ver] [--hash=<hash>]
[--] <path> <data>
ARGUMENTS
<path> - Path to write to.
<data> - Data to write.
OPTIONS
-o, --offset int64 - Byte offset to begin writing at.
-e, --create bool - Create the file if it does not exist.
-p, --parents bool - Make parent directories as needed.
-t, --truncate bool - Truncate the file to size zero before
writing.
-n, --count int64 - Maximum number of bytes to read.
--raw-leaves bool - Use raw blocks for newly created leaf
nodes. (experimental).
--cid-ver, --cid-version int - Cid version to use. (experimental).
--hash string - Hash function to use. Will set Cid version
to 1 if used. (experimental).
DESCRIPTION
A low-level MFS command that allows you to append data at the end of a file, or
specify a beginning offset within a file to write to. The entire length of the
input will be written.
If the '--create' option is specified, the file will be created if it does not
exist. Nonexistent intermediate directories will not be created unless the
'--parents' option is specified.
Newly created files will have the same CID version and hash function of the
parent directory unless the '--cid-version' and '--hash' options are used.
Newly created leaves will be in the legacy format (Protobuf) if the
CID version is 0, or raw if the CID version is non-zero. Use of the
'--raw-leaves' option will override this behavior.
If the '--flush' option is set to false, changes will not be propagated to the
merkledag root. This can make operations much faster when doing a large number
of writes to a deeper directory structure.
EXAMPLE:
echo "hello world" | ipfs files write --create --parents /myfs/a/b/file
echo "hello world" | ipfs files write --truncate /myfs/a/b/file
WARNING:
Usage of the '--flush=false' option does not guarantee data durability until
the tree has been flushed. This can be accomplished by running 'ipfs files
stat' on the file or any of its ancestors.
WARNING:
The CID produced by 'files write' will be different from 'ipfs add' because
'ipfs file write' creates a trickle-dag optimized for append-only operations
See '--trickle' in 'ipfs add --help' for more information.
If you want to add a file without modifying an existing one,
use 'ipfs add' with '--to-files':
> ipfs files mkdir -p /myfs/dir
> ipfs add example.jpg --to-files /myfs/dir/
> ipfs files ls /myfs/dir/
example.jpg
See '--to-files' in 'ipfs add --help' for more information.
# ipfs filestore
USAGE
ipfs filestore - Interact with filestore objects.
SYNOPSIS
ipfs filestore
SUBCOMMANDS
ipfs filestore dups - List blocks that are both in the filestore
and standard block storage.
ipfs filestore ls [<obj>]... - List objects in filestore.
ipfs filestore verify [<obj>]... - Verify objects in filestore.
For more information about each command, use:
'ipfs filestore <subcmd> --help'
# ipfs filestore dups
USAGE
ipfs filestore dups - List blocks that are both in the filestore and standard
block storage.
SYNOPSIS
ipfs filestore dups
# ipfs filestore ls
USAGE
ipfs filestore ls [<obj>]... - List objects in filestore.
SYNOPSIS
ipfs filestore ls [--file-order] [--] [<obj>...]
ARGUMENTS
[<obj>]... - Cid of objects to list.
OPTIONS
--file-order bool - sort the results based on the path of the backing file.
DESCRIPTION
List objects in the filestore.
If one or more <obj> is specified only list those specific objects,
otherwise list all objects.
The output is:
<hash> <size> <path> <offset>
# ipfs filestore verify
USAGE
ipfs filestore verify [<obj>]... - Verify objects in filestore.
SYNOPSIS
ipfs filestore verify [--file-order] [--] [<obj>...]
ARGUMENTS
[<obj>]... - Cid of objects to verify.
OPTIONS
--file-order bool - verify the objects based on the order of the backing
file.
DESCRIPTION
Verify objects in the filestore.
If one or more <obj> is specified only verify those specific objects,
otherwise verify all objects.
The output is:
<status> <hash> <size> <path> <offset>
Where <status> is one of:
ok: the block can be reconstructed
changed: the contents of the backing file have changed
no-file: the backing file could not be found
error: there was some other problem reading the file
missing: <obj> could not be found in the filestore
ERROR: internal error, most likely due to a corrupt database
For ERROR entries the error will also be printed to stderr.
# ipfs get
USAGE
ipfs get <ipfs-path> - Download IPFS objects.
SYNOPSIS
ipfs get [--output=<output> | -o] [--archive | -a] [--compress | -C]
[--compression-level=<compression-level> | -l] [--progress=false]
[--] <ipfs-path>
ARGUMENTS
<ipfs-path> - The path to the IPFS object(s) to be outputted.
OPTIONS
-o, --output string - The path where the output should be stored.
-a, --archive bool - Output a TAR archive.
-C, --compress bool - Compress the output with GZIP compression.
-l, --compression-level int - The level of compression (1-9).
-p, --progress bool - Stream progress data. Default: true.
DESCRIPTION
Stores to disk the data contained an IPFS or IPNS object(s) at the given path.
By default, the output will be stored at './<ipfs-path>', but an alternate
path can be specified with '--output=<path>' or '-o=<path>'.
To output a TAR archive instead of unpacked files, use '--archive' or '-a'.
To compress the output with GZIP compression, use '--compress' or '-C'. You
may also specify the level of compression by specifying '-l=<1-9>'.
# ipfs id
USAGE
ipfs id [<peerid>] - Show IPFS node id info.
SYNOPSIS
ipfs id [--format=<format> | -f] [--peerid-base=<peerid-base>] [--] [<peerid>]
ARGUMENTS
[<peerid>] - Peer.ID of node to look up.
OPTIONS
-f, --format string - Optional output format.
--peerid-base string - Encoding used for peer IDs: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: b58mh.
DESCRIPTION
Prints out information about the specified peer.
If no peer is specified, prints out information for local peers.
'ipfs id' supports the format option for output with the following keys:
<id> : The peers id.
<aver>: Agent version.
<pver>: Protocol version.
<pubkey>: Public key.
<addrs>: Addresses (newline delimited).
<protocols>: Libp2p Protocol registrations (newline delimited).
EXAMPLE:
ipfs id Qmece2RkXhsKe5CRooNisBTh4SK119KrXXGmoK6V3kb8aH -f="<addrs>\n"
# ipfs init
USAGE
ipfs init [<default-config>] - Initializes ipfs config file.
SYNOPSIS
ipfs init [--algorithm=<algorithm> | -a] [--bits=<bits> | -b]
[--empty-repo=false] [--profile=<profile> | -p] [--]
[<default-config>]
ARGUMENTS
[<default-config>] - Initialize with the given configuration.
OPTIONS
-a, --algorithm string - Cryptographic algorithm to use for key generation.
Default: ed25519.
-b, --bits int - Number of bits to use in the generated RSA private
key.
-e, --empty-repo bool - Don't add and pin help files to the local storage.
Default: true.
-p, --profile string - Apply profile settings to config. Multiple
profiles can be separated by ','.
DESCRIPTION
Initializes ipfs configuration files and generates a new keypair.
If you are going to run IPFS in server environment, you may want to
initialize it using 'server' profile.
For the list of available profiles see 'ipfs config profile --help'
ipfs uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
environment variable:
export IPFS_PATH=/path/to/ipfsrepo
# ipfs key
USAGE
ipfs key - Create and list IPNS name keypairs
SYNOPSIS
ipfs key
DESCRIPTION
'ipfs key gen' generates a new keypair for usage with IPNS and 'ipfs name
publish'.
> ipfs key gen --type=rsa --size=2048 mykey
> ipfs name publish --key=mykey QmSomeHash
'ipfs key list' lists the available keys.
> ipfs key list
self
mykey
SUBCOMMANDS
ipfs key export <name> - Export a keypair
ipfs key gen <name> - Create a new keypair
ipfs key import <name> <key> - Import a key and prints imported key id
ipfs key list - List all local keypairs.
ipfs key rename <name> <newName> - Rename a keypair.
ipfs key rm <name>... - Remove a keypair.
ipfs key rotate - Rotates the IPFS identity.
For more information about each command, use:
'ipfs key <subcmd> --help'
EXPERIMENTAL SUBCOMMANDS
ipfs key sign <data> - Generates a signature for the given data with a
specified key. Useful for proving the key ownership.
ipfs key verify <data> - Verify that the given data and signature match.
# ipfs key export
USAGE
ipfs key export <name> - Export a keypair
SYNOPSIS
ipfs key export [--output=<output> | -o] [--format=<format> | -f] [--] <name>
ARGUMENTS
<name> - name of key to export
OPTIONS
-o, --output string - The path where the output should be stored.
-f, --format string - The format of the exported private key,
libp2p-protobuf-cleartext or pem-pkcs8-cleartext.
Default: libp2p-protobuf-cleartext.
DESCRIPTION
Exports a named libp2p key to disk.
By default, the output will be stored at './<key-name>.key', but an alternate
path can be specified with '--output=<path>' or '-o=<path>'.
It is possible to export a private key to interoperable PEM PKCS8 format by explicitly
passing '--format=pem-pkcs8-cleartext'. The resulting PEM file can then be consumed
elsewhere. For example, using openssl to get a PEM with public key:
$ ipfs key export testkey --format=pem-pkcs8-cleartext -o privkey.pem
$ openssl pkey -in privkey.pem -pubout > pubkey.pem
# ipfs key gen
USAGE
ipfs key gen <name> - Create a new keypair
SYNOPSIS
ipfs key gen [--type=<type> | -t] [--size=<size> | -s]
[--ipns-base=<ipns-base>] [--] <name>
ARGUMENTS
<name> - name of key to create
OPTIONS
-t, --type string - type of the key to create: rsa, ed25519. Default:
ed25519.
-s, --size int - size of the key to generate.
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
# ipfs key import
USAGE
ipfs key import <name> <key> - Import a key and prints imported key id
SYNOPSIS
ipfs key import [--ipns-base=<ipns-base>] [--format=<format> | -f]
[--allow-any-key-type] [--] <name> <key>
ARGUMENTS
<name> - name to associate with key in keychain
<key> - key provided by generate or export
OPTIONS
--ipns-base string - Encoding used for keys: Can either be a
multibase encoded CID or a base58btc encoded
multihash. Takes {b58mh|base36|k|base32|b...}.
Default: base36.
-f, --format string - The format of the private key to import,
libp2p-protobuf-cleartext or
pem-pkcs8-cleartext. Default:
libp2p-protobuf-cleartext.
--allow-any-key-type bool - Allow importing any key type. Default: false.
DESCRIPTION
Imports a key and stores it under the provided name.
By default, the key is assumed to be in 'libp2p-protobuf-cleartext' format,
however it is possible to import private keys wrapped in interoperable PEM PKCS8
by passing '--format=pem-pkcs8-cleartext'.
The PEM format allows for key generation outside of the IPFS node:
$ openssl genpkey -algorithm ED25519 > ed25519.pem
$ ipfs key import test-openssl -f pem-pkcs8-cleartext ed25519.pem
# ipfs key list
USAGE
ipfs key list - List all local keypairs.
SYNOPSIS
ipfs key list [-l] [--ipns-base=<ipns-base>]
OPTIONS
-l bool - Show extra information about keys.
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
# ipfs key rename
USAGE
ipfs key rename <name> <newName> - Rename a keypair.
SYNOPSIS
ipfs key rename [--force | -f] [--ipns-base=<ipns-base>] [--] <name> <newName>
ARGUMENTS
<name> - name of key to rename
<newName> - new name of the key
OPTIONS
-f, --force bool - Allow to overwrite an existing key.
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
# ipfs key rm
USAGE
ipfs key rm <name>... - Remove a keypair.
SYNOPSIS
ipfs key rm [-l] [--ipns-base=<ipns-base>] [--] <name>...
ARGUMENTS
<name>... - names of keys to remove
OPTIONS
-l bool - Show extra information about keys.
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
# ipfs key rotate
USAGE
ipfs key rotate - Rotates the IPFS identity.
SYNOPSIS
ipfs key rotate [--oldkey=<oldkey> | -o] [--type=<type> | -t]
[--size=<size> | -s]
OPTIONS
-o, --oldkey string - Keystore name to use for backing up your existing
identity.
-t, --type string - type of the key to create: rsa, ed25519. Default:
ed25519.
-s, --size int - size of the key to generate.
DESCRIPTION
Generates a new ipfs identity and saves it to the ipfs config file.
Your existing identity key will be backed up in the Keystore.
The daemon must not be running when calling this command.
ipfs uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
environment variable:
export IPFS_PATH=/path/to/ipfsrepo
# ipfs key sign
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs key sign <data> - Generates a signature for the given data with a
specified key. Useful for proving the key ownership.
SYNOPSIS
ipfs key sign [--key=<key> | -k] [--ipns-base=<ipns-base>] [--] <data>
ARGUMENTS
<data> - The data to sign.
OPTIONS
-k, --key string - The name of the key to use for signing.
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
DESCRIPTION
Sign arbitrary bytes, such as to prove ownership of a Peer ID or an IPNS Name.
To avoid signature reuse, the signed payload is always prefixed with
"libp2p-key signed message:".
# ipfs key verify
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs key verify <data> - Verify that the given data and signature match.
SYNOPSIS
ipfs key verify [--key=<key> | -k] [--signature=<signature> | -s]
[--ipns-base=<ipns-base>] [--] <data>
ARGUMENTS
<data> - The data to verify against the given signature.
OPTIONS
-k, --key string - The name of the key to use for signing.
-s, --signature string - Multibase-encoded signature to verify.
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
DESCRIPTION
Verify if the given data and signatures match. To avoid the signature reuse,
the signed payload is always prefixed with "libp2p-key signed message:".
# ipfs log
USAGE
ipfs log - Interact with the daemon log output.
SYNOPSIS
ipfs log
DESCRIPTION
'ipfs log' contains utility commands to affect or read the logging
output of a running daemon.
There are also two environmental variables that direct the logging
system (not just for the daemon logs, but all commands):
IPFS_LOGGING - sets the level of verbosity of the logging.
One of: debug, info, warn, error, dpanic, panic, fatal
IPFS_LOGGING_FMT - sets formatting of the log output.
One of: color, nocolor
SUBCOMMANDS
ipfs log level <subsystem> <level> - Change the logging level.
ipfs log ls - List the logging subsystems.
For more information about each command, use:
'ipfs log <subcmd> --help'
EXPERIMENTAL SUBCOMMANDS
ipfs log tail - Read the event log.
# ipfs log level
USAGE
ipfs log level <subsystem> <level> - Change the logging level.
SYNOPSIS
ipfs log level [--] <subsystem> <level>
ARGUMENTS
<subsystem> - The subsystem logging identifier. Use 'all' for all subsystems.
<level> - The log level, with 'debug' the most verbose and 'fatal' the
least verbose.
One of: debug, info, warn, error, dpanic,
panic, fatal.
DESCRIPTION
Change the verbosity of one or all subsystems log output. This does not affect
the event log.
# ipfs log ls
USAGE
ipfs log ls - List the logging subsystems.
SYNOPSIS
ipfs log ls
DESCRIPTION
'ipfs log ls' is a utility command used to list the logging
subsystems of a running daemon.
# ipfs log tail
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs log tail - Read the event log.
SYNOPSIS
ipfs log tail
DESCRIPTION
Outputs event log messages (not other log messages) as they are generated.
Currently broken. Follow https://github.com/ipfs/kubo/issues/9245 for updates.
# ipfs ls
USAGE
ipfs ls <ipfs-path>... - List directory contents for Unix filesystem objects.
SYNOPSIS
ipfs ls [--headers | -v] [--resolve-type=false] [--size=false] [--stream | -s]
[--] <ipfs-path>...
ARGUMENTS
<ipfs-path>... - The path to the IPFS object(s) to list links from.
OPTIONS
-v, --headers bool - Print table headers (Hash, Size, Name).
--resolve-type bool - Resolve linked objects to find out their types.
Default: true.
--size bool - Resolve linked objects to find out their file size.
Default: true.
-s, --stream bool - Enable experimental streaming of directory entries as
they are traversed.
DESCRIPTION
Displays the contents of an IPFS or IPNS object(s) at the given path, with
the following format:
<link base58 hash> <link size in bytes> <link name>
The JSON output contains type information.
# ipfs mount
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs mount - Mounts IPFS to the filesystem (read-only).
SYNOPSIS
ipfs mount [--ipfs-path=<ipfs-path> | -f] [--ipns-path=<ipns-path> | -n]
OPTIONS
-f, --ipfs-path string - The path where IPFS should be mounted.
-n, --ipns-path string - The path where IPNS should be mounted.
DESCRIPTION
Mount IPFS at a read-only mountpoint on the OS. The default, /ipfs and /ipns,
are set in the configuration file, but can be overridden by the options.
All IPFS objects will be accessible under this directory. Note that the
root will not be listable, as it is virtual. Access known paths directly.
You may have to create /ipfs and /ipns before using 'ipfs mount':
> sudo mkdir /ipfs /ipns
> sudo chown $(whoami) /ipfs /ipns
> ipfs daemon &
> ipfs mount
Example:
# setup
> mkdir foo
> echo "baz" > foo/bar
> ipfs add -r foo
added QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR foo/bar
added QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC foo
> ipfs ls QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC
QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR 12 bar
> ipfs cat QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR
baz
# mount
> ipfs daemon &
> ipfs mount
IPFS mounted at: /ipfs
IPNS mounted at: /ipns
> cd /ipfs/QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC
> ls
bar
> cat bar
baz
> cat /ipfs/QmSh5e7S6fdcu75LAbXNZAFY2nGyZUJXyLCJDvn2zRkWyC/bar
baz
> cat /ipfs/QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR
baz
# ipfs multibase
USAGE
ipfs multibase - Encode and decode files or stdin with multibase format
SYNOPSIS
ipfs multibase
SUBCOMMANDS
ipfs multibase decode <encoded_file> - Decode multibase string
ipfs multibase encode <file> - Encode data into multibase string
ipfs multibase list - List available multibase encodings.
ipfs multibase transcode <encoded_file> - Transcode multibase string between
bases
For more information about each command, use:
'ipfs multibase <subcmd> --help'
# ipfs multibase decode
USAGE
ipfs multibase decode <encoded_file> - Decode multibase string
SYNOPSIS
ipfs multibase decode [--] <encoded_file>
ARGUMENTS
<encoded_file> - encoded data to decode
DESCRIPTION
This command expects multibase inside of a file or via stdin:
> echo -n hello | ipfs multibase encode -b base16 > file
> cat file
f68656c6c6f
> ipfs multibase decode file
hello
> cat file | ipfs multibase decode
hello
# ipfs multibase encode
USAGE
ipfs multibase encode <file> - Encode data into multibase string
SYNOPSIS
ipfs multibase encode [-b=<b>] [--] <file>
ARGUMENTS
<file> - data to encode
OPTIONS
-b string - multibase encoding. Default: base64url.
DESCRIPTION
This command expects a file name or data provided via stdin.
By default it will use URL-safe base64url encoding,
but one can customize used base with -b:
> echo hello | ipfs multibase encode -b base16 > output_file
> cat output_file
f68656c6c6f0a
> echo hello > input_file
> ipfs multibase encode -b base16 input_file
f68656c6c6f0a
# ipfs multibase list
USAGE
ipfs multibase list - List available multibase encodings.
SYNOPSIS
ipfs multibase list [--prefix] [--numeric]
OPTIONS
--prefix bool - also include the single letter prefixes in addition to the
code.
--numeric bool - also include numeric codes.
DESCRIPTION
'ipfs cid bases' relies on https://github.com/multiformats/go-multibase
# ipfs multibase transcode
USAGE
ipfs multibase transcode <encoded_file> - Transcode multibase string between
bases
SYNOPSIS
ipfs multibase transcode [-b=<b>] [--] <encoded_file>
ARGUMENTS
<encoded_file> - encoded data to decode
OPTIONS
-b string - multibase encoding. Default: base64url.
DESCRIPTION
This command expects multibase inside of a file or via stdin.
By default it will use URL-safe base64url encoding,
but one can customize used base with -b:
> echo -n hello | ipfs multibase encode > file
> cat file
uaGVsbG8
> ipfs multibase transcode file -b base16 > transcoded_file
> cat transcoded_file
f68656c6c6f
# ipfs name
USAGE
ipfs name - Publish and resolve IPNS names.
SYNOPSIS
ipfs name
DESCRIPTION
IPNS is a PKI namespace, where names are the hashes of public keys, and
the private key enables publishing new (signed) values. In both publish
and resolve, the default name used is the node's own PeerID,
which is the hash of its public key.
You can use the 'ipfs key' commands to list and generate more names and their
respective keys.
Examples:
Publish an <ipfs-path> with your default name:
> ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Publish an <ipfs-path> with another name, added by an 'ipfs key' command:
> ipfs key gen --type=rsa --size=2048 mykey
> ipfs name publish --key=mykey /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published to QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Resolve the value of your name:
> ipfs name resolve
/ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Resolve the value of another name:
> ipfs name resolve QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
/ipfs/QmSiTko9JZyabH56y2fussEt1A5oDqsFXB3CkvAqraFryz
Resolve the value of a dnslink:
> ipfs name resolve ipfs.io
/ipfs/QmaBvfZooxWkrv7D3r8LS9moNjzD2o525XMZze69hhoxf5
SUBCOMMANDS
ipfs name publish <ipfs-path> - Publish IPNS names.
ipfs name resolve [<name>] - Resolve IPNS names.
For more information about each command, use:
'ipfs name <subcmd> --help'
EXPERIMENTAL SUBCOMMANDS
ipfs name inspect <record> - Inspects an IPNS Record
ipfs name pubsub - IPNS pubsub management
# ipfs name inspect
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs name inspect <record> - Inspects an IPNS Record
SYNOPSIS
ipfs name inspect [--verify=<verify>] [--dump=false] [--] <record>
ARGUMENTS
<record> - The IPNS record payload to be verified.
OPTIONS
--verify string - CID of the public IPNS key to validate against.
--dump bool - Include a full hex dump of the raw Protobuf record.
Default: true.
DESCRIPTION
Prints values inside of IPNS Record protobuf and its DAG-CBOR Data field.
The input can be a file or STDIN, the output can be JSON:
$ ipfs routing get "/ipns/$PEERID" > ipns_record
$ ipfs name inspect --enc=json < ipns_record
Values in PublicKey, SignatureV1 and SignatureV2 fields are raw bytes encoded
in Multibase. The Data field is DAG-CBOR represented as DAG-JSON.
Passing --verify will verify signature against provided public key.
# ipfs name publish
USAGE
ipfs name publish <ipfs-path> - Publish IPNS names.
SYNOPSIS
ipfs name publish [--key=<key> | -k] [--resolve=false]
[--lifetime=<lifetime> | -t] [--ttl=<ttl>] [--quieter | -Q]
[--v1compat=false] [--allow-offline]
[--ipns-base=<ipns-base>] [--] <ipfs-path>
ARGUMENTS
<ipfs-path> - ipfs path of the object to be published.
OPTIONS
-k, --key string - Name of the key to be used or a valid PeerID, as
listed by 'ipfs key list -l'. Default: self.
--resolve bool - Check if the given path can be resolved before
publishing. Default: true.
-t, --lifetime string - Time duration the signed record will be valid for.
Accepts durations such as "300s", "1.5h" or
"7d2h45m". Default: 48h0m0s.
--ttl string - Time duration hint, akin to --lifetime, indicating
how long to cache this record before checking for
updates. Default: 1h0m0s.
-Q, --quieter bool - Write only final IPNS Name encoded as CIDv1 (for
use in /ipns content paths).
--v1compat bool - Produce a backward-compatible IPNS Record by
including fields for both V1 and V2 signatures.
Default: true.
--allow-offline bool - When --offline, save the IPNS record to the local
datastore without broadcasting to the network
(instead of failing).
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
DESCRIPTION
IPNS is a PKI namespace, where names are the hashes of public keys, and
the private key enables publishing new (signed) values. In both publish
and resolve, the default name used is the node's own PeerID,
which is the hash of its public key.
You can use the 'ipfs key' commands to list and generate more names and their
respective keys.
Examples:
Publish an <ipfs-path> with your default name:
> ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Publish an <ipfs-path> with another name, added by an 'ipfs key' command:
> ipfs key gen --type=rsa --size=2048 mykey
> ipfs name publish --key=mykey /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published to QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Alternatively, publish an <ipfs-path> using a valid PeerID (as listed by
'ipfs key list -l'):
> ipfs name publish --key=QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
# ipfs name pubsub
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs name pubsub - IPNS pubsub management
SYNOPSIS
ipfs name pubsub
DESCRIPTION
Manage and inspect the state of the IPNS pubsub resolver.
Note: this command is experimental and subject to change as the system is refined
EXPERIMENTAL SUBCOMMANDS
ipfs name pubsub cancel <name> - Cancel a name subscription.
ipfs name pubsub state - Query the state of IPNS pubsub.
ipfs name pubsub subs - Show current name subscriptions.
# ipfs name pubsub cancel
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs name pubsub cancel <name> - Cancel a name subscription.
SYNOPSIS
ipfs name pubsub cancel [--] <name>
ARGUMENTS
<name> - Name to cancel the subscription for.
# ipfs name pubsub state
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs name pubsub state - Query the state of IPNS pubsub.
SYNOPSIS
ipfs name pubsub state
# ipfs name pubsub subs
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs name pubsub subs - Show current name subscriptions.
SYNOPSIS
ipfs name pubsub subs [--ipns-base=<ipns-base>]
OPTIONS
--ipns-base string - Encoding used for keys: Can either be a multibase
encoded CID or a base58btc encoded multihash. Takes
{b58mh|base36|k|base32|b...}. Default: base36.
# ipfs name resolve
USAGE
ipfs name resolve [<name>] - Resolve IPNS names.
SYNOPSIS
ipfs name resolve [--recursive=false] [--nocache | -n]
[--dht-record-count=<dht-record-count> | --dhtrc]
[--dht-timeout=<dht-timeout> | --dhtt] [--stream | -s] [--]
[<name>]
ARGUMENTS
[<name>] - The IPNS name to resolve. Defaults to your node's peerID.
OPTIONS
-r, --recursive bool - Resolve until the result is not an IPNS
name. Default: true.
-n, --nocache bool - Do not use cached entries.
--dhtrc, --dht-record-count uint - Number of records to request for DHT
resolution. Default: 16.
--dhtt, --dht-timeout string - Max time to collect values during DHT
resolution e.g. "30s". Pass 0 for no
timeout. Default: 1m0s.
-s, --stream bool - Stream entries as they are found.
DESCRIPTION
IPNS is a PKI namespace, where names are the hashes of public keys, and
the private key enables publishing new (signed) values. In both publish
and resolve, the default name used is the node's own PeerID,
which is the hash of its public key.
You can use the 'ipfs key' commands to list and generate more names and their
respective keys.
Examples:
Resolve the value of your name:
> ipfs name resolve
/ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Resolve the value of another name:
> ipfs name resolve QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
/ipfs/QmSiTko9JZyabH56y2fussEt1A5oDqsFXB3CkvAqraFryz
Resolve the value of a dnslink:
> ipfs name resolve ipfs.io
/ipfs/QmaBvfZooxWkrv7D3r8LS9moNjzD2o525XMZze69hhoxf5
# ipfs object
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs object - Deprecated commands to interact with dag-pb objects. Use 'dag'
or 'files' instead.
SYNOPSIS
ipfs object
DESCRIPTION
'ipfs object' is a legacy plumbing command used to manipulate dag-pb objects
directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.
DEPRECATED SUBCOMMANDS
ipfs object diff <obj_a> <obj_b> - Display the diff between two IPFS objects.
ipfs object patch - Deprecated way to create a new merkledag
object based on an existing one. Use MFS
with 'files cp|rm' instead.
REMOVED SUBCOMMANDS
ipfs object data - Removed, use 'ipfs dag' or 'ipfs files' instead.
ipfs object get - Removed, use 'ipfs dag' or 'ipfs files' instead.
ipfs object links - Removed, use 'ipfs dag' or 'ipfs files' instead.
ipfs object new - Removed, use 'ipfs dag' or 'ipfs files' instead.
ipfs object put - Removed, use 'ipfs dag' or 'ipfs files' instead.
ipfs object stat - Removed, use 'ipfs dag' or 'ipfs files' instead.
# ipfs object data
WARNING: REMOVED, command is no longer available
USAGE
ipfs object data - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object data
# ipfs object diff
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs object diff <obj_a> <obj_b> - Display the diff between two IPFS objects.
SYNOPSIS
ipfs object diff [--verbose | -v] [--] <obj_a> <obj_b>
ARGUMENTS
<obj_a> - Object to diff against.
<obj_b> - Object to diff.
OPTIONS
-v, --verbose bool - Print extra information.
DESCRIPTION
'ipfs object diff' is a command used to show the differences between
two IPFS objects.
Example:
> ls foo
bar baz/ giraffe
> ipfs add -r foo
...
Added QmegHcnrPgMwC7tBiMxChD54fgQMBUecNw9nE9UUU4x1bz foo
> OBJ_A=QmegHcnrPgMwC7tBiMxChD54fgQMBUecNw9nE9UUU4x1bz
> echo "different content" > foo/bar
> ipfs add -r foo
...
Added QmcmRptkSPWhptCttgHg27QNDmnV33wAJyUkCnAvqD3eCD foo
> OBJ_B=QmcmRptkSPWhptCttgHg27QNDmnV33wAJyUkCnAvqD3eCD
> ipfs object diff -v $OBJ_A $OBJ_B
Changed "bar" from QmNgd5cz2jNftnAHBhcRUGdtiaMzb5Rhjqd4etondHHST8 to QmRfFVsjSXkhFxrfWnLpMae2M4GBVsry6VAuYYcji5MiZb.
# ipfs object get
WARNING: REMOVED, command is no longer available
USAGE
ipfs object get - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object get
# ipfs object links
WARNING: REMOVED, command is no longer available
USAGE
ipfs object links - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object links
# ipfs object new
WARNING: REMOVED, command is no longer available
USAGE
ipfs object new - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object new
# ipfs object patch
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs object patch - Deprecated way to create a new merkledag object based on
an existing one. Use MFS with 'files cp|rm' instead.
SYNOPSIS
ipfs object patch [--allow-big-block]
OPTIONS
--allow-big-block bool - Disable block size check and allow creation of
blocks bigger than 1MiB. WARNING: such blocks won't
be transferable over the standard bitswap. Default:
false.
DESCRIPTION
'ipfs object patch <root> <cmd> <args>' is a plumbing command used to
build custom dag-pb objects. It mutates objects, creating new objects as a
result. This is the Merkle-DAG version of modifying an object.
DEPRECATED and provided for legacy reasons.
For modern use cases, use MFS with 'files' commands: 'ipfs files --help'.
$ ipfs files cp /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn /some-dir
$ ipfs files cp /ipfs/Qmayz4F4UzqcAMitTzU4zCSckDofvxstDuj3y7ajsLLEVs /some-dir/added-file.jpg
$ ipfs files stat --hash /some-dir
The above will add 'added-file.jpg' to the directory placed under /some-dir
and the CID of updated directory is returned by 'files stat'
'files cp' does not download the data, only the root block, which makes it
possible to build arbitrary directory trees without fetching them in full to
the local node.
DEPRECATED SUBCOMMANDS
ipfs object patch add-link <root> <name> <ref> - Deprecated way to add a link to a given dag-pb.
ipfs object patch rm-link <root> <name> - Deprecated way to remove a link from dag-pb object.
REMOVED SUBCOMMANDS
ipfs object patch append-data - Removed, use 'ipfs dag' or 'ipfs files'
instead.
ipfs object patch set-data - Removed, use 'ipfs dag' or 'ipfs files'
instead.
# ipfs object patch add-link
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs object patch add-link <root> <name> <ref> - Deprecated way to add a link to a given dag-pb.
SYNOPSIS
ipfs object patch add-link [--create | -p] [--] <root> <name> <ref>
ARGUMENTS
<root> - The hash of the node to modify.
<name> - Name of link to create.
<ref> - IPFS object to add link to.
OPTIONS
-p, --create bool - Create intermediary nodes.
DESCRIPTION
Add a Merkle-link to the given object and return the hash of the result.
DEPRECATED and provided for legacy reasons.
Use MFS and 'files' commands instead:
$ ipfs files cp /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn /some-dir
$ ipfs files cp /ipfs/Qmayz4F4UzqcAMitTzU4zCSckDofvxstDuj3y7ajsLLEVs /some-dir/added-file.jpg
$ ipfs files stat --hash /some-dir
The above will add 'added-file.jpg' to the directory placed under /some-dir
and the CID of updated directory is returned by 'files stat'
'files cp' does not download the data, only the root block, which makes it
possible to build arbitrary directory trees without fetching them in full to
the local node.
# ipfs object patch append-data
WARNING: REMOVED, command is no longer available
USAGE
ipfs object patch append-data - Removed, use 'ipfs dag' or 'ipfs files'
instead.
SYNOPSIS
ipfs object patch append-data
# ipfs object patch rm-link
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs object patch rm-link <root> <name> - Deprecated way to remove a link
from dag-pb object.
SYNOPSIS
ipfs object patch rm-link [--] <root> <name>
ARGUMENTS
<root> - The hash of the node to modify.
<name> - Name of the link to remove.
DESCRIPTION
Remove a Merkle-link from the given object and return the hash of the result.
DEPRECATED and provided for legacy reasons. Use 'files rm' instead.
# ipfs object patch set-data
WARNING: REMOVED, command is no longer available
USAGE
ipfs object patch set-data - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object patch set-data
# ipfs object put
WARNING: REMOVED, command is no longer available
USAGE
ipfs object put - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object put
# ipfs object stat
WARNING: REMOVED, command is no longer available
USAGE
ipfs object stat - Removed, use 'ipfs dag' or 'ipfs files' instead.
SYNOPSIS
ipfs object stat
# ipfs p2p
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p - Libp2p stream mounting.
SYNOPSIS
ipfs p2p
DESCRIPTION
Create and use tunnels to remote peers over libp2p
Note: this command is experimental and subject to change as usecases and APIs
are refined
EXPERIMENTAL SUBCOMMANDS
ipfs p2p close - Stop listening for new connections to forward.
ipfs p2p forward <protocol> <listen-address> <target-address> - Forward connections to libp2p service.
ipfs p2p listen <protocol> <target-address> - Create libp2p service.
ipfs p2p ls - List active p2p listeners.
ipfs p2p stream - P2P stream management.
# ipfs p2p close
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p close - Stop listening for new connections to forward.
SYNOPSIS
ipfs p2p close [--all | -a] [--protocol=<protocol> | -p]
[--listen-address=<listen-address> | -l]
[--target-address=<target-address> | -t]
OPTIONS
-a, --all bool - Close all listeners.
-p, --protocol string - Match protocol name.
-l, --listen-address string - Match listen address.
-t, --target-address string - Match target address.
# ipfs p2p forward
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p forward <protocol> <listen-address> <target-address> - Forward connections to libp2p service.
SYNOPSIS
ipfs p2p forward [--allow-custom-protocol] [--] <protocol> <listen-address>
<target-address>
ARGUMENTS
<protocol> - Protocol name.
<listen-address> - Listening endpoint.
<target-address> - Target endpoint.
OPTIONS
--allow-custom-protocol bool - Don't require /x/ prefix.
DESCRIPTION
Forward connections made to <listen-address> to <target-address>.
<protocol> specifies the libp2p protocol name to use for libp2p
connections and/or handlers. It must be prefixed with '/x/'.
Example:
ipfs p2p forward /x/myproto /ip4/127.0.0.1/tcp/4567 /p2p/QmPeer
- Forward connections to 127.0.0.1:4567 to '/x/myproto' service on /p2p/QmPeer
# ipfs p2p listen
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p listen <protocol> <target-address> - Create libp2p service.
SYNOPSIS
ipfs p2p listen [--allow-custom-protocol] [--report-peer-id | -r] [--]
<protocol> <target-address>
ARGUMENTS
<protocol> - Protocol name.
<target-address> - Target endpoint.
OPTIONS
--allow-custom-protocol bool - Don't require /x/ prefix.
-r, --report-peer-id bool - Send remote base58 peerid to target when a
new connection is established.
DESCRIPTION
Create libp2p service and forward connections made to <target-address>.
<protocol> specifies the libp2p handler name. It must be prefixed with '/x/'.
Example:
ipfs p2p listen /x/myproto /ip4/127.0.0.1/tcp/1234
- Forward connections to 'myproto' libp2p service to 127.0.0.1:1234
# ipfs p2p ls
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p ls - List active p2p listeners.
SYNOPSIS
ipfs p2p ls [--headers | -v]
OPTIONS
-v, --headers bool - Print table headers (Protocol, Listen, Target).
# ipfs p2p stream
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p stream - P2P stream management.
SYNOPSIS
ipfs p2p stream
DESCRIPTION
Create and manage p2p streams
EXPERIMENTAL SUBCOMMANDS
ipfs p2p stream close [<id>] - Close active p2p stream.
ipfs p2p stream ls - List active p2p streams.
# ipfs p2p stream close
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p stream close [<id>] - Close active p2p stream.
SYNOPSIS
ipfs p2p stream close [--all | -a] [--] [<id>]
ARGUMENTS
[<id>] - Stream identifier
OPTIONS
-a, --all bool - Close all streams.
# ipfs p2p stream ls
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs p2p stream ls - List active p2p streams.
SYNOPSIS
ipfs p2p stream ls [--headers | -v]
OPTIONS
-v, --headers bool - Print table headers (ID, Protocol, Local, Remote).
# ipfs pin
USAGE
ipfs pin - Pin (and unpin) objects to local storage.
SYNOPSIS
ipfs pin
SUBCOMMANDS
ipfs pin add <ipfs-path>... - Pin objects to local storage.
ipfs pin ls [<ipfs-path>]... - List objects pinned to local storage.
ipfs pin remote - Pin (and unpin) objects to remote
pinning service.
ipfs pin rm <ipfs-path>... - Remove object from pin-list.
ipfs pin update <from-path> <to-path> - Update a recursive pin.
ipfs pin verify - Verify that recursive pins are
complete.
For more information about each command, use:
'ipfs pin <subcmd> --help'
# ipfs pin add
USAGE
ipfs pin add <ipfs-path>... - Pin objects to local storage.
SYNOPSIS
ipfs pin add [--recursive=false] [--name=<name> | -n] [--progress] [--]
<ipfs-path>...
ARGUMENTS
<ipfs-path>... - Path to object(s) to be pinned.
OPTIONS
-r, --recursive bool - Recursively pin the object linked to by the
specified object(s). Default: true.
-n, --name string - An optional name for created pin(s).
--progress bool - Show progress.
DESCRIPTION
Create a pin for the given object, protecting resolved CID from being garbage
collected.
An optional name can be provided, and read back via 'ipfs pin ls --names'.
Be mindful of defaults:
Default pin type is 'recursive' (entire DAG).
Pass -r=false to create a direct pin for a single block.
Use 'pin ls -t recursive' to only list roots of recursively pinned DAGs
(significantly faster when many big DAGs are pinned recursively)
Default pin name is empty. Pass '--name' to 'pin add' to set one
and use 'pin ls --names' to see it. Pinning a second time with a different
name will update the name of the pin.
If daemon is running, any missing blocks will be retrieved from the network.
It may take some time. Pass '--progress' to track the progress.
# ipfs pin ls
USAGE
ipfs pin ls [<ipfs-path>]... - List objects pinned to local storage.
SYNOPSIS
ipfs pin ls [--type=<type> | -t] [--quiet | -q] [--name=<name> | -n]
[--stream | -s] [--names] [--] [<ipfs-path>...]
ARGUMENTS
[<ipfs-path>]... - Path to object(s) to be listed.
OPTIONS
-t, --type string - The type of pinned keys to list. Can be "direct",
"indirect", "recursive", or "all". Default: all.
-q, --quiet bool - Output only the CIDs of pins.
-n, --name string - Limit returned pins to ones with names that contain
the value provided (case-sensitive, partial match).
Implies --names=true.
-s, --stream bool - Enable streaming of pins as they are discovered.
--names bool - Include pin names in the output (slower, disabled by
default).
DESCRIPTION
Returns a list of objects that are pinned locally.
By default, all pinned objects are returned, but the '--type' flag or
arguments can restrict that to a specific pin type or to some specific objects
respectively.
Use --type=<type> to specify the type of pinned keys to list.
Valid values are:
* "direct": pin that specific object.
* "recursive": pin that specific object, and indirectly pin all its
descendants
* "indirect": pinned indirectly by an ancestor (like a refcount)
* "all"
By default, pin names are not included (returned as empty).
Pass '--names' flag to return pin names (set with '--name' from 'pin add').
With arguments, the command fails if any of the arguments is not a pinned
object. And if --type=<type> is additionally used, the command will also fail
if any of the arguments is not of the specified type.
Example:
$ echo "hello" | ipfs add -q
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
$ ipfs pin ls
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN recursive
# now remove the pin, and repin it directly
$ ipfs pin rm QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
unpinned QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
$ ipfs pin add -r=false QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
pinned QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN directly
$ ipfs pin ls --type=direct
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN direct
$ ipfs pin ls QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN direct
# ipfs pin remote
USAGE
ipfs pin remote - Pin (and unpin) objects to remote pinning service.
SYNOPSIS
ipfs pin remote
SUBCOMMANDS
ipfs pin remote add <ipfs-path> - Pin object to remote pinning service.
ipfs pin remote ls - List objects pinned to remote pinning
service.
ipfs pin remote rm - Remove pins from remote pinning service.
ipfs pin remote service - Configure remote pinning services.
For more information about each command, use:
'ipfs pin remote <subcmd> --help'
# ipfs pin remote add
USAGE
ipfs pin remote add <ipfs-path> - Pin object to remote pinning service.
SYNOPSIS
ipfs pin remote add [--service=<service>] [--name=<name>] [--background] [--]
<ipfs-path>
ARGUMENTS
<ipfs-path> - CID or Path to be pinned.
OPTIONS
--service string - Name of the remote pinning service to use (mandatory).
--name string - An optional name for the pin.
--background bool - Add to the queue on the remote service and return
immediately (does not wait for pinned status).
Default: false.
DESCRIPTION
Asks remote pinning service to pin an IPFS object from a given path or a CID.
To pin CID 'bafkqaaa' to service named 'mysrv' under a pin named 'mypin':
$ ipfs pin remote add --service=mysrv --name=mypin bafkqaaa
The above command will block until remote service returns 'pinned' status,
which may take time depending on the size and available providers of the pinned
data.
If you prefer to not wait for pinning confirmation and return immediately
after remote service confirms 'queued' status, add the '--background' flag:
$ ipfs pin remote add --service=mysrv --name=mypin --background bafkqaaa
Status of background pin requests can be inspected with the 'ls' command.
To list all pins for the CID across all statuses:
$ ipfs pin remote ls --service=mysrv --cid=bafkqaaa --status=queued \
--status=pinning --status=pinned --status=failed
NOTE: a comma-separated notation is supported in CLI for convenience:
$ ipfs pin remote ls --service=mysrv --cid=bafkqaaa --status=queued,pinning,pinned,failed
# ipfs pin remote ls
USAGE
ipfs pin remote ls - List objects pinned to remote pinning service.
SYNOPSIS
ipfs pin remote ls [--service=<service>] [--name=<name>] [--cid=<cid>]...
[--status=<status>]...
OPTIONS
--service string - Name of the remote pinning service to use (mandatory).
--name string - Return pins with names that contain the value provided
(case-sensitive, exact match).
--cid array - Return pins for the specified CIDs (comma-separated).
--status array - Return pins with the specified statuses
(queued,pinning,pinned,failed). Default: [pinned].
DESCRIPTION
Returns a list of objects that are pinned to a remote pinning service.
NOTE: By default, it will only show matching objects in 'pinned' state.
Pass '--status=queued,pinning,pinned,failed' to list pins in all states.
# ipfs pin remote rm
USAGE
ipfs pin remote rm - Remove pins from remote pinning service.
SYNOPSIS
ipfs pin remote rm [--service=<service>] [--name=<name>] [--cid=<cid>]...
[--status=<status>]... [--force]
OPTIONS
--service string - Name of the remote pinning service to use (mandatory).
--name string - Remove pins with names that contain provided value
(case-sensitive, exact match).
--cid array - Remove pins for the specified CIDs.
--status array - Remove pins with the specified statuses
(queued,pinning,pinned,failed). Default: [pinned].
--force bool - Allow removal of multiple pins matching the query without
additional confirmation. Default: false.
DESCRIPTION
Removes remote pins, allowing them to be garbage-collected if needed.
This command accepts the same search query parameters as 'ls', and it is good
practice to execute 'ls' before 'rm' to confirm the list of pins to be removed.
To remove a single pin for a specific CID:
$ ipfs pin remote ls --service=mysrv --cid=bafkqaaa
$ ipfs pin remote rm --service=mysrv --cid=bafkqaaa
When more than one pin matches the query on the remote service, an error is
returned. To confirm the removal of multiple pins, pass '--force':
$ ipfs pin remote ls --service=mysrv --name=popular-name
$ ipfs pin remote rm --service=mysrv --name=popular-name --force
NOTE: When no '--status' is passed, implicit '--status=pinned' is used.
To list and then remove all pending pin requests, pass an explicit status list:
$ ipfs pin remote ls --service=mysrv --status=queued,pinning,failed
$ ipfs pin remote rm --service=mysrv --status=queued,pinning,failed --force
# ipfs pin remote service
USAGE
ipfs pin remote service - Configure remote pinning services.
SYNOPSIS
ipfs pin remote service
SUBCOMMANDS
ipfs pin remote service add <service> <endpoint> <key> - Add remote pinning service.
ipfs pin remote service ls - List remote pinning services.
ipfs pin remote service rm <service> - Remove remote pinning service.
For more information about each command, use:
'ipfs pin remote service <subcmd> --help'
# ipfs pin remote service add
USAGE
ipfs pin remote service add <service> <endpoint> <key> - Add remote pinning service.
SYNOPSIS
ipfs pin remote service add [--] <service> <endpoint> <key>
ARGUMENTS
<service> - Service name.
<endpoint> - Service endpoint.
<key> - Service key.
DESCRIPTION
Add credentials for access to a remote pinning service and store them in the
config under Pinning.RemoteServices map.
TIP:
To add services and test them by fetching pin count stats:
$ ipfs pin remote service add goodsrv https://pin-api.example.com secret-key
$ ipfs pin remote service add badsrv https://bad-api.example.com invalid-key
$ ipfs pin remote service ls --stat
goodsrv https://pin-api.example.com 0/0/0/0
badsrv https://bad-api.example.com invalid
# ipfs pin remote service ls
USAGE
ipfs pin remote service ls - List remote pinning services.
SYNOPSIS
ipfs pin remote service ls [--stat]
OPTIONS
--stat bool - Try to fetch and display current pin count on remote service
(queued/pinning/pinned/failed). Default: false.
DESCRIPTION
List remote pinning services.
By default, only a name and an endpoint are listed; however, one can pass
'--stat' to test each endpoint by fetching pin counts for each state:
$ ipfs pin remote service ls --stat
goodsrv https://pin-api.example.com 0/0/0/0
badsrv https://bad-api.example.com invalid
TIP: pass '--enc=json' for more useful JSON output.
# ipfs pin remote service rm
USAGE
ipfs pin remote service rm <service> - Remove remote pinning service.
SYNOPSIS
ipfs pin remote service rm [--] <service>
ARGUMENTS
<service> - Name of remote pinning service to remove.
DESCRIPTION
Remove credentials for access to a remote pinning service.
# ipfs pin rm
USAGE
ipfs pin rm <ipfs-path>... - Remove object from pin-list.
SYNOPSIS
ipfs pin rm [--recursive=false] [--] <ipfs-path>...
ARGUMENTS
<ipfs-path>... - Path to object(s) to be unpinned.
OPTIONS
-r, --recursive bool - Recursively unpin the object linked to by the
specified object(s). Default: true.
DESCRIPTION
Removes the pin from the given object allowing it to be garbage
collected if needed. (By default, recursively. Use -r=false for direct pins.)
A pin may not be removed because the specified object is not pinned or pinned
indirectly. To determine if the object is pinned indirectly, use the command:
ipfs pin ls -t indirect <cid>
# ipfs pin update
USAGE
ipfs pin update <from-path> <to-path> - Update a recursive pin.
SYNOPSIS
ipfs pin update [--unpin=false] [--] <from-path> <to-path>
ARGUMENTS
<from-path> - Path to old object.
<to-path> - Path to a new object to be pinned.
OPTIONS
--unpin bool - Remove the old pin. Default: true.
DESCRIPTION
Efficiently pins a new object based on differences from an existing one and,
by default, removes the old pin.
This command is useful when the new pin contains many similarities or is a
derivative of an existing one, particularly for large objects. This allows a more
efficient DAG-traversal which fully skips already-pinned branches from the old
object. As a requirement, the old object needs to be an existing recursive
pin.
# ipfs pin verify
USAGE
ipfs pin verify - Verify that recursive pins are complete.
SYNOPSIS
ipfs pin verify [--verbose] [--quiet | -q]
OPTIONS
--verbose bool - Also write the hashes of non-broken pins.
-q, --quiet bool - Write just hashes of broken pins.
# ipfs ping
USAGE
ipfs ping <peer ID>... - Send echo request packets to IPFS hosts.
SYNOPSIS
ipfs ping [--count=<count> | -n] [--] <peer ID>...
ARGUMENTS
<peer ID>... - ID of peer to be pinged.
OPTIONS
-n, --count int - Number of ping messages to send. Default: 10.
DESCRIPTION
'ipfs ping' is a tool to test sending data to other nodes. It finds nodes
via the routing system, sends pings, waits for pongs, and prints out round-
trip latency information.
# ipfs pubsub
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs pubsub - An experimental publish-subscribe system on ipfs.
SYNOPSIS
ipfs pubsub
DESCRIPTION
ipfs pubsub allows you to publish messages to a given topic, and also to
subscribe to new messages on a given topic.
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
It is not intended in its current state to be used in a production
environment. To use, the daemon must be run with
'--enable-pubsub-experiment'.
DEPRECATED SUBCOMMANDS
ipfs pubsub ls - List subscribed topics by name.
ipfs pubsub peers [<topic>] - List peers we are currently pubsubbing with.
ipfs pubsub pub <topic> <data> - Publish data to a given pubsub topic.
ipfs pubsub sub <topic> - Subscribe to messages on a given topic.
# ipfs pubsub ls
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs pubsub ls - List subscribed topics by name.
SYNOPSIS
ipfs pubsub ls
DESCRIPTION
ipfs pubsub ls lists out the names of topics you are currently subscribed to.
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
It is not intended in its current state to be used in a production
environment. To use, the daemon must be run with
'--enable-pubsub-experiment'.
TOPIC ENCODING
Topic names are a binary data. To ensure all bytes are transferred
correctly RPC client and server will use multibase encoding behind
the scenes.
You can inspect the format by passing --enc=json. ipfs multibase commands
can be used for encoding/decoding multibase strings in the userland.
# ipfs pubsub peers
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs pubsub peers [<topic>] - List peers we are currently pubsubbing with.
SYNOPSIS
ipfs pubsub peers [--] [<topic>]
ARGUMENTS
[<topic>] - Topic to list connected peers of.
DESCRIPTION
ipfs pubsub peers with no arguments lists out the pubsub peers you are
currently connected to. If given a topic, it will list connected peers who are
subscribed to the named topic.
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
It is not intended in its current state to be used in a production
environment. To use, the daemon must be run with
'--enable-pubsub-experiment'.
TOPIC AND DATA ENCODING
Topic names are a binary data. To ensure all bytes are transferred
correctly RPC client and server will use multibase encoding behind
the scenes.
You can inspect the format by passing --enc=json. ipfs multibase commands
can be used for encoding/decoding multibase strings in the userland.
# ipfs pubsub pub
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs pubsub pub <topic> <data> - Publish data to a given pubsub topic.
SYNOPSIS
ipfs pubsub pub [--] <topic> <data>
ARGUMENTS
<topic> - Topic to publish to (multibase encoded when sent over HTTP RPC).
<data> - The data to be published.
DESCRIPTION
ipfs pubsub pub publishes a message to a specified topic.
It reads binary data from stdin or a file.
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
It is not intended in its current state to be used in a production
environment. To use, the daemon must be run with
'--enable-pubsub-experiment'.
HTTP RPC ENCODING
The data to be published is sent in HTTP request body as multipart/form-data.
Topic names are binary data too. To ensure all bytes are transferred
correctly via URL params, the RPC client and server will use multibase
encoding behind the scenes.
# ipfs pubsub sub
WARNING: DEPRECATED, command will be removed in the future
USAGE
ipfs pubsub sub <topic> - Subscribe to messages on a given topic.
SYNOPSIS
ipfs pubsub sub [--] <topic>
ARGUMENTS
<topic> - Name of topic to subscribe to (multibase encoded when sent over
HTTP RPC).
DESCRIPTION
ipfs pubsub sub subscribes to messages on a given topic.
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
It is not intended in its current state to be used in a production
environment. To use, the daemon must be run with
'--enable-pubsub-experiment'.
PEER ENCODING
Peer IDs in From fields are encoded using the default text representation
from go-libp2p. This ensures the same string values as in 'ipfs pubsub peers'.
TOPIC AND DATA ENCODING
Topics, Data and Seqno are binary data. To ensure all bytes are transferred
correctly the RPC client and server will use multibase encoding behind
the scenes.
You can inspect the format by passing --enc=json. The ipfs multibase commands
can be used for encoding/decoding multibase strings in the userland.
# ipfs refs
USAGE
ipfs refs <ipfs-path>... - List links (references) from an object.
SYNOPSIS
ipfs refs [--format=<format>] [--edges | -e] [--unique | -u]
[--recursive | -r] [--max-depth=<max-depth>] [--] <ipfs-path>...
ARGUMENTS
<ipfs-path>... - Path to the object(s) to list refs from.
OPTIONS
--format string - Emit edges with given format. Available tokens:
<src> <dst> <linkname>. Default: <dst>.
-e, --edges bool - Emit edge format: `<from> -> <to>`.
-u, --unique bool - Omit duplicate refs from output.
-r, --recursive bool - Recursively list links of child nodes.
--max-depth int - Only for recursive refs, limits fetch and listing
to the given depth. Default: -1.
DESCRIPTION
Lists the hashes of all the links an IPFS or IPNS object(s) contains,
with the following format:
<link base58 hash>
List all references recursively by using the flag '-r'.
NOTE: Like most other commands, Kubo will try to fetch the blocks of the passed path if they can't be found in the local store if it is running in online mode.
SUBCOMMANDS
ipfs refs local - List all local references.
For more information about each command, use:
'ipfs refs <subcmd> --help'
# ipfs refs local
USAGE
ipfs refs local - List all local references.
SYNOPSIS
ipfs refs local
DESCRIPTION
Displays the hashes of all local objects. NOTE: This treats all local objects as "raw blocks" and returns CIDv1-Raw CIDs.
# ipfs repo
USAGE
ipfs repo - Manipulate the IPFS repo.
SYNOPSIS
ipfs repo
DESCRIPTION
'ipfs repo' is a plumbing command used to manipulate the repo.
SUBCOMMANDS
ipfs repo gc - Perform a garbage collection sweep on the repo.
ipfs repo ls - List all local references.
ipfs repo migrate - Apply any outstanding migrations to the repo.
ipfs repo stat - Get stats for the currently used repo.
ipfs repo verify - Verify all blocks in repo are not corrupted.
ipfs repo version - Show the repo version.
For more information about each command, use:
'ipfs repo <subcmd> --help'
# ipfs repo gc
USAGE
ipfs repo gc - Perform a garbage collection sweep on the repo.
SYNOPSIS
ipfs repo gc [--stream-errors] [--quiet | -q] [--silent]
OPTIONS
--stream-errors bool - Stream errors.
-q, --quiet bool - Write minimal output.
--silent bool - Write no output.
DESCRIPTION
'ipfs repo gc' is a plumbing command that will sweep the local
set of stored objects and remove ones that are not pinned in
order to reclaim hard disk space.
# ipfs repo ls
USAGE
ipfs repo ls - List all local references.
SYNOPSIS
ipfs repo ls
DESCRIPTION
Displays the hashes of all local objects. NOTE: This treats all local objects as "raw blocks" and returns CIDv1-Raw CIDs.
# ipfs repo migrate
USAGE
ipfs repo migrate - Apply any outstanding migrations to the repo.
SYNOPSIS
ipfs repo migrate [--allow-downgrade]
OPTIONS
--allow-downgrade bool - Allow downgrading to a lower repo version.
# ipfs repo stat
USAGE
ipfs repo stat - Get stats for the currently used repo.
SYNOPSIS
ipfs repo stat [--size-only | -s] [--human | -H]
OPTIONS
-s, --size-only bool - Only report RepoSize and StorageMax.
-H, --human bool - Print sizes in human readable format (e.g., 1K 234M
2G).
DESCRIPTION
'ipfs repo stat' provides information about the local set of
stored objects. It outputs:
RepoSize int Size in bytes that the repo is currently taking.
StorageMax string Maximum datastore size (from configuration)
NumObjects int Number of objects in the local repo.
RepoPath string The path to the repo being currently used.
Version string The repo version.
# ipfs repo verify
USAGE
ipfs repo verify - Verify all blocks in repo are not corrupted.
SYNOPSIS
ipfs repo verify
# ipfs repo version
USAGE
ipfs repo version - Show the repo version.
SYNOPSIS
ipfs repo version [--quiet | -q]
OPTIONS
-q, --quiet bool - Write minimal output.
DESCRIPTION
'ipfs repo version' returns the current repo version.
# ipfs resolve
USAGE
ipfs resolve <name> - Resolve the value of names to IPFS.
SYNOPSIS
ipfs resolve [--recursive=false]
[--dht-record-count=<dht-record-count> | --dhtrc]
[--dht-timeout=<dht-timeout> | --dhtt] [--] <name>
ARGUMENTS
<name> - The name to resolve.
OPTIONS
-r, --recursive bool - Resolve until the result is an IPFS
name. Default: true.
--dhtrc, --dht-record-count int - Number of records to request for DHT
resolution.
--dhtt, --dht-timeout string - Max time to collect values during DHT
resolution e.g. "30s". Pass 0 for no
timeout.
DESCRIPTION
There are a number of mutable name protocols that can link among
themselves and into IPNS. For example IPNS references can (currently)
point at an IPFS object, and DNS links can point at other DNS links, IPNS
entries, or IPFS objects. This command accepts any of these
identifiers and resolves them to the referenced item.
EXAMPLES
Resolve the value of your identity:
$ ipfs resolve /ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj
Resolve the value of another name:
$ ipfs resolve /ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
/ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Resolve the value of another name recursively:
$ ipfs resolve -r /ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj
Resolve the value of an IPFS DAG path:
$ ipfs resolve /ipfs/QmeZy1fGbwgVSrqbfh9fKQrAWgeyRnj7h8fsHS1oy3k99x/beep/boop
/ipfs/QmYRMjyvAiHKN9UTi8Bzt1HUspmSRD8T8DwxfSMzLgBon1
# ipfs routing
USAGE
ipfs routing - Issue routing commands.
SYNOPSIS
ipfs routing
SUBCOMMANDS
ipfs routing findpeer <peerID>... - Find the multiaddresses associated with a
Peer ID.
ipfs routing findprovs <key>... - Find peers that can provide a specific
value, given a key.
For more information about each command, use:
'ipfs routing <subcmd> --help'
EXPERIMENTAL SUBCOMMANDS
ipfs routing get <key>... - Given a key, query the routing system
for its best value.
ipfs routing provide <key>... - Announce to the network that you are
providing given values.
ipfs routing put <key> <value-file> - Write a key/value pair to the routing
system.
# ipfs routing findpeer
USAGE
ipfs routing findpeer <peerID>... - Find the multiaddresses associated with a
Peer ID.
SYNOPSIS
ipfs routing findpeer [--verbose | -v] [--] <peerID>...
ARGUMENTS
<peerID>... - The ID of the peer to search for.
OPTIONS
-v, --verbose bool - Print extra information.
DESCRIPTION
Outputs a list of newline-delimited multiaddresses.
# ipfs routing findprovs
USAGE
ipfs routing findprovs <key>... - Find peers that can provide a specific
value, given a key.
SYNOPSIS
ipfs routing findprovs [--verbose | -v] [--num-providers=<num-providers> | -n]
[--] <key>...
ARGUMENTS
<key>... - The key to find providers for.
OPTIONS
-v, --verbose bool - Print extra information.
-n, --num-providers int - The number of providers to find. Default: 20.
DESCRIPTION
Outputs a list of newline-delimited provider Peer IDs.
# ipfs routing get
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs routing get <key>... - Given a key, query the routing system for its
best value.
SYNOPSIS
ipfs routing get [--] <key>...
ARGUMENTS
<key>... - The key to find a value for.
DESCRIPTION
Outputs the best value for the given key.
There may be several different values for a given key stored in the routing
system; in this context 'best' means the record that is most desirable. There is
no one metric for 'best': it depends entirely on the key type. For IPNS, 'best'
is the record that is both valid and has the highest sequence number (freshest).
Different key types can specify other 'best' rules.
# ipfs routing provide
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs routing provide <key>... - Announce to the network that you are
providing given values.
SYNOPSIS
ipfs routing provide [--verbose | -v] [--recursive | -r] [--] <key>...
ARGUMENTS
<key>... - The key[s] to send provide records for.
OPTIONS
-v, --verbose bool - Print extra information.
-r, --recursive bool - Recursively provide entire graph.
# ipfs routing put
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs routing put <key> <value-file> - Write a key/value pair to the routing
system.
SYNOPSIS
ipfs routing put [--allow-offline] [--] <key> <value-file>
ARGUMENTS
<key> - The key to store the value at.
<value-file> - A path to a file containing the value to store.
OPTIONS
--allow-offline bool - When offline, save the IPNS record to the local
datastore without broadcasting to the network instead
of simply failing.
DESCRIPTION
Given a key of the form /foo/bar and a valid value for that key, this will write
that value to the routing system with that key.
Keys have two parts: a keytype (foo) and the key name (bar). IPNS uses the
/ipns keytype, and expects the key name to be a Peer ID. IPNS entries are
specifically formatted (protocol buffer).
You may only use keytypes that are supported in your ipfs binary: currently
this is only /ipns. Unless you have a relatively deep understanding of the
go-ipfs routing internals, you likely want to be using 'ipfs name publish' instead
of this.
The value must be a valid value for the given key type. For example, if the key
is /ipns/QmFoo, the value must be IPNS record (protobuf) signed with the key
identified by QmFoo.
# ipfs shutdown
USAGE
ipfs shutdown - Shut down the IPFS daemon.
SYNOPSIS
ipfs shutdown
# ipfs stats
USAGE
ipfs stats - Query IPFS statistics.
SYNOPSIS
ipfs stats
DESCRIPTION
'ipfs stats' is a set of commands to help look at statistics
for your IPFS node.
SUBCOMMANDS
ipfs stats bitswap - Show some diagnostic information on the bitswap
agent.
ipfs stats bw - Print IPFS bandwidth information.
ipfs stats dht [<dht>]... - Returns statistics about the node's DHT(s).
ipfs stats provide - Returns statistics about the node's (re)provider
system.
ipfs stats repo - Get stats for the currently used repo.
For more information about each command, use:
'ipfs stats <subcmd> --help'
# ipfs stats bitswap
USAGE
ipfs stats bitswap - Show some diagnostic information on the bitswap agent.
SYNOPSIS
ipfs stats bitswap [--verbose | -v] [--human]
OPTIONS
-v, --verbose bool - Print extra information.
--human bool - Print sizes in human readable format (e.g., 1K 234M 2G).
# ipfs stats bw
USAGE
ipfs stats bw - Print IPFS bandwidth information.
SYNOPSIS
ipfs stats bw [--peer=<peer> | -p] [--proto=<proto> | -t] [--poll]
[--interval=<interval> | -i]
OPTIONS
-p, --peer string - Specify a peer to print bandwidth for.
-t, --proto string - Specify a protocol to print bandwidth for.
--poll bool - Print bandwidth at an interval.
-i, --interval string - Time interval to wait between updating output, if
'poll' is true.
This accepts durations such as
"300s", "1.5h" or "2h45m". Valid time units are:
"ns", "us" (or "µs"), "ms", "s", "m", "h". Default:
1s.
DESCRIPTION
'ipfs stats bw' prints bandwidth information for the ipfs daemon.
It displays: TotalIn, TotalOut, RateIn, RateOut.
By default, overall bandwidth and all protocols are shown. To limit bandwidth
to a particular peer, use the 'peer' option along with that peer's multihash
id. To specify a specific protocol, use the 'proto' option. The 'peer' and
'proto' options cannot be specified simultaneously. The protocols that are
queried using this method are outlined in the specification:
https://github.com/libp2p/specs/blob/master/7-properties.md#757-protocol-multicodecs
Example protocol options:
- /ipfs/id/1.0.0
- /ipfs/bitswap
- /ipfs/dht
Example:
> ipfs stats bw -t /ipfs/bitswap
Bandwidth
TotalIn: 5.0MB
TotalOut: 0B
RateIn: 343B/s
RateOut: 0B/s
> ipfs stats bw -p QmepgFW7BHEtU4pZJdxaNiv75mKLLRQnPi1KaaXmQN4V1a
Bandwidth
TotalIn: 4.9MB
TotalOut: 12MB
RateIn: 0B/s
RateOut: 0B/s
# ipfs stats dht
USAGE
ipfs stats dht [<dht>]... - Returns statistics about the node's DHT(s).
SYNOPSIS
ipfs stats dht [--] [<dht>...]
ARGUMENTS
[<dht>]... - The DHT whose table should be listed (wanserver, lanserver, wan,
lan). wan and lan refer to client routing tables. When using the
experimental DHT client only WAN is supported. Defaults to wan
and lan.
DESCRIPTION
Returns statistics about the DHT(s) the node is participating in.
This interface is not stable and may change from release to release.
# ipfs stats provide
USAGE
ipfs stats provide - Returns statistics about the node's (re)provider system.
SYNOPSIS
ipfs stats provide
DESCRIPTION
Returns statistics about the content the node is advertising.
This interface is not stable and may change from release to release.
# ipfs stats repo
USAGE
ipfs stats repo - Get stats for the currently used repo.
SYNOPSIS
ipfs stats repo [--size-only | -s] [--human | -H]
OPTIONS
-s, --size-only bool - Only report RepoSize and StorageMax.
-H, --human bool - Print sizes in human readable format (e.g., 1K 234M
2G).
DESCRIPTION
'ipfs repo stat' provides information about the local set of
stored objects. It outputs:
RepoSize int Size in bytes that the repo is currently taking.
StorageMax string Maximum datastore size (from configuration)
NumObjects int Number of objects in the local repo.
RepoPath string The path to the repo being currently used.
Version string The repo version.
# ipfs swarm
USAGE
ipfs swarm - Interact with the swarm.
SYNOPSIS
ipfs swarm
DESCRIPTION
'ipfs swarm' is a tool to manipulate the network swarm. The swarm is the
component that opens, listens for, and maintains connections to other
ipfs peers in the internet.
SUBCOMMANDS
ipfs swarm addrs - List known addresses. Useful for
debugging.
ipfs swarm connect <address>... - Open connection to a given peer.
ipfs swarm disconnect <address>... - Close connection to a given address.
ipfs swarm filters - Manipulate address filters.
ipfs swarm peering - Modify the peering subsystem.
ipfs swarm peers - List peers with open connections.
For more information about each command, use:
'ipfs swarm <subcmd> --help'
EXPERIMENTAL SUBCOMMANDS
ipfs swarm resources - Get a summary of all resources accounted for by the
libp2p Resource Manager.
# ipfs swarm addrs
USAGE
ipfs swarm addrs - List known addresses. Useful for debugging.
SYNOPSIS
ipfs swarm addrs
DESCRIPTION
'ipfs swarm addrs' lists all addresses this node is aware of.
SUBCOMMANDS
ipfs swarm addrs listen - List interface listening addresses.
ipfs swarm addrs local - List local addresses.
For more information about each command, use:
'ipfs swarm addrs <subcmd> --help'
# ipfs swarm addrs listen
USAGE
ipfs swarm addrs listen - List interface listening addresses.
SYNOPSIS
ipfs swarm addrs listen
DESCRIPTION
'ipfs swarm addrs listen' lists all interface addresses the node is listening on.
# ipfs swarm addrs local
USAGE
ipfs swarm addrs local - List local addresses.
SYNOPSIS
ipfs swarm addrs local [--id]
OPTIONS
--id bool - Show peer ID in addresses.
DESCRIPTION
'ipfs swarm addrs local' lists all local listening addresses announced to the network.
# ipfs swarm connect
USAGE
ipfs swarm connect <address>... - Open connection to a given peer.
SYNOPSIS
ipfs swarm connect [--] <address>...
ARGUMENTS
<address>... - Address of peer to connect to.
DESCRIPTION
'ipfs swarm connect' attempts to ensure a connection to a given peer.
Multiaddresses given are advisory, for example the node may already be aware of other addresses for a given peer or may already have an established connection to the peer.
The address format is a libp2p multiaddr:
ipfs swarm connect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
# ipfs swarm disconnect
USAGE
ipfs swarm disconnect <address>... - Close connection to a given address.
SYNOPSIS
ipfs swarm disconnect [--] <address>...
ARGUMENTS
<address>... - Address of peer to disconnect from.
DESCRIPTION
'ipfs swarm disconnect' closes a connection to a peer address. The address
format is an IPFS multiaddr:
ipfs swarm disconnect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
The disconnect is not permanent; if ipfs needs to talk to that address later,
it will reconnect.
# ipfs swarm filters
USAGE
ipfs swarm filters - Manipulate address filters.
SYNOPSIS
ipfs swarm filters
DESCRIPTION
'ipfs swarm filters' will list out currently applied filters. Its subcommands
can be used to add or remove said filters. Filters are specified using the
multiaddr-filter format:
Example:
/ip4/192.168.0.0/ipcidr/16
Where the above is equivalent to the standard CIDR:
192.168.0.0/16
Filters default to those specified under the "Swarm.AddrFilters" config key.
SUBCOMMANDS
ipfs swarm filters add <address>... - Add an address filter.
ipfs swarm filters rm <address>... - Remove an address filter.
For more information about each command, use:
'ipfs swarm filters <subcmd> --help'
# ipfs swarm filters add
USAGE
ipfs swarm filters add <address>... - Add an address filter.
SYNOPSIS
ipfs swarm filters add [--] <address>...
ARGUMENTS
<address>... - Multiaddr to filter.
DESCRIPTION
'ipfs swarm filters add' will add an address filter to the daemons swarm.
# ipfs swarm filters rm
USAGE
ipfs swarm filters rm <address>... - Remove an address filter.
SYNOPSIS
ipfs swarm filters rm [--] <address>...
ARGUMENTS
<address>... - Multiaddr filter to remove.
DESCRIPTION
'ipfs swarm filters rm' will remove an address filter from the daemons swarm.
# ipfs swarm peering
USAGE
ipfs swarm peering - Modify the peering subsystem.
SYNOPSIS
ipfs swarm peering
DESCRIPTION
'ipfs swarm peering' manages the peering subsystem.
Peers in the peering subsystem are maintained to be connected, reconnected
on disconnect with a back-off.
The changes are not saved to the config.
SUBCOMMANDS
ipfs swarm peering add <address>... - Add peers into the peering subsystem.
ipfs swarm peering ls - List peers registered in the peering
subsystem.
ipfs swarm peering rm <ID>... - Remove a peer from the peering
subsystem.
For more information about each command, use:
'ipfs swarm peering <subcmd> --help'
# ipfs swarm peering add
USAGE
ipfs swarm peering add <address>... - Add peers into the peering subsystem.
SYNOPSIS
ipfs swarm peering add [--] <address>...
ARGUMENTS
<address>... - address of peer to add into the peering subsystem
DESCRIPTION
'ipfs swarm peering add' will add the new address to the peering subsystem as one that should always be connected to.
# ipfs swarm peering ls
USAGE
ipfs swarm peering ls - List peers registered in the peering subsystem.
SYNOPSIS
ipfs swarm peering ls
DESCRIPTION
'ipfs swarm peering ls' lists the peers that are registered in the peering subsystem and to which the daemon is always connected.
# ipfs swarm peering rm
USAGE
ipfs swarm peering rm <ID>... - Remove a peer from the peering subsystem.
SYNOPSIS
ipfs swarm peering rm [--] <ID>...
ARGUMENTS
<ID>... - ID of peer to remove from the peering subsystem
DESCRIPTION
'ipfs swarm peering rm' will remove the given ID from the peering subsystem and remove it from the always-on connection.
# ipfs swarm peers
USAGE
ipfs swarm peers - List peers with open connections.
SYNOPSIS
ipfs swarm peers [--verbose | -v] [--streams] [--latency] [--direction]
[--identify]
OPTIONS
-v, --verbose bool - display all extra information.
--streams bool - Also list information about open streams for each peer.
--latency bool - Also list information about latency to each peer.
--direction bool - Also list information about the direction of connection.
--identify bool - Also list information about peers identify.
DESCRIPTION
'ipfs swarm peers' lists the set of peers this node is connected to.
# ipfs swarm resources
WARNING: EXPERIMENTAL, command may change in future releases
USAGE
ipfs swarm resources - Get a summary of all resources accounted for by the
libp2p Resource Manager.
SYNOPSIS
ipfs swarm resources
DESCRIPTION
Get a summary of all resources accounted for by the libp2p Resource Manager.
This includes the limits and the usage against those limits.
This can output a human readable table and JSON encoding.
# ipfs update
ipfs-update is an 'external' command.
It does not currently appear to be installed.
Please see https://github.com/ipfs/ipfs-update/blob/master/README.md#install for installation instructions.
# ipfs version
USAGE
ipfs version - Show IPFS version information.
SYNOPSIS
ipfs version [--number | -n] [--commit] [--repo] [--all]
OPTIONS
-n, --number bool - Only show the version number.
--commit bool - Show the commit hash.
--repo bool - Show repo version.
--all bool - Show all version information.
DESCRIPTION
Returns the current version of IPFS and exits.
SUBCOMMANDS
ipfs version check - Checks Kubo version against connected peers.
ipfs version deps - Shows information about dependencies used for build.
For more information about each command, use:
'ipfs version <subcmd> --help'
# ipfs version check
USAGE
ipfs version check - Checks Kubo version against connected peers.
SYNOPSIS
ipfs version check [--min-percent=<min-percent> | -t]
OPTIONS
-t, --min-percent int - Percentage (1-100) of sampled peers with the new
Kubo version needed to trigger an update warning.
Default: 5.
DESCRIPTION
This command uses the libp2p identify protocol to check the 'AgentVersion'
of connected peers and see if the Kubo version we're running is outdated.
Peers with an AgentVersion that doesn't start with 'kubo/' are ignored.
'UpdateAvailable' is set to true only if the 'min-fraction' criteria are met.
The 'ipfs daemon' does the same check regularly and logs when a new version
is available. You can stop these regular checks by setting
Version.SwarmCheckEnabled:false in the config.
# ipfs version deps
USAGE
ipfs version deps - Shows information about dependencies used for build.
SYNOPSIS
ipfs version deps
DESCRIPTION
Print out all dependencies and their versions.