CLI tools build in NodeJS for common needs.
Clone and install dependencies to /usr/local/bin/cli-tools (or wherever you want).
git clone https://github.com/Enijar/cli-tools /usr/local/bin/cli-tools
npm install --prefix /usr/local/bin/cli-tools
Add the commands you want by creating symbolic links, e.g. this would provide a command called "batch-download".
ln -sF /usr/local/bin/cli-tools/src/cmd/batch-download /usr/local/bin/batch-download
Now you can use that command like this.
batch-download urls.json ~/Downloads results.json
git --git-dir /usr/local/bin/cli-tools pull
List of available commands.
Note: make sure the command you want to run is installed (follow installation steps) before attempting to run it
Download URLs in parallel (batches of n) to a directory.
Arguments
- URLs file (required): JSON file containing an array of URLs to download
- Downloads directory (required): path to directory that files will be downloaded into
- Results file (optional): JSON file where results will be saved to
- chunkSize (optional): how many files to download in parallel
Example
batch-download urls.json ~/Downloads results.json
Recursively rename files in a directory.
Arguments
- Directory (required): directory to rename files in
- Rename method (required): method of renaming files. See below for options
- sequence (naturally sort files, then rename them from 1 to n)
Example
batch-rename ~/Downloads sequence