Skip to content
Simple framework for building scalable CLI tool.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Update multi module example Jul 13, 2019
examples Fix lint error Jul 13, 2019
tests Support long and short description Jun 30, 2019
uroboros Update multi module example Jul 13, 2019
.gitignore init Jun 22, 2019
.travis.yml Fix travis deploy error Jul 13, 2019
LICENSE Fix typo 😂 Jun 24, 2019
Pipfile Add dev packages for Pipfile Jun 24, 2019
Pipfile.lock Add dev packages for Pipfile Jun 24, 2019
entry_points.cfg Add Jun 24, 2019
setup.cfg Add Jun 24, 2019


Build Status PyPI pyversions PyPI version GitHub license

Simple framework for building scalable CLI tool.

This framework currently under development. Please be careful to use.


  • Simple interface
  • Pure python
    • Thin wrapper of argparse
    • No third party dependencies
  • Easy to reuse common options
  • Easy to create sub commands
    • Nested sub command is also supported


  • Python >= 3.5
    • No support for python 2.x

Install uroboros

$ pip install uroboros

How to use

Implement your command using uroboros.Command and create a command tree.

from uroboros import Command
from uroboros.constants import ExitStatus

class RootCommand(Command):
    """Root command of your application"""
    name = 'sample'
    long_description = 'This is a sample command using uroboros'

    def build_option(self, parser):
        """Add optional arguments"""
        parser.add_argument('--version', action='store_true', default=False, help='Print version')
        return parser

    def run(self, args):
        """Your own script to run"""
        if args.version:
            print("{name} v{version}".format(
      , version='1.0.0'))
        return ExitStatus.SUCCESS

class HelloCommand(Command):
    """Sub command of root"""
    name = 'hello'
    short_description = 'Hello world!'
    long_description = 'Print "Hello world!" to stdout'

    def run(self, args):
        return ExitStatus.SUCCESS

# Create command tree
root_cmd = RootCommand()

if __name__ == '__main__':

Then, your command works completely.

$ python -h
usage: sample [-h] [--version] {hello} ...

This is a sample command using uroboros

optional arguments:
  -h, --help  show this help message and exit
  --version   Print version

Sub commands:
    hello     Hello world!
$ python --version
sample v1.0.0
$ python hello
Hello world!

If you want to use new sub command hello xxxx, you just implement new XXXXCommand and add it to Hello.

root_cmd = RootCommand().add_command(

You can see other examples in examples.


First, clone this repository and install uroboros with editable option.

$ git clone
$ cd /path/to/uroboros
$ pip install -e .

Use Pipenv for lint and test.

# Create environment
$ pipenv install --dev
# Execute lint by flake8
$ pipenv run lint
# Execute test by py.test
$ pipenv run test

Also support test with tox. Before execute test with tox, you should make available to use python 3.5 and 3.6, 3.7.


Apache 2.0


Shoma Kokuryo

You can’t perform that action at this time.