Skip to content

CLI tools built with NodeJS for common needs.

Notifications You must be signed in to change notification settings

enijar/cli-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Tools

CLI tools build in NodeJS for common needs.

Requirements

git v2.16.0+

Node v12.13.0+

Installation

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

Updating

git --git-dir /usr/local/bin/cli-tools pull

Commands

List of available commands.

Note: make sure the command you want to run is installed (follow installation steps) before attempting to run it

batch-download

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

batch-rename

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

About

CLI tools built with NodeJS for common needs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published