UNPKG

2.15 kBMarkdownView Raw
1<h3 align="center">A command line tool for upload file to IPFS Cluster use the IPFS Cluster HTTP API.</h3>
2
3[![NPM Version](https://img.shields.io/npm/v/@4everlink/cli)](https://www.npmjs.org/package/@4everlink/cli)
4[![Install Size](https://packagephobia.now.sh/badge?p=@4everlink/cli)](https://packagephobia.now.sh/result?p=@4everlink/cli)
5![License](https://img.shields.io/npm/l/@4everlink/cli)
6
7
8Read this in other languages: English | [简体中文](./README_ZH-CN.md)
9## install
10
11```
12npm install -g @4everlink/cli
13```
14
15## Command
16
17##### **`add`**
18```
19$ 4everlink --help
20Usage: add [options] <file>
21Options:
22 -V, --version output the version number
23 -d, --debug output extra debugging
24 -p, --path <path> wrapper dir (default: "/")
25 --host <host> ipfs cluster api host (default: "")
26 --port <port> ipfs cluster api port (default: "")
27 --showAll show all file cid
28 -t, --token <token> ipfs cluster api base auth token (default: "")
29 -r, --recursive recursive all sub dir
30 -a, --all include hidden file
31 -h, --help output usage information
32```
33output data:
34```
35{
36 path: 'web',
37 hash: 'QmdiRp2QU1pYb4r1Hmbfah3Ckqq2p56vDSBarm4VWHSdWg',
38 size: 1042
39}
40```
41or use `showAll`
42```
43[
44 {
45 path: 'web/index.html',
46 hash: 'QmZJZG6WuiKMgXw4YANsgJQE98hmahBN7icxPtx4RoDR4M',
47 size: 430
48 },
49 {
50 path: 'web/main.css',
51 hash: 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH',
52 size: 6
53 },
54 {
55 path: 'web/main.js',
56 hash: 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH',
57 size: 6
58 },
59 {
60 path: 'web/sub.html',
61 hash: 'QmY3Gn49Dx4ybPwZ8AQ9kFjjWRhr7Y1vVVYp5N9yyYMSg6',
62 size: 393
63 },
64 {
65 path: 'web',
66 hash: 'QmdiRp2QU1pYb4r1Hmbfah3Ckqq2p56vDSBarm4VWHSdWg',
67 size: 1042
68 }
69]
70```
71
72`host`, `port`, `token` support load from config file, default config file is `~/.4everlink/conf.yaml`, for example:
73```yaml
74host: "127.0.0.1"
75port: 9094
76token: ""
77```
78The env `4EVERLINKCONF` set custom config file path, for example:
79`export 4EVERLINKCONF=/custom/path`, the config file is `/custom/path/conf.yaml`.
80
81## License
82
83[MIT](LICENSE)