{"id":21406866,"url":"https://github.com/kjczarne/mkcommit","last_synced_at":"2025-07-14T00:32:56.613Z","repository":{"id":45408304,"uuid":"407737022","full_name":"kjczarne/mkcommit","owner":"kjczarne","description":"Generate and validate commit messages using the power of Python","archived":false,"fork":false,"pushed_at":"2022-06-26T16:19:45.000Z","size":1249,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T15:34:28.508Z","etag":null,"topics":["cli","command-line","commit","commitizen","commitlint","git","python","python3","validation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kjczarne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-18T02:46:35.000Z","updated_at":"2024-08-06T16:22:48.000Z","dependencies_parsed_at":"2022-08-31T01:24:48.170Z","dependency_job_id":null,"html_url":"https://github.com/kjczarne/mkcommit","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/kjczarne/mkcommit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjczarne%2Fmkcommit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjczarne%2Fmkcommit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjczarne%2Fmkcommit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjczarne%2Fmkcommit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kjczarne","download_url":"https://codeload.github.com/kjczarne/mkcommit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjczarne%2Fmkcommit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227900,"owners_count":23731060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","commit","commitizen","commitlint","git","python","python3","validation"],"created_at":"2024-11-22T16:43:12.803Z","updated_at":"2025-07-14T00:32:51.502Z","avatar_url":"https://github.com/kjczarne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkcommit\r\n\r\n\u003cimg src=\"static/logo.png\" width=\"300\" style=\"display: block;margin-left: auto;margin-right: auto;\"\u003e\r\n\r\n`mkcommit` is an extremely simple tool made for commit message generation.\r\n\r\nRun `mkcommit` instead of `git commit` and you will be asked questions that keep your commits tidy even when it's 3 AM.\r\n\r\n![mkcommit gif](static/mkcommit.gif)\r\n\r\n## Why?\r\n\r\n### Why would anybody need this? Aren't editors enough?\r\n\r\nWhen working in teams it's hard to enforce proper Git commit message style from everyone. This CLI tool asks you questions to build a commit message that you can configure for yourself and your team with a very simple Python script.\r\n\r\n### `commitlint` exists. Why `mkcommit`?\r\n\r\n`commitlint` is a great tool. But it has considerable learning curve if you want to leverage its full potential. This tool strives to be the exact opposite: provide bare minimum with almost no overhead for your teammates. All they will need to learn is this one command: `mkcommit`.\r\n\r\n`mkcommit` is:\r\n\r\n- Easy to install - all you need is Python (at least version 3.6).\r\n- Easy to configure - all you need is basic Python skills or advanced copy-pasting skills.\r\n- Easy to use - all you need is one command to trigger the commit prompt.\r\n- Scalable - it can be as complex as you want it, with full Git Hook integration and complex validation rules or just with a plain default Conventional Commit generation out-of-the-box.\r\n- Pythonic - might suit you better if you're familiar with Python and don't want to venture into the world of JavaScript.\r\n\r\n## Installation\r\n\r\nIf you have Python set up, you're good to go. Run `pip install mkcommit` and you're done.\r\n\r\n## Configuration\r\n\r\n1. At the root of your repository create a Python file named `.mkcommit.py`.\r\n2. Compose the script:\r\n\r\n    - A built-in _conventional commit_ suite can be used:\r\n\r\n        ```python\r\n        from mkcommit import CommitMessage, to_stdout\r\n        from mkcommit.suites import conventional\r\n\r\n        def commit():\r\n            return CommitMessage(*conventional.default())\r\n\r\n        if __name__ == \"__main__\":\r\n            to_stdout(commit())\r\n        ```\r\n\r\n        If you're not familiar with Conventional Commits, here's a [quick guide](https://www.conventionalcommits.org/en/v1.0.0/).\r\n\r\n    - If you need to define your own keywords and commit message template, read [Configuration](https://github.com/kjczarne/mkcommit/wiki/Configuration) in our Wiki.\r\n\r\n        - If you want to learn how to use the hook mode, read [Hooks](https://github.com/kjczarne/mkcommit/wiki/Hooks) in our Wiki.\r\n\r\n    - When you have implemented the file in one repo and want to use the **exact same** file in another repo, you should use `include` e.g.\r\n\r\n        ```python\r\n        from mkcommit import to_stdout, include\r\n\r\n        commit, on_commit = include(\"https://raw.githubusercontent.com/kjczarne/mkcommit/master/test/res/example.semantic.mkcommit.py\")\r\n\r\n        if __name__ == \"__main__\":\r\n            to_stdout(commit())\r\n        ```\r\n\r\n3. Run `mkcommit`. Select the discovered configuration file for the list and follow the interactive prompt.\r\n\r\n## Usage\r\n\r\n- Run `mkcommit` to generate a Git commit message and commit changes (calls `git commit -m` underneath).\r\n- Run `mkcommit -s` to generate a Git commit message and print it to standard output.\r\n- Run `mkcommit -c` to generate a Git commmit message and copy it to your clipboard.\r\n- Use `mkcommit -x \"some commit message\"` to validate an existing commit message from the command line or as a Git Hook command (requires `on_commit(msg)` function to be implemented in the configuration file).\r\n\r\nIf you wish to point `mkcommit` to a specific configuration file, use `mkcommit -f /path/to/.mkcommit.py`. You can combine the `-f` flag with all the other available flags.\r\n\r\nOf course you may use `mkcommit` with [VSCode tasks](https://github.com/kjczarne/mkcommit/wiki/VSCode).\r\n\r\n### Input validation\r\n\r\nThe most basic validation strategy we use is [validation at the time of message generation](https://github.com/kjczarne/mkcommit/wiki/Validators).\r\n\r\nFor validation of commit messages that aren't originally generated with `mkcommit` you can use [Hooks](https://github.com/kjczarne/mkcommit/wiki/Hooks).\r\n\r\n### Built-in suites\r\n\r\nA list of suites that are supported out-of-the-box can be found in our [Wiki](https://github.com/kjczarne/mkcommit/wiki/Suites).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjczarne%2Fmkcommit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjczarne%2Fmkcommit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjczarne%2Fmkcommit/lists"}