Skip to main content


Project description


And `djcli

And `yash

Left for posterity

clilabs: the python CLI that gets things done.

Sometimes I want to execute a python callback with some args on the command
line, but i get frustrated that it always requires to wrap my command in a
wrapper of some sort. Clilabs unfrustrates me.


$ pip install clilabs


$ clilabs
clilabs automates python callables parametered calls.

Things starting with - will arrive in clilabs.context.


clilabs help your.mod:main
clilabs debug your.mod -a --b --something='to see' how it=parses
clilabs your.mod:funcname with your=args
clilabs help clilabs.django
clilabs help django
clilabs clilabs.django:list auth.user
clilabs django:list auth.user # also works
# refer to the root one
clilabs ~django.db.models:somefunc somearg some=kwarg


$ clilabs debug ~your.mod:yourfunc -a --b --something='to see' how it=parses
Could not import your.mod
Args: ('how',)
Kwargs: {'it': 'parses'}
Context args: ['a', 'b']
Context kwargs: {'something': 'to see'}

Moar in

Making your own command

Add to your

'console_scripts': [
'yourcmd = yourpkg.cli:cli',

Add in yourpkg/

'''Your documentation that shows by default:

yourcmd somefunc ...
import clilabs

def cli(*argv):
argv = list(argv) if argv else ['help', 'yourpkg.cli']
cb = clilabs.modfuncimp(*clilabs.funcexpand(argv[0], 'yourpkg.cli'))
args, kwargs = clilabs.expand(*argv[1:])
return cb(*args, **kwargs)

def main(...):
'''Put your help text, that will show when the
user runs the command without argument.'''

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 clilabs, version 1.0.1.dev1
Filename, size File type Python version Upload date Hashes
Filename, size clilabs-1.0.1.dev1.tar.gz (7.9 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