Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Latest commit

 

History

History
62 lines (51 loc) · 937 Bytes

README.md

File metadata and controls

62 lines (51 loc) · 937 Bytes

clr

A command line tool for executing custom python scripts.

Getting Started

  • Install clr
$ pip install git+https://github.com/color/[email protected]
  • Create a custom command
# color/src/clr_commands/say.py
class Commands(object):
    descr = "say commands"

    def cmd_hello_world(self):
        print "hello world!"

COMMANDS = Commands()
  • Create clrfile.py in your root directory
# color/clrfile.py
commands = {
  'say': 'clr_commands.say',
}
  • Run your command
$ clr say:hello_world
> hello world!

Useful commands

  • Get available namespaces
$ clr help
  • Get available commands in a namespace
$ clr help namespace

Development

  • Create a virtualenv and activate it
python3 -m venv <location>
source <location>/bin/activate
  • Install dependencies
pip install -r requirements.txt -r test-requirements.txt
  • Run the tests
PYTHONPATH=. pytest .