NetDisk in command line.
Self hosted netdisk, pure command line tool to to pull or pull files with Qiniu cloud.
Soon!
$ brew install node
Register a free Qiniu account. Then create a new bucket.
Take bucket name down, then get accessKey and secretKey.
Finally, get your domain:
Take accessKey, secretKey domain and bucket name down, we will use it when config rocket :P.
$ npm install -g rocket-cli
After installation, type:
$ rocket -h
Succeed if you see the following tips.
Usage: rocket [options] [command]
Commands:
init [options] Init config file
config [options] [show] Config Qiniu bucket, domain, access key and secret key
add [options] Add dir or files to index
push [options] Push files to Qiniu cloud
ls [options] List files from local index
pull [options] <key> Pull file from Qiniu cloud
Options:
-h, --help output usage information
-V, --version output the version number
$ rocket init
If the config file already exists, you can use -o
or -overwrite
options to overwrite the old one.
The config file locates at ~/.rocket.json
.
$ rocket config -b <your bucket name> -a <your accessKey> -s <your secretKey> -d <domain>
List your cnfiguration.
$ rocket config show
$ rocket add -d <directory> -r -f <regex expression>
-r
means recursively add files in sub directories.
-f
can set filters using regex expression, use .
for all files.
$ rocket push -m [max upload workers. defailt = 5]
-m
set the maximum number of upload workers.
$ rocket ls -o [offset] -l [limit]
You can use -o
and -l
to set proper offset and limit if there are too much files in local index.
$ rocket pull -d [destination] <key>
This command will download file searched by key to destination directory, default directory is where this file uploaded.
SOON!
PR and issues are welcomed! Join and make it better!
Email [email protected] for support!