Skip to content
/ poly Public

Manage all your command line tools easily in one place!

Notifications You must be signed in to change notification settings

ketanv3/poly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poly

Python Version Coverage Maintainability

Manage all your command line tools easily in one place!

Quick Start Guide

Easy Install

Poly can be installed easily with the following command:

curl https://raw.githubusercontent.com/ketanv3/poly/master/scripts/install.sh -o install-poly.sh && chmod 755 ./install-poly.sh && ./install-poly.sh

Depending on your configuration, you might need to run this command with sudo. If this fails for you, follow the manual install procedure given below.

Workspace

POLY_WORKSPACE environment variable defines the root directory that containing all your executable commands. Add it to .bashrc / .zshrc or similar so that it's sourced every time a new shell is launched.

export POLY_WORKSPACE=~/poly_ws/

A workspace contains bunch of folders and files (leaf nodes) which form the searchable command path.

↳ poly_ws
   ↳ foo
      ↳ bar
         ↳ hello_world.py
   ↳ code
      ↳ vscode.py
      ↳ intellij.py
   ↳ base64
      ↳ encode.py
      ↳ decode.py

Creating Commands

Creating these commands is pretty easy in itself. We use Click library to generate command line utilities.

Here's a simple hello-world.py example:

import click

@click.command()
@click.option('--name', required=True)
@click.option('--count', default=1)
def command(name, count):
    for i in range(count):
        print(f'Hello, {name}!')

Executing Commands

To execute the above command:

poly foo bar hello_world --name poly --count 5

Manual Installation

Make sure you're running Python 3.6+. Run the following command to confirm.

python --version

Once Python version is confirmed, clone the project and run the following commands from the root directory of the project:

python setup.py install

That's it! Poly should now be installed! Confirm by running the following command:

poly

Running Tests

To build the module and run the tests, run the following command:

python setup.py test

Alternatively, tests can be run without building the module. To also report the code coverage, use the following command:

python -m pytest --cov=poly --cov-report term-missing

Issues and Suggestions

If you encounter any issues or have suggestions, please file an issue along with a detailed description. Remember to apply labels for easier tracking.

Versioning

We use SemVer for versioning. For the available versions, see the tags on this repository

Authors

See the list of contributors who participated in this project.

About

Manage all your command line tools easily in one place!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published