4 local -a _1st_arguments
6 'add:Add a file or directory to ipfs.'
7 'bitswap:Interact with the bitswap agent.'
8 'block:Interact with raw IPFS blocks.'
9 'bootstrap:Show or edit the list of bootstrap peers.'
10 'cat:Show IPFS object data.'
11 'cid:Convert and discover properties of CIDs'
12 'commands:List all available commands.'
13 'config:Get and set ipfs config values.'
14 'daemon:Run a network-connected IPFS node.'
15 'dag:Interact with ipld dag objects. (experimental)'
16 'dht:Issue commands directly through the DHT.'
17 'diag:Generate diagnostic reports.'
18 'dns:Resolve DNS links.'
19 'files:Interact with unixfs files.'
20 'filestore:Interact with filestore objects. (experimental)'
21 'get:Download IPFS objects.'
22 'id:Show ipfs node id info.'
23 'init:Initializes ipfs config file.'
24 'key:Create and list IPNS name keypairs.'
25 'log:Interact with the daemon log output.'
26 'ls:List directory contents for Unix filesystem objects.'
27 'mount:Mounts IPFS to the filesystem (read-only).'
28 'name:Publish and resolve IPNS names.'
29 'object:Interact with IPFS objects.'
30 'p2p:Libp2p stream mounting.'
31 'pin:Pin (and unpin) objects to local storage.'
32 'ping:Send echo request packets to IPFS hosts.'
33 'refs:List links (references) from an object.'
34 'repo:Manipulate the IPFS repo.'
35 'resolve:Resolve the value of names to IPFS.'
36 'stats:Query IPFS statistics.'
37 'swarm:Interact with the swarm.'
38 'tar:Utility functions for tar files in ipfs.'
39 'update:Download and apply go-ipfs updates'
40 'version:Show ipfs version information.'
44 local curcontext="$curcontext" state line
46 _arguments -C ':command:->command' '*::options:->options'
49 _describe -t commands "ipfs subcommand" $1
55 case $MAIN_SUBCOMMAND in
57 _arguments '(-p --peer)'{-p,--peer}'[Specify which peer to show wantlist for. Default: self.]'
62 case $MAIN_SUBCOMMAND in
65 '(-r --recursive)'{-r,--recursive}'[Recursively pin the object linked to by the specified object(s). Default: true.]' \
66 '--progress[Show progress.]'
69 local -a _bootstrap_rm_arguments
70 _bootstrap_rm_arguments=(
71 'default:Add default peers to the bootstrap list.'
73 _ipfs_subcommand _bootstrap_rm_arguments
78 case $MAIN_SUBCOMMAND in
80 _arguments '(-r --recursive)'{-r,--recursive}'[Recursively unpin the object linked to by the specified object(s). Default: true.]'
83 local -a _bootstrap_rm_arguments
84 _bootstrap_rm_arguments=(
85 'all:Remove all peers from the bootstrap list.'
87 _ipfs_subcommand _bootstrap_rm_arguments
92 case $MAIN_SUBCOMMAND in
95 '(-t --type)'{-t,--type}'[The type of pinned keys to list. Can be "direct", "indirect", "recursive", or "all". Default: all.]' \
96 '(-q --quiet)'{-q,--quiet}'[Write just hashes of objects.]' \
97 '(-s --stream)'{-s,--stream}'[Enable streaming of pins as they are discovered.]'
100 _arguments '(-v --headers)'{-v,--headers}'[Print table headers (Protocol, Listen, Target).]'
105 case $MAIN_SUBCOMMAND in
107 _arguments '--unpin[Remove the old pin. Default: true.]'
112 case $MAIN_SUBCOMMAND in
115 '--verbose[Also write the hashes of non-broken pins.]' \
116 '(-q --quiet)'{-q,--quiet}'[Write just hashes of broken pins.]'
121 case $MAIN_SUBCOMMAND in
123 _arguments '(-v --verbose)'{-v,--verbose}'[Print extra information.]'
128 case $MAIN_SUBCOMMAND in
130 _arguments '(-v --verbose)'{-v,--verbose}'[Print extra information.]'
133 _arguments '--data-encoding[Encoding type of the data field, either "text" or "base64". Default: text.]'
138 case $MAIN_SUBCOMMAND in
140 _arguments '(-v --verbose)'{-v,--verbose}'[Print extra information.]'
144 '--inputenc[Encoding type of input data. One of: {"protobuf", "json"}. Default: json.]' \
145 '--datafieldenc[Encoding type of the data field, either "text" or "base64". Default: text.]' \
146 '--pin[Pin this object when adding.]' \
147 '(-q --quiet)'{-q,--quiet}'[Write minimal output]'
152 case $MAIN_SUBCOMMAND in
155 '(-v --verbose)'{-v,--verbose}'[Print extra information.]' \
156 '(-n --num-providers)'{-n,--num-providers}'[The number of providers to find. Default: 20.]'
161 case $MAIN_SUBCOMMAND in
164 '(-v --verbose)'{-v,--verbose}'[Print extra information.]' \
165 '(-r --recursive)'{-r,--recursive}'[Recursively provide entire graph.]'
170 case $MAIN_SUBCOMMAND in
172 _arguments '(-v --verbose)'{-v,--verbose}'[Print extra information.]'
177 case $MAIN_SUBCOMMAND in
179 _arguments '(-v --verbose)'{-v,--verbose}'[Print extra information.]'
184 case $MAIN_SUBCOMMAND in
187 '(-p --progress)'{-p,--progress}'[Return progressive data while reading through the DAG. Default: true.]'
190 _arguments '--human[Print sizes in human readable format (e.g., 1K 234M 2G).]'
194 '(-s --size-only)'{-s,--size-only}'[Only report RepoSize and StorageMax.]' \
195 '(-H --human)'{-H,--human}'[Print sizes in human readable format (e.g., 1K 234M 2G).]'
200 case $MAIN_SUBCOMMAND in
203 '--resolve[Check if the given path can be resolved before publishing. Default: true.]' \
204 '(-t --lifetime)'{-t,--lifetime}'[Time duration that the record will be valid for. Default: 24h.]' \
205 '--allow-offline[When offline, save the IPNS record to the the local datastore without broadcasting to the network instead of simply failing.]' \
206 '--ttl[Time duration this record should be cached for. Uses the same syntax as the lifetime option. (caution: experimental).]' \
207 '(-k --key)'{-k,--key}"[Name of the key to be used or a valid PeerID, as listed by 'ipfs key list -l'. Default: self.]" \
208 '(-Q --quieter)'{-Q,--quieter}'[Write only final hash.]' \
209 '--ipns-base[Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: base36.]'
214 case $MAIN_SUBCOMMAND in
216 local -a _name_pubsub_arguments
217 _name_pubsub_arguments=(
218 'cancel:Cancel a name subscription'
219 'state:Query the state of IPNS pubsub'
220 'subs:Show current name subscriptions'
222 _ipfs_subcommand _name_pubsub_arguments
227 case $MAIN_SUBCOMMAND in
230 '(-r --recursive)'{-r,--recursive}'[Resolve until the result is not an IPNS name. Default: true.]' \
231 '(-n --nocache)'{-n,--nocache}'[Do not use cached entries.]' \
232 '(--dhtrc --dht-record-count)'{--dhtrc,--dht-record-count}'[Number of records to request for DHT resolution.]' \
233 '(--dhtt --dht-timeout)'{--dhtt,--dht-timeout}'[Max time to collect values during DHT resolution eg "30s". Pass 0 for no timeout.]' \
234 '(-s --stream)'{-s,--stream}'[Stream entries as they are found.]'
239 case $MAIN_SUBCOMMAND in
241 local -a _object_patch_arguments
242 _object_patch_arguments=(
243 'add-link:Add a link to a given object.'
244 'append-data:Append data to the data segment of a dag node.'
245 'rm-link:Remove a link from a given object.'
246 'set-data:Set the data field of an IPFS object.'
248 _ipfs_subcommand _object_patch_arguments
253 case $MAIN_SUBCOMMAND in
256 '--stream-errors[Stream errors.]' \
257 '(-q --quiet)'{-q,--quiet}'[Write minimal output.]'
262 case $MAIN_SUBCOMMAND in
265 '(-v --verbose)'{-v,--verbose}'[Print extra information.]' \
266 '--human[Print sizes in human readable format (e.g., 1K 234M 2G).]'
271 case $MAIN_SUBCOMMAND in
274 '(-p --peer)'{-p,--peer}'[Specify a peer to print bandwidth for.]' \
275 '(-t --proto)'{-t,--proto}'[Specify a protocol to print bandwidth for.]' \
276 '--poll[Print bandwidth at an interval.]' \
277 '(-i --interval)'{-i,--interval}"[Time interval to wait between updating output, if 'poll' is true.]"
282 case $MAIN_SUBCOMMAND in
285 '--size-only[Only report RepoSize and StorageMax.]' \
286 '--human[Print sizes in human readable format (e.g., 1K 234M 2G).]'
291 case $MAIN_SUBCOMMAND in
294 '--prefix[also include the single leter prefixes in addition to the code.]' \
295 '--numeric[also include numeric codes.]'
300 case $MAIN_SUBCOMMAND in
302 _arguments '--numeric[also include numeric codes.]'
307 case $MAIN_SUBCOMMAND in
310 '-f[Printf style format string. Default: %s.]' \
311 '-v[CID version to convert to.]' \
312 '--codec[CID codec to convert to.]' \
313 '-b[Multibase to display CID in.]'
318 case $MAIN_SUBCOMMAND in
321 '(-a --all)'{-a,--all}'[Close all listeners.]' \
322 '(-p --protocol)'{-p,--protocol}'[Match protocol name.]' \
323 '(-l --listen-address)'{-l,--listen-address}'[Match listen address.]' \
324 '(-t --target-address)'{-t,--target-address}'[Match target address.]'
329 case $MAIN_SUBCOMMAND in
331 _arguments "--allow-custom-protocol[Don't require /x/ prefix.]"
336 case $MAIN_SUBCOMMAND in
339 "--allow-custom-protocol[Don't require /x/ prefix.]" \
340 '(-r --report-peer-id)'{-r,--report-peer-id}'[Send remote base58 peerid to target when a new connection is established.]'
345 case $MAIN_SUBCOMMAND in
347 local -a _p2p_stream_arguments
348 _p2p_stream_arguments=(
349 'close:Close active p2p stream.'
350 'ls:List active p2p streams.'
352 _ipfs_subcommand _p2p_stream_arguments
357 case $MAIN_SUBCOMMAND in
359 local -a _swarm_addrs_arguments
360 _swarm_addrs_arguments=(
361 'listen:List interface listening addresses.'
362 'local:List local addresses.'
364 _ipfs_subcommand _swarm_addrs_arguments
369 case $MAIN_SUBCOMMAND in
371 local -a _swarm_filters_arguments
372 _swarm_filters_arguments=(
373 'add:Add an address filter.'
374 'rm:Remove an address filter.'
376 _ipfs_subcommand _swarm_filters_arguments
381 case $MAIN_SUBCOMMAND in
384 '(-v --verbose)'{-v,--verbose}'[display all extra information.]' \
385 '--streams[Also list information about open streams for each peer.]' \
386 '--latency[Also list information about latency to each peer.]' \
387 '--direction[Also list information about the direction of connection.]'
392 case $MAIN_SUBCOMMAND in
395 '(-p --progress)'{-p,--progress}'[Display progress on CLI. Defaults to true when STDERR is a TTY.]'
399 '(-o --output)'{-o,--output}'[The path where the output should be stored.]'
404 case $MAIN_SUBCOMMAND in
407 '--silent[No output.]' \
408 '--pin-roots[Pin optional roots listed in the .car headers after importing. Default: true.]'
412 '--ipns-base[Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash. Takes {b58mh|base36|k|base32|b...}. Default: base36.]'
417 case $MAIN_SUBCOMMAND in
419 local -a _pin_remote_arguments
420 _pin_remote_arguments=(
421 'add:Pin object to remote pinning service.'
422 'ls:List objects pinned to remote pinning service.'
423 'rm:Remove pins from remote pinning service.'
424 'service:Configure remote pinning services.'
426 _ipfs_subcommand _pin_remote_arguments
438 '(-c --config)'{-c,--config}'[Path to the configuration file to use.]' \
439 '(-D --debug)'{-D,--debug}'[Operate in debug mode.]' \
440 '(--help)--help[Show the full command help text.]' \
441 '(--h)-h[Show a short version of the command help text.]' \
442 '(-L --local)'{-L,--local}'[Run the command locally, instead of using the daemon. DEPRECATED: use --offline.]' \
443 '(--offline)--offline[Run the command offline.]' \
444 '(--api)--api[Use a specific API instance (defaults to /ip4/127.0.0.1/tcp/5001).]' \
445 '(--cid-base)--cid-base[Multibase encoding used for version 1 CIDs in output.]' \
446 '(--upgrade-cidv0-in-output)--upgrade-cidv0-in-output[Upgrade version 0 to version 1 CIDs in output.]' \
447 '(--enc --encoding)'{--enc,--encoding}'[The encoding type the output should be encoded with (json, xml, or text). Default: text.]' \
448 '(--stream-channels)--stream-channels[Stream channel output.]' \
449 '(--timeout)--timeout[Set a global timeout on the command.]' \
450 '*:: :->subcmds' && return 0
452 if (( CURRENT == 1 )); then
453 _describe -t commands "ipfs subcommand" _1st_arguments
457 MAIN_SUBCOMMAND="$words[1]"
458 case $MAIN_SUBCOMMAND in
461 '(-r --recursive)'{-r,--recursive}'[Add directory paths recursively.]' \
462 '(--dereference-args)--dereference-args[Symlinks supplied in arguments are dereferenced.]' \
463 '(--stdin-name)--stdin-name[Assign a name if the file source is stdin.]' \
464 '(-H --hidden)'{-H,--hidden}'[Include files that are hidden. Only takes effect on recursive add.]' \
465 '(--ignore)--ignore[A rule (.gitignore-stype) defining which file(s) should be ignored (variadic, experimental).]' \
466 '(--ignore-rules-path)--ignore-rules-path[A path to a file with .gitignore-style ignore rules (experimental).]' \
467 '(-q --quiet)'{-q,--quiet}'[Write minimal output.]' \
468 '(-Q --quieter)'{-Q,--quieter}'[Write only final hash.]' \
469 '(--silent)--silent[Write no output.]' \
470 '(-p --progress)'{-p,--progress}'[Stream progress data.]' \
471 '(-t --trickle)'{-t,--trickle}'[Use trickle-dag format for dag generation.]' \
472 '(-n --only-hash)'{-n,--only-hash}'[Only chunk and hash - do not write to disk.]' \
473 '(-w --wrap-with-directory)'{-w,--wrap-with-directory}'[Wrap files with a directory object.]' \
474 '(-s --chunker)'{-s,--chunker}'[Chunking algorithm, size-(bytes) or rabin-(min)-(avg)-(max). Default: size-262144.]' \
475 '(--pin)--pin[Pin this object when adding. Default: true.]' \
476 '(--raw-leaves)--raw-leaves[Use raw blocks for leaf nodes. (experimental).]' \
477 '(--nocopy)--nocopy[Add the file using filestore. Implies raw-leaves. (experimental).]' \
478 '(--fscache)--fscache[Check the filestore for pre-existing blocks. (experimental).]' \
479 '(--cid-version)--cid-version[CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. (experimental).]' \
480 '(--hash)--hash[Hash function to use. Implies CIDv1 if not sha2-256. (experimental). Default: sha2-256.]' \
481 '(--inline)--inline[Inline small blocks into CIDs. (experimental).]' \
482 '(--inline-limit)--inline-limit[Maximum block size to inline. (experimental). Default: 32.]'
485 local -a _bitswap_arguments
487 'ledger:Show the current ledger for a peer.'
488 'reprovide:Trigger reprovider.'
489 'stat:Show some diagnostic information on the bitswap agent.'
490 'wantlist:Show blocks currently on the wantlist.'
492 _ipfs_subcommand _bitswap_arguments
495 local -a _block_arguments
497 'get:Get a raw IPFS block.'
498 'put:Store input as an IPFS block.'
499 'rm:Remove IPFS block(s).'
500 'stat:Print information of a raw IPFS block.'
502 _ipfs_subcommand _block_arguments
505 local -a _bootstrap_arguments
506 _bootstrap_arguments=(
507 'add:Add peers to the bootstrap list.'
508 'list:Show peers in the bootstrap list.'
509 'rm:Remove peers from the bootstrap list.'
511 _ipfs_subcommand _bootstrap_arguments
515 '(-o --offset)'{-o,--offset}'[Byte offset to begin reading from.]' \
516 '(-l --length)'{-l,--length}'[Maximum number of bytes to read.]'
519 local -a _cid_arguments
521 'base32:Convert CIDs to Base32 CID version 1.'
522 'bases:List available multibase encodings.'
523 'codecs:List available CID codecs.'
524 'format:Format and convert a CID in various useful ways.'
525 'hashes:List available multihashes.'
527 _ipfs_subcommand _cid_arguments
530 _arguments '(-f --flags)'{-f,--flags}'[Show command flags.]'
534 '--bool[Set a boolean value.]' \
535 '--json[Parse stringified JSON.]'
536 local -a _config_arguments
538 'edit:Open the config file for editing in $EDITOR.'
539 'profile:Apply profiles to config.'
540 'replace:Replace the config with <file>.'
541 'show:Output config file contents.'
543 _ipfs_subcommand _config_arguments
547 '--init[Initialize ipfs with default settings if not already initialized.]' \
548 '--init-config[Path to existing configuration file to be loaded during --init.]' \
549 '--init-profile[Configuration profiles to apply for --init. See ipfs init --help for more.]' \
550 '--routing[Overrides the routing option. Default: default.]' \
551 '--mount[Mounts IPFS to the filesystem.]' \
552 '--writable[Enable writing objects (with POST, PUT and DELETE).]' \
553 '--mount-ipfs[Path to the mountpoint for IPFS (if using --mount). Defaults to config setting.]' \
554 '--mount-ipns[Path to the mountpoint for IPNS (if using --mount). Defaults to config setting.]' \
555 '--unrestricted-api[Allow API access to unlisted hashes.]' \
556 '--disable-transport-encryption[Disable transport encryption (for debugging protocols).]' \
557 '--enable-gc[Enable automatic periodic repo garbage collection.]' \
558 '--manage-fdlimit[Check and raise file descriptor limits if needed. Default: true.]' \
559 '--migrate[If true, assume yes at the migrate prompt. If false, assume no.]' \
560 '--enable-pubsub-experiment[Instantiate the ipfs daemon with the experimental pubsub feature enabled.]' \
561 '--enable-namesys-pubsub[Enable IPNS record distribution through pubsub; enables pubsub.]' \
562 '--enable-mplex-experiment[Add the experimental 'go-multiplex' stream muxer to libp2p on construction. Default: true.]'
565 local -a _dag_arguments
567 'export:Streams the selected DAG as a .car stream on stdout.'
568 'get:Get a dag node from ipfs.'
569 'import:Import the contents of .car files'
570 'put:Add a dag node to ipfs.'
571 'resolve:Resolve ipld block.'
572 'stat:Gets stats for a DAG'
574 _ipfs_subcommand _dag_arguments
577 local -a _dht_arguments
579 'findpeer:Find the multiaddresses associated with a Peer ID.'
580 'findprovs:Find peers that can provide a specific value, given a key.'
581 'get:Given a key, query the routing system for its best value.'
582 'provide:Announce to the network that you are providing given values.'
583 'put:Write a key/value pair to the routing system.'
584 'query:Find the closest Peer IDs to a given Peer ID by querying the DHT.'
586 _ipfs_subcommand _dht_arguments
589 local -a _diag_arguments
591 'cmds:List commands run on this IPFS node.'
592 'sys:Print system diagnostic information.'
594 _ipfs_subcommand _diag_arguments
597 _arguments '(-r --recursive)'{-r,--recursive}'[Resolve until the result is not a DNS link. Default: true.]'
600 _arguments '(-f --flush)'{-f,--flush}'[Flush target and ancestors after write. Default: true.]'
601 local -a _files_arguments
603 'chcid:Change the cid version or hash function of the root node of a given path.'
604 'cp:Copy files into mfs.'
605 "flush:Flush a given path's data to disk."
606 'ls:List directories in the local mutable namespace.'
607 'mkdir:Make directories.'
609 'read:Read a file in a given mfs.'
611 'stat:Display file status.'
612 'write:Write to a mutable file in a given filesystem.'
614 _ipfs_subcommand _files_arguments
617 local -a _filestore_arguments
618 _filestore_arguments=(
619 'dups:List blocks that are both in the filestore and standard block storage.'
620 'ls:List objects in filestore.'
621 'verify:Verify objects in filestore.'
623 _ipfs_subcommand _filestore_arguments
627 '(-o --output)'{-o,--output}'[The path where the output should be stored.]'\
628 '(-a --archive)'{-a,--archive}'[Output a TAR archive.]' \
629 '(-C --compress)'{-C,--compress}'[Compress the output with GZIP compression.]' \
630 '(-l --compression-level)'{-l,--compression-level}'[The level of compression (1-9).]'
634 '(-f --format)'{-f,--format}'[Optional output format.]' \
635 '--peerid-base[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.]'
639 '(-a --algorithm)'{-a, --algorithm}'[Cryptographic algorithm to use for key generation. Default: ed25519.]' \
640 '(-b --bits)'{-b,--bits}'[Number of bits to use in the generated RSA private key.]' \
641 '(-e --empty-repo)'{-e,--empty-repo}"[Don't add and pin help files to the local storage.]" \
642 '(-p --profile)'{-p,--profile}"[Apply profile settings to config. Multiple profiles can be separated by ','.]"
645 local -a _key_arguments
647 'export:Export a keypair'
648 'gen:Create a new keypair'
649 'import:Import a key and prints imported key id'
650 'list:List all local keypairs'
651 'rename:Rename a keypair'
652 'rm:Remove a keypair'
653 'rotate:Rotates the ipfs identity.'
655 _ipfs_subcommand _key_arguments
658 local -a _log_arguments
660 'level:Change the logging level.'
661 'ls:List the logging subsystems.'
662 'tail:Read the event log.'
664 _ipfs_subcommand _log_arguments
668 '(-v --headers)'{-v,--headers}'[Print table headers (Hash, Size, Name).]' \
669 '--resolve-type[Resolve linked objects to find out their types. Default: true.]' \
670 '--size[Resolve linked objects to find out their file size. Default: true.]' \
671 '(-s --stream)'{-s,--stream}'[Enable experimental streaming of directory entries as they are traversed.]' \
675 '(-f --ipfs-path)'{-f,--ipfs-path}'[The path where IPFS should be mounted.]' \
676 '(-n --ipns-path)'{-n,--ipns-path}'[The path where IPNS should be mounted.]'
679 local -a _name_arguments
681 'publish:Publish IPNS names.'
682 'pubsub:IPNS pubsub management.'
683 'resolve:Resolve IPNS names.'
685 _ipfs_subcommand _name_arguments
688 local -a _object_arguments
690 'data:Output the raw bytes of an IPFS object.'
691 'diff:Display the diff between two ipfs objects.'
692 'get:Get and serialize the DAG node named by <key>.'
693 'links:Output the links pointed to by the specified object.'
694 'new:Create a new object from an ipfs template.'
695 'patch:Create a new merkledag object based on an existing one.'
696 'put:Store input as a DAG object, print its key.'
697 'stat:Get stats for the DAG node named by <key>.'
699 _ipfs_subcommand _object_arguments
702 local -a _p2p_arguments
704 'close:Stop listening for new connections to forward.'
705 'forward:Forward connections to libp2p service'
706 'listen:Create libp2p service'
707 'ls:List active p2p listeners.'
708 'stream:P2P stream management.'
710 _ipfs_subcommand _p2p_arguments
713 local -a _pin_arguments
715 'add:Pin objects to local storage.'
716 'ls:List objects pinned to local storage.'
717 'remote:Pin (and unpin) objects to remote pinning service.'
718 'rm:Remove pinned objects from local storage.'
719 'update:Update a recursive pin'
720 'verify:Verify that recursive pins are complete.'
722 _ipfs_subcommand _pin_arguments
725 _arguments '(-n --count)'{-n,--count}'[Number of ping messages to send. Default: 10.]'
729 '--format[Emit edges with given format. Available tokens: <src> <dst> <linkname>. Default: <dst>.]' \
730 '(-e --edges)'{-e,--edges}'[Emit edge format: `<from> -> <to>`.]' \
731 '(-u --unique)'{-u,--unique}'[Omit duplicate refs from output.]' \
732 '(-r --recursive)'{-r,--recursive}'[Recursively list links of child nodes.]' \
733 '--max-depth[Only for recursive refs, limits fetch and listing to the given depth. Default: -1.]'
734 local -a _refs_arguments
735 _refs_arguments='local:List all local references.'
736 _ipfs_subcommand _refs_arguments
739 local -a _repo_arguments
741 'fsck:Remove repo lockfiles.'
742 'gc:Perform a garbage collection sweep on the repo.'
743 'stat:Get stats for the currently used repo.'
744 'verify:Verify all blocks in repo are not corrupted.'
745 'version:Show the repo version.'
747 _ipfs_subcommand _repo_arguments
751 '(-r --recursive)'{-r,--recursive}'[Resolve until the result is an IPFS name. Default: true.]' \
752 '(--dhtrc --dht-record-count)'{--dhtrc,--dht-record-count}'[Number of records to request for DHT resolution.]' \
753 '(--dhtt --dht-timeout)'{--dhtt,--dht-timeout}'[Max time to collect values during DHT resolution eg "30s". Pass 0 for no timeout.]'
756 local -a _stats_arguments
758 'bitswap:Show some diagnostic information on the bitswap agent.'
759 'bw:Print ipfs bandwidth information.'
760 "dht:Returns statistics about the node's DHT(s)"
761 'repo:Get stats for the currently used repo.'
763 _ipfs_subcommand _stats_arguments
766 local -a _swarm_arguments
768 'addrs:List known addresses. Useful for debugging.'
769 'connect:Open connection to a given address.'
770 'disconnect:Close connection to a given address.'
771 'filters:Manipulate address filters.'
772 'peers:List peers with open connections.'
774 _ipfs_subcommand _swarm_arguments
777 local -a _tar_arguments
779 'add:Import a tar file into ipfs.'
780 'cat:Export a tar file from IPFS.'
782 _ipfs_subcommand _tar_arguments
786 '(-n --number)'{-n,--number}'[Only show the version number.]' \
787 '--commit[Show the commit hash.]' \
788 '--repo[Show repo version.]' \
789 '--all[Show all version information.]'