# skylinkv2-cli

> Skylink V2 CLI Tool =============

Latest version **1.0.3** (published 2021-07-15) · MIT license · 0 weekly downloads

## Install

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

Provides the command `skylinkv2`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-07-15 |
| First published | 2021-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 6 |
| Unpacked size | 17.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | PJ @peterjan |
| Maintainers | peterjanbrone |
| Keywords | skynet, skylink, oclif |

## Links

- npm: https://www.npmjs.com/package/skylinkv2-cli
- Repository: https://github.com/peterjan/skylinkv2-cli
- Issues: https://github.com/peterjan/skylinkv2-cli/issues
- npm.io page: https://npm.io/package/skylinkv2-cli

## Dependencies (6)

- [tslib](https://npm.io/package/tslib.md) ^1
- [skynet-js](https://npm.io/package/skynet-js.md) ^4.0.11-beta
- [@oclif/config](https://npm.io/package/@oclif/config.md) ^1
- [@oclif/command](https://npm.io/package/@oclif/command.md) ^1
- [@nebulous/skynet](https://npm.io/package/@nebulous/skynet.md) ^2.0.1
- [@oclif/plugin-help](https://npm.io/package/@oclif/plugin-help.md) ^3

## 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.3 (latest) — 2021-07-15
- 1.0.2 — 2021-07-15
- 1.0.1 — 2021-07-14
- 1.0.0 — 2021-07-14
- 0.0.0 — 2021-07-13

## README

Skylink V2 CLI Tool
=============

* [Usage](#usage)
* [Commands](#commands)

# Usage
```sh-session
# create key file containing public and private key
# optionally pass a seed
#
$ skylinkv2 keys

# create a V2 skylink under the given "data key"
# using the keys file generated by the 'keys' command
$ skylinkv2 create mybackup

# update a V2 skylink for the given "data key" 
# with the contents of the file at given location
$ skylinkv2 update mybackup ./backup.dat
#
# fetch downloads the contents of a V2 skylink and stores it at given path using
# the datakey and the keys file as input
#
$ skylinkv2 fetch mybackup ./backup_downloaded_.dat

# use --help flag to see usage overview
$ skylinkv2 --help [COMMAND]
```

# Commands

## Keys

Using the `keys` command you can generate a random key pair. This key pair will
get saved in a keyfile, by default written to the current directory as a text
file named 'keys.txt'. All other command parse such a keyfile to get at the
public and private key.

The key pair can be seeded by passing in a seed as argument.  
The location of the key file is configurable using the `keyfile` option.

```sh-session
# write key pair to keys.txt
$ skylinkv2 keys
```

## Create

Using the `create` command you can initialize a V2 Skylink. It will contain a
placeholder Skyfile that sipmly contains the data at which it was created. The
V2 Skylink is created using a data key, passed as an argument. Note that this
argument is optional, if it is not passed a random data key will get generated
and printed upon success.

Note that if the entry already exists, meaning that the V2 Skylink was already
initialized prior to running this command and holds data, we will only overwrite
it with an empty file if the `--force` flag is passed. 

This command uses the keyfile generated by the keys command. The keyfile can be
specified, by default it uses the default key file.

The command will output the data key, the V2 skylink, and the URL at which the
Skyfile can be found. 

```sh-session
# create a v2 skylink
$ skylinkv2 create mybackup
```

## Update

Using the `update` command you can update the contents of a V2 Skylink. It will
upload the contents of the file at given path, and ensure the V2 Skylink will
point at the newly uploaded data. Aside from the location we also pass the data
key to this command. This data key is the one printed by the `create` command.

This command uses the keyfile generated by the keys command. The keyfile can be
specified, by default it uses the default key file.

```sh-session
# update a v2 skylink
$ skylinkv2 update mybackup ./backup.dat
```

## Fetch

Using the `fetch` command you can download the contents of a V2 Skylink. It will
download the contents of the file with skylink that corresponds to the given
datakey.

This command uses the keyfile generated by the keys command. The keyfile can be
specified, by default it uses the default key file.

```sh-session
# fetch the contents of a v2 skylink
$ skylinkv2 fetch mybackup ./backup_downloaded_.dat
```

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