Skip to main content

Klak provides the ergonoics of a project Makefile with the ease of Python and power of Click.

Project description


pypi standard-readme compliant travis-ci docs docs

Klak provides the ergonoics of a project Makefile with the ease of Python and power of Click.

Table of Contents


Makefiles provide a simple interface, make <command>, that is great for automating repetitive project tasks. Makefile syntax, however, is archaic, error-prone, and ill-suited for constructing modern, useful command-line interfaces.

Python, on the other hand, has wonderful syntax and is great for scripting. When Python is paired with Click constructing modern, useful command-line interfaces is easy!

Is there a way we can combine the power of Python and Click into a "Makefile like" experience?

Enter Klak.

Klak exposes a single entry-point—klak—which auto-loads a 100%, vanilla Python file called a Clickfile. All CLI is built using standard Python and Click, and all commands are available via: klak <command> (see Usage).

What is it good for?

Klak's purpose is to provide a convenient, single-file experince for automating repetitive project tasks. It does not, nor will it ever, intend to replace Make or Makefiles.


Stable Release

# NOTE: This is the recommended method of installation.
pip install klak

From Source

Klak uses Poetry to manage depdencies and distribution (in lieu of setuptools).

# NOTE: Clone the public repository
git clone git://

# NOTE: or download the tarball
curl  -OL

# NOTE: Once the source is downloaded
poetry install


To get started with Klak create a Clickfile. Here's a simple Clickfile to get started:

Example Clickfile.

NOTE: Set your editor's language mode to Python to
      enable syntax highlighting! :^)

import logging
import click
from klak.cli import cli

log = logging.getLogger("Clickfile")

# -------------------------------------
# Examples
# -------------------------------------

# Example: Add a command.
def greet(name):
    """Greet someone."""
    click.secho(f"Hello, {name}")

# Example: Add a group and sub-command.
def humans():
    """Humans command group."""

def humans_count():
    """Count all the humans."""
    click.secho("Over 9000!!!")

NOTE: You can also organize commands into a python package in the same directory. See Klak/Pull/229.

Once your Clickfile is ready, access commands through klak.

$ klak --help


This project is a hobby/passion project which I maintain in my own time.


  • Python 3.5+


  • Linux ✓
  • MacOS ✓
  • Windows ✘ (any volunteers?)




See the contributing file!

PRs accepted!

Please note, if editing the README, please conform to the standard-readme specification.


MIT © 2018, 2019

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 klak, version 0.4.3
Filename, size File type Python version Upload date Hashes
Filename, size klak-0.4.3-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size klak-0.4.3.tar.gz (5.3 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