mk ease contributing to any open source repository by exposing most common actions you can run. Inspired by make, tox and other cool tools!
Find a file
Sorin Sbarnea 9a543a36d1
Some checks failed
push / ack (push) Has been cancelled
tox / prepare (push) Has been cancelled
tox / ${{ matrix.name }} (push) Has been cancelled
tox / check (push) Has been cancelled
Fix integration test (#287)
2025-03-25 15:02:11 +00:00
.config [pre-commit.ci] pre-commit autoupdate (#274) 2025-03-25 14:53:04 +00:00
.github Enable renovate (#271) 2024-12-29 10:42:32 +00:00
.vscode Add 'container check' command for checking size and number of layers (#249) 2024-09-25 17:33:52 +01:00
docs Add 'container check' command for checking size and number of layers (#249) 2024-09-25 17:33:52 +01:00
playbooks [pre-commit.ci] pre-commit autoupdate (#252) 2024-12-24 20:24:40 +00:00
samples Fix integration test (#287) 2025-03-25 15:02:11 +00:00
src/mk Add 'container check' command for checking size and number of layers (#249) 2024-09-25 17:33:52 +01:00
test Increase test timeout (#267) 2024-12-25 13:45:47 +00:00
tools Add ability to recognize shell scripts under tools (#43) 2021-04-09 17:00:45 +01:00
.ansible-lint Update pre-commit hooks (#214) 2024-06-17 15:13:12 +01:00
.flake8 Migrate to pyproject.toml pep-621 (#102) 2023-03-05 15:33:55 +00:00
.gitignore Add command to produce CHANGELOG.md file (#239) 2024-09-03 16:19:10 +01:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate (#274) 2025-03-25 14:53:04 +00:00
.prettierrc.yaml Integrate gh-pre tool in mk (#220) 2024-06-18 12:56:43 +01:00
.readthedocs.yml Add command to produce CHANGELOG.md file (#239) 2024-09-03 16:19:10 +01:00
.tool-versions Update dependency github-cli to v2.64.0 (#272) 2024-12-29 11:03:38 +00:00
.yamllint Update pre-commit hooks (#214) 2024-06-17 15:13:12 +01:00
codecov.yml Add support for taskfile tool (#120) 2023-03-07 16:08:12 +00:00
cspell.config.yaml Update pre-commit hooks (#214) 2024-06-17 15:13:12 +01:00
LICENSE Create LICENSE 2021-03-30 15:53:39 +01:00
MANIFEST.in Initial braindump 2020-06-07 12:39:05 +01:00
mkdocs.yml Integrate gh-pre tool in mk (#220) 2024-06-18 12:56:43 +01:00
mypy.ini Remove support for py39 (#269) 2024-12-25 14:47:17 +00:00
pyproject.toml [pre-commit.ci] pre-commit autoupdate (#274) 2025-03-25 14:53:04 +00:00
tox.ini Replace pip-compile with uv (#268) 2024-12-26 10:37:25 +00:00

Documentation of mk tool

mk is a CLI tool that aims to ease contribution and maintenance for projects by hiding repository implementation details from the casual contributor. With it, you can contribute without having to know all the build and testing tools that the project team already uses, which often have strange requirements.

mk-command-line-screenshot

If you ever asked yourself one of the below questions, probably you would want to try mk and if it can help you

  • How do I run tests locally?
  • Which are the test suites I can run?
  • Is my change ready to be reviewed?
  • How can I propose a change for review?

Run mk inside any cloned repository to display which options you have. No configuration file is needed as the tool will look for common tools used by the repository and expose their commands.

mk is inspired by tools such make, waf, taskfile, tox, nox, npm, yarn and pre-commit, but it does not aim to replace them. Instead, it aims to provide a unified interface for calling them that is friendly even for those that never used these tools.

Installation

We recommend using pipx to install mk to avoid potential dependency conflicts. You can use pip3 install --user mk as well.

pipx install mk

How it works

mk inspects the current core repository and detects build tools used by the project, like pre-commit, tox, npm and exposes their commands to the user in a predictable way.

For example, you should be able to lint any code repository running only mk lint, regardless of author preference for picking one way to execute them or another.

Be assured that mk does not make use of AI to guess what needs to run. As most projects use relatively similar patterns, it is easy to identify the one to execute.

At this moment, if two tools expose the same command name, the tool will add a number to its name. In the future, we may decide to either chain them under a single name or allow some tools to shadow others and avoid duplicates.

What are the main benefits

One of the benefits of mk is that it should reduce the amount of how-to-contribute documentation the author needs to write.

A considerable amount of maintainer effort can go into producing documentation that makes it easier for someone to contribute.

Some projects are less affected than others. That is usually related to how well the potential contributors know the practices used by the project. Still, if your project has a wide range of uses, you will quickly discover that newbie contributors may hit a knowledge wall. Such a barrier will likely prevent most of them from becoming active contributors. The remaining ones will flood the project with questions, distracting other maintainers from doing more advanced tasks.

Unless you want to deter contributions, you should plan to make it as easy as possible for people to contribute. That is one area where mk aims to help.

Aliases

Similar to git aliases, mk allows typing as little as possible by automatically aliasing commands. For example, you can run mk lint just by typing mk l as long there is no other command starting with the same letter. Aliases are available for one, two and three letters prefixes.

Using mk to propose changes to projects

Instead of writing a long list of tasks to follow, we can use a tool that tells him what to do next. For example, mk has a built-in command named up(load) that aims to ease preparing a local change from being proposed to the project.

This command detects if it should use GitHub workflow or Gerrit and will run the appropriate commands for opening or updating a CR/PR. Users will be allowed to upload a change only after passing the minimal set of local tests, preventing noisy mistakes or clog CI/CD pipelines.

In addition to linting, it will also check that the repository is not in dirty status or that the testing did not leave untracked files.

Planned features

  • A persistent state of each command run - This means that it will know if a specific command was run and if it failed or not. The state would be linked to the repository state, so modifying a tracked file would reset the state to be unknown. (#20)
  • Configuration file where additional actions can be added. (#21)
  • Dependencies between commands. While some tools support dependencies, many do not. You should be able to declare that a specific command will run only after another one already passed. (#22)
  • Ability to generate CI/CD pipelines so the user would spend less time writing non-portable configurations. (#23)