Skip to main content


Project description

cli2: Dynamic CLI for Python 3

Expose Python functions or objects with a minimalist argument typing style, or building your own command try during runtime.

Documentation available on RTFD.


cli2 is a little library to build CLIs, which documentation is available on RTFD, but it comes with its own demo command that may as well be useful.

Initially, cli2 was supposed to just bring Python callables on the CLI without even a single line of code:

cli2 arg1 kwarg1=value

This command was implemented again in this 10th rewrite of the CLI engine extracted from Playlabs, however this implementation features something pretty funny: cli2 is a Group subclass which overrides the default Group implementation based on the first argument passed on the command line.

Basically, when you call cli2, it will load a Group of name which whill load one Command per callable in

When you call cli2 it will execute the function.

As a result, these two commands are strictly equivalent:

cli2 cli2.test_node example_function foo=bar
cli2 cli2.test_node.example_function foo=bar

Your challenge is to understand why ;)

Project details

Release history Release notifications | RSS feed

Download files

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

Files for cli2, version 2.2.3.dev1
Filename, size File type Python version Upload date Hashes
Filename, size cli2-2.2.3.dev1.tar.gz (16.8 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 Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page