commandoro 1.1.0
Console utility for working with command packages. Storage, execution, autorun.
License: BSD-3-Clause
Requires Python: >=3.6
Keywords: commandoro,smartlegion,command execution

# commandoro

***

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegion/commandoro)](https://github.com/smartlegion/commandoro/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/commandoro?label=pypi%20downloads)](https://pypi.org/project/commandoro/)
[![GitHub](https://img.shields.io/github/license/smartlegion/commandoro?style=flat-square)](https://github.com/smartlegion/commandoro/blob/master/LICENSE)
![GitHub top language](https://img.shields.io/github/languages/top/smartlegion/commandoro)
[![PyPI](https://img.shields.io/pypi/v/commandoro)](https://pypi.org/project/commandoro)
[![PyPI - Format](https://img.shields.io/pypi/format/commandoro)](https://pypi.org/project/commandoro)
[![GitHub Repo stars](https://img.shields.io/github/stars/smartlegion/commandoro?style=social)](https://github.com/smartlegion/commandoro/)
[![GitHub watchers](https://img.shields.io/github/watchers/smartlegion/commandoro?style=social)](https://github.com/smartlegion/commandoro/)
[![GitHub forks](https://img.shields.io/github/forks/smartlegion/commandoro?style=social)](https://github.com/smartlegion/commandoro/)

***

## Short description:
[___commandoro___](https://smartlegion.github.io/commandoro/) - Console utility for working with command packages. Storage, execution, autorun.

***

Author and developer: ___Aleksandr Suvorov (Smart Legion).___

[![mysmartlegion@ya.ru](https://img.shields.io/static/v1?label=email&message=mysmartlegion@ya.ru&color=blue)](mailto:mysmartlegion@ya.ru)

[![https://smartlegion.github.io/](https://img.shields.io/static/v1?label=Url:&message=smartlegion.github.io&color=blue)](https://smartlegion.github.io/)

***

## Help the project financially:

[<img src="https://img.shields.io/liberapay/patrons/smartlegion.svg?logo=liberapay">](https://liberapay.com/smartlegion/donate)
[![PayPal](https://img.shields.io/static/v1?label=PayPal&message=donate&color=green)](https://paypal.me/smartlegioner)
[![Yandex](https://img.shields.io/static/v1?label=Yandex&message=donate&color=yellow)](https://yoomoney.ru/to/4100115206129186)
[![Visa](https://img.shields.io/static/v1?label=Visa&message=4048-0250-0089-5923&color=blue)](https://yoomoney.ru/to/4100115206129186)
[![Donate](https://img.shields.io/static/v1?label=SmartLegion&message=donate&color=blue)](https://smartlegion.github.io/donate/)


- __Pay Pal__: [https://paypal.me/smartlegioner](https://paypal.me/smartlegioner)
- __Liberapay__: [https://liberapay.com/smartlegion/donate](https://liberapay.com/smartlegion/donate)
- __Donate__: [https://smartlegion.github.io/donate/](https://smartlegion.github.io/donate/)
- __Yandex Money__: [https://yoomoney.ru/to/4100115206129186](https://yoomoney.ru/to/4100115206129186)
- __Visa__: 4048 0250 0089 5923

***

## Supported:

- Linux: All.
- Windows: 7/8/10.
- Termux (Android).

***

## Requirements:

- [Python](https://python.org) 3.6+
  - [download](https://python.org)

__Use pip or pip3:__

- [click](https://github.com/pallets/click) 8.0.1
  - `pip3 install click~=8.0.1`
- [commandpack](https://github.com/smartlegion/commandpack/) 0.0.6
  - `pip3 install commandpack~=0.0.6`
    
***

## Images:

![commandoro image](https://github.com/smartlegion/commandoro/raw/master/data/images/commandoro.png)

***

## What's new?

### ___commandoro v1.1.0___

***

### Warning!:
All versions up to 1.2.0 are working, but experimental.

***

## Description:

[___commandoro___](https://smartlegion.github.io/commandoro/) - Console utility for working with command packages. Storage, execution, autorun.

The utility uses the package: [commandpack](https://github.com/smartlegion/commandpack).

Author and developer: ___Aleksandr Suvorov (Smart Legion).___

***

Store your commands in one place for automatic
or manual launch and execution at any time.

It is convenient to store and run many commands for
automatic execution after system installation.

Recommended for use on `*nix` systems.

***

___File___ - a file in format 1 or 2 with the correct structure.

***

___A command package___ - name for grouping commands in a file.

***

___Command___ - a command to be executed in the console or terminal.

***

Create one or several files and store the necessary commands 
in them under names (in packages).  
The file must have the correct structure. 
At the moment, the simplest `*.cfg` and `*.json` are supported.

The file must have the correct structure.

***

`*.cfg` - The simplest file with command packages:

    [package name 1]
    command 1
    command 2
    command N
    [package name 2]
    command 1
    command 2
    command N

***

`*.json` - The simplest file with command packages:

```json
{
    "pack1":
      [
        "command1",
        "command2"
      ],
    "pack2":
      [
        "command1",
        "command2"
      ]
}
```

***

Packages:

Package names are placed in square brackets,
below the name are the commands included in this package.


***

Commands:

The commands are grouped under the desired names in packages.

***

## Help:

### Install and Use:

#### Build your command packages using example file:

- [example.cfg](https://github.com/smartlegion/commandoro/blob/master/data/configs/example.cfg)


A warning! If the command package name or file name 
contains spaces or invalid characters,
when typing a terminal, enclose it in quotation marks.

Try to name your packages and files with short, meaningful names.

#### Variant 1:

- `pip3 install commandoro`

- `commandoro [options] [path to the file]`

#### Variant 2:

- `git clone https://github.com/smartlegion/commandoro`
- `cd commandoro`
- `pip3 install -r requirements.txt`
- `python3 commandoro.py [options] [path to the file]`

Variant 3:

- download [the source code](https://github.com/smartlegion/commandoro/)
- Unpack
- `pip3 install -r requirements.txt`
- `python3 commandoro.py [options] [your command package file]`

### Termux support:

#### Variant 1:

- Install [Termux](https://termux.com)
- `pkg install python`
- `pip install commandoro`
- `commandoro [options] [your command package file]`
- Create a file with the command packages using the allowed syntax, or use the existing one.
- To access the file storage:
    `termux-setup-storage`, `cd ~/storage`
   
#### Variant 2

- Install [Termux](https://termux.com)
- `pkg install python`
- `pkg install git`
- `git clone https://github.com/smartlegion/commandoro`
- `cd commandoro/`
- `pip install -r requirements.txt`
- Create a file with the command packages using the allowed syntax, or use the existing one.
- To access the file storage:
    `termux-setup-storage`, `cd ~/storage`
- `python commandoro.py --help`

### Windows support:

- Install [python](https://python.org)
- `win + r`
- enter: `cmd`
- `pip install commandoro`
- Create a file with the command packages [using the allowed syntax](https://github.com/smartlegion/commandoro/blob/master/data/configs/commands.cfg), or use the existing one.
- `commandoro [command] [arguments] [file]`

___To run the file use the command:___

`commandoro [command] [arguments] [file]`

or

`python3 commandoro.py [command] [arguments] [file]`


___Example:___

`commandoro run --no-auto commands.cfg`

or

`python3 commandoro.py run --no-auto commands.cfg`


A warning! If the file name contains spaces or invalid characters,
when typing a terminal, enclose it in quotation marks.

#### Help output:

    Usage: commandoro.py [OPTIONS] COMMAND [ARGS]...
    
    Options:
      --version   Show the version and exit.
      -h, --help  Show this message and exit.
    
    Commands:
      create  Use: commandoro edit -h, for help
      edit    Use: commandoro edit -h, for help
      run     Use: commandoro start -h, for help
      show    Use: commandoro show -h, for help
      url     Use: commandoro url -h, for help

***

#### Commands:

___run___ - Run command batch execution from a file.

    Usage: commandoro.py run [OPTIONS] FILE

      Run command batch execution from a file.
    
    Options:
      -a, --add-list TEXT  The name of the package to run.
      -e, --exc-list TEXT  The name of the package to exclude from startup.
      --auto / --no-auto   Automatic / Manual execution.
      -h, --help           Show this message and exit.

___show___ - Viewing command packages contained in a file without executing them.

    Usage: commandoro.py show [OPTIONS] FILE

      Viewing packs and commands from file.
    
    Options:
      -a, --add-list TEXT  The name of the package to run.
      -e, --exc-list TEXT  The name of the package to exclude from startup.
      -h, --help           Show this message and exit.

___edit___ - Editing of a file with command packages in the default editor with 
the possibility of subsequent launch.

    Usage: commandoro.py edit [OPTIONS] FILE

      Editing of a file with command packages in the default editor with the
      possibility of subsequent launch.
    
    Options:
      -h, --help  Show this message and exit.


___create___ - Creation and editing of a file with command packages in the default 
editor with the possibility of subsequent launch.

    Usage: commandoro.py create [OPTIONS] NAME
    
      Use: commandoro create -h, for help.
    
      Creation and editing of a file with command packages in the default editor
      with the possibility of subsequent launch.
    
      NAME - the file name.
    
      Example:     python3 commandoro.py create commands.cfg
    
    Options:
      -h, --help  Show this message and exit.


___url___ - Opens the help page on the project site in the default browser:

    Usage: commandoro.py url [OPTIONS]
    
      Use: commandoro url -h, for help
    
    Options:
      -h, --help  Show this message and exit.



***

#### Arguments:

Using the `-a` option when starting the utility,
you can specify which command package to run using
the existing package name from the file. Use the option multiple
times to add multiple packages:

`commandoro run -a name1 -a name2 -a name3 file.cfg`

or 

`python 3 commandoro.py run -a name1 -a name2 -a name3 file.cfg`

Using the `-e` parameter, you can specify which command package
to exclude using the existing package name from the file.
Use the option multiple times to exclude multiple packages:

`commandoro run -e name1 -e name2 -e name3 file.cfg`

or 

`python run commandoro.py run -e name1 -e name2 -e name3 file.cfg`

A warning! If the command package name contains spaces or invalid characters,
when typing a terminal, enclose it in quotation marks.

The `--no-auto` option will cancel autorun of commands from the package.

Before executing each package and each command
the utility will ask for permission to execute.

The default is to autorun packages and commands `--auto`.


***

## Links:

- ___Github___: [https://github.com/smartlegion/](https://github.com/smartlegion/)
- ___Url___: [https://smartlegion.github.io/](https://smartlegion.github.io/)
- ___PyPi___: [https://pypi.org/user/smartlegion/](https://pypi.org/user/smartlegion/)
- ___Donate___: [https://smartlegion.github.io/donate/](https://smartlegion.github.io/donate/)

***

## Disclaimer of liability:

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

***

## Information:

    =======================================================
    Copyright © 2021 Aleksandr Suvorov
    =======================================================