# peer-cli

> Swiss Army Knife for IPFS

Latest version **1.0.5** (published 2022-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install peer-cli
pnpm add peer-cli
yarn add peer-cli
bun add peer-cli
```

Provides the command `peer-cli`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-12-05 |
| First published | 2022-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 17 |
| Unpacked size | 81.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mert Köklü |
| Maintainers | justmert |
| Keywords | IPFS, PEER, CLI |

## Links

- npm: https://www.npmjs.com/package/peer-cli
- npm.io page: https://npm.io/package/peer-cli

## Dependencies (17)

- [tmp](https://npm.io/package/tmp.md) ^0.2.1
- [async](https://npm.io/package/async.md) ^3.2.4
- [figlet](https://npm.io/package/figlet.md) ^1.5.2
- [libp2p](https://npm.io/package/libp2p.md) ^0.40.0
- [inquirer](https://npm.io/package/inquirer.md) ^9.1.4
- [cli-color](https://npm.io/package/cli-color.md) ^2.0.3
- [ipfs-core](https://npm.io/package/ipfs-core.md) ^0.17.0
- [tar-stream](https://npm.io/package/tar-stream.md) ^2.2.0
- [@koush/wrtc](https://npm.io/package/@koush/wrtc.md) ^0.5.3
- [preferences](https://npm.io/package/preferences.md) ^2.0.2
- [multiformats](https://npm.io/package/multiformats.md) ^10.0.2
- [@libp2p/mplex](https://npm.io/package/@libp2p/mplex.md) ^7.0.0
- [@libp2p/websockets](https://npm.io/package/@libp2p/websockets.md) ^5.0.0
- [@libp2p/webrtc-star](https://npm.io/package/@libp2p/webrtc-star.md) ^5.0.3
- [inquirer-fuzzy-path](https://npm.io/package/inquirer-fuzzy-path.md) ^2.3.0
- [@chainsafe/libp2p-noise](https://npm.io/package/@chainsafe/libp2p-noise.md) ^10.0.1
- [inquirer-command-prompt](https://npm.io/package/inquirer-command-prompt.md) ^0.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2022-12-05
- 1.0.4 — 2022-11-22
- 1.0.2 — 2022-11-22
- 1.0.1 — 2022-11-22
- 1.0.0 — 2022-11-20

## README

# Peer CLI

Swiss Army knife for the IPFS.

- [Peer CLI](#peer-cli)
  - [Install](#install)
  - [Features](#features)
    - [Upload File/Dir To The IPFS](#upload-filedir-to-the-ipfs)
    - [Show/Save File/Dir Contents from the IPFS](#showsave-filedir-contents-from-the-ipfs)
    - [List in the IPFS](#list-in-the-ipfs)
    - [Navigate in IPFS MFS](#navigate-in-ipfs-mfs)

## Install

```bash
npm install -g peer-cli
```

## Features

### Upload File/Dir To The IPFS

You can easily upload file or directory to the IPFS.

With fuzzy search, you can easily find the file you want to upload to the IPFS. Also, progress bar is shown while uploading.

![Peer-CLI Upload](media/upload.gif)

<br>

### Show/Save File/Dir Contents from the IPFS

You can easily show/save file or directory contents from the IPFS with given [CID](https://docs.ipfs.tech/concepts/content-addressing/#content-addressing-and-cids). Also, you can save the listed contents to your local file system.

![Peer-CLI Get](media/get.gif)

<br>

### List in the IPFS

You can easily list file or directory contents in the IPFS with given [CID](https://docs.ipfs.tech/concepts/content-addressing/#content-addressing-and-cids).

- If the given CID is a file, you can either save the file, or show the file contents.
- If the given CID is a directory, you can save the contents to your local file system, or navigate to the directory.

![Peer-CLI List](media/list.gif)

<br>

### Navigate in IPFS MFS

Because files in IPFS are content-addressed and immutable, they can be complicated to edit. Mutable File System (MFS) is a tool built into IPFS that lets you treat files like you would a regular name-based filesystem — you can add, remove, move, and edit MFS files and have all the work of updating links and hashes taken care of for you ([Source](https://docs.ipfs.tech/concepts/file-systems/#mutable-file-system-mfs)).

This feature lets you easily manipulate files in the IPFS MFS like you are using Unix shell! The commands are very similar, thus you will not have any difficulty using them.

Available commands are:

> (...) indicates that the command can take multiple arguments. (e.g. `ls` can take multiple paths)

| Command | Options                    | Explanation                             |
| ------- | -------------------------- | --------------------------------------- |
| ls      | optional: \[path, ...\]    | List directory contents                 |
| cd      | \[path\]                   | Change directory                        |
| pwd     |                           | Output the current working directory    |
| mkdir   | \[path, ...\]              | Make directory                          |
| rm      | \[path, ...\]              | Remove file or directory                |
| stat    | \[path, ...\]              | Get file or directory statistics        |
| flush   | \[path, ...\]              | Flush a given path's data to the disk   |
| read    | \[path, ...\]              | Read a file                             |
| cat     | \[path, ...\]              | Alias for read                          |
| touch   | \[path, ...\]              | Update the mtime of a file or directory |
| write   | \[path\]                   | Write to an MFS path                    |
| open    | \[path\]                   | Alias for write                         |
| cp      | \[path\] \[to\]            | Copy files from one location to another |
| mv      | \[path\] \[to\]            | Move files from one location to another |
| help    | optional: \[command, ...\] | Show help                               |
| man     | optional: \[command, ...\] | Alias for help                          |
| clear   |                            | Clear the screen                        |
| exit    |                            | Exit the MFS shell                      |

![Peer-CLI MFS](media/mfs.gif)

---
_Source: https://npm.io/package/peer-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
