Skip to main content

Cliar lets you create powerful commandline interfaces from regular Python classes. Using type hints, you can add validation and on-the-fly parsing.

Project description

Create CLIs from Python classes. Make them powerful with type hints.

Latest Version License

Cliar is a Python tool that helps you create commandline interfaces:

from cliar import CLI

class Git(CLI):
    '''Git clone created with Cliar'''

    def clone(self, repo, dir='.'):
        '''Clone a git repo from REPO to DIR.'''

        print('Cloning from %s to %s' % (repo, dir))

if __name__ == '__main__':

Run the script:

$ python clone -d baz
Cloning from to baz


Cliar runs with Python 3.5+ on Windows, Linux, and Mac. There are no external dependencies.


Install Cliar from PyPI with pip:

$ pip install cliar

You can install Cliar on CentOS 6 with yum from Gleb Goncharov’s public repo:

$ yum install -y python-cliar

Hello World

from cliar import CLI

class Hello(CLI):
    def hello(self, name='world'):
        print('Hello ' + name + '!')

if __name__ == '__main__':
python hello --name Bob
Hello Bob!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cliar, version 1.1.9
Filename, size File type Python version Upload date Hashes
Filename, size cliar-1.1.9-py3-none-any.whl (6.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cliar-1.1.9.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page