2019.3.22 • Published 5 years ago

commands-generator v2019.3.22

Weekly downloads
1
License
Unlicense
Repository
-
Last release
5 years ago

npm.io

generate shell commands from scripts

Installation

$ [sudo] pip install commands-generator

Features

  • generate shell commands from scripts
  • shell namespaces - namespace:command. folder names as namespaces

How it works

scripts (shebang #! required):

namespace/script.py
namespace/subnamespace/script.sh

generated commands:

namespace:script
namespace:subnamespace:script

Config

~/.bashrc:

export PATH=path/to/commands:$PATH

CLI

usage: commands-generator scripts_dir commands_dir

Examples

generate ~/.local/share/bin from dotfiles/scripts:

dotfiles/scripts/git/commit.sh
dotfiles/scripts/files/python/setup.cfg/create.sh
dotfiles/scripts/web/github.com/push.sh
$ cd path/to/dotfiles
$ commands-generator scripts ~/.local/share/bin

generated commands:

~/.local/share/bin/git:commit
~/.local/share/bin/files:python:setup.cfg:create
~/.local/share/bin/web:github.com:push

usage:

$ files:python:requirements.txt:create
$ git:commit
$ web:github.com:push

Related projects