Repoz node client. Can be used both as npm pacakge or client tool
Repoz: http://repoz.dextra.com.br
npm install -g repoz
, may require sudo
Usage: repoz [options] [command]
Commands:
list [options] <project> [urlpath] list (urlpath is optional, default '/')
get [options] <project> <urlpath> [filepath] get (filepath is optional, default basename(urlpath))
post [options] <project> <filepath> <urlpath> post
put [options] <project> <filepath> <urlpath> put
delete [options] <project> <urlpath> delete
help [cmd] display help for [cmd]
Options:
-h, --help output usage information
-V, --version output the version number
repoz post myProject local/sub/folder/another.txt /sub/folder/file.txt
Saves local/sub/folder/another.txt to https://repoz.dextra.com.br/repoz/r/myProject/sub/folder/file.txt
repoz get myProject /sub/folder/file.txt
Downloads https://repoz.dextra.com.br/repoz/r/myProject/sub/folder/file.txt to ./file.txt
repoz delete myProject /sub/folder
Deletes everything under https://repoz.dextra.com.br/repoz/r/myProject/sub/folder
repoz list -r myProject
List all files under https://repoz.dextra.com.br/repoz/r/myProject/ recursively
repoz list myProject /sub/folder
List files only in https://repoz.dextra.com.br/repoz/r/myProject/sub/folder
Credentials are stored into user local home folder, under ~/.repoz
encrypted with aes192
Also the .cipher_key
used for encryption is saved in to the same folder.
Username and password will be prompt only when needed, these are the rules:
- Project has no credentials stored at all.
- There are only read access type credentials stored for a write command.
Access type are read and write operations, and the relations with commands are this:
- read : get, list
- write: post, put, delete
Write access type credentials can be used for read commands. But read access type credentials cannot be used for write commands.
Because this client does not known the access type of the credentials, it tries to guess it. So, for the first time a credential was stored, and it was a read command, then its stored as read access type. But if the same credential its used for write command (after prompt), then the credential gets updated to write access type (and also the password in the process).
Credentials are updated when:
- Password changes
- Access type changes from read to write
npm install --save repoz
var repoz = require('repoz');
var myProject = repoz.project('myProject', 'myUser', 'myPass')
myProject.list(urlpath, recursive)
myProject.get(urlpath, filepath)
myProject.put(filepath, urlpath)
myProject.post(filepath, urlpath)
myProject.delete(urlpath)
Remember that all commands are promises
Same examples from above
myProject.post('local/sub/folder/another.txt', '/sub/folder/file.txt');
myProject.get('/sub/folder/file.txt');
myProject.delete('/sub/folder/');
myProject.list('/', true);
myProject.list('/sub/folder');
- Auto remove all doubles
'//'
- Auto completion of the first
'/'
, so is not needed - Auto fix broken query string
'/?'
for list command - Auto resolve path like
../other/file
and~/another/file
- Credentials are stored, prompt once, use forever
Documentation: http://repoz.dextra.com.br/repoz/docs.html
Install: npm install
, may require sudo
Test: npm test
Coverage: ./run-coverage
Running client: ./bin/repoz
. To run as repoz
only, create a symbolik link with: npm link
, may require sudo
- get 302 test and coverage
- get/download progress bar (https://www.npmjs.com/package/progress)
- debug and silly flag support for winston log