Let's be honest. We've all been there:
git commit -m "update"git commit -m "fixed stuff"git commit -m "asdfghjkl"(in a moment of pure despair)
gen-commit was born from the tears of countless mysterious merge conflicts and the desperate need for someone (or something) to make our commit history look like we actually know what we're doing. You're welcome.
gen-commit [OPTIONS]-h, --help: Show help message-m, --model MODEL: Specify the model to use with llm command-p, --print: Print the generated message only-D, --debug: Special debug mode (no real committing etc.)-v, --verbose: Show all output-a, --all: Analyze all changes (staged + unstaged + untracked)-c, --commit: Automatically commit without confirmation-s, --scope SCOPE: Specify scope for commit message-n, --note NOTE: Provide additional context/hint for the LLM
# Interactive mode
gen-commit
# Analyze all changes (staged, unstaged & untracked)
gen-commit -a
# Auto-commit changes
gen-commit -c
# Print only (no commit)
gen-commit -p
# Use specific scope
gen-commit -s frontend
# Provide additional context to the LLM
gen-commit -n "focus on performance improvements"Add to your NixOS configuration:
{
inputs = {
gen-commit = {
url = "github:rodeyseijkens/gen-commit";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
{ inputs, ... }:
{
# In your NixOS module
programs.gen-commit.enable = true;
}Add to your Home Manager configuration:
{
inputs = {
gen-commit = {
url = "github:rodeyseijkens/gen-commit";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
{ inputs, ... }:
{
imports = [inputs.gen-commit.homeManagerModules.default];
programs.gen-commit.enable = true;
}For a quick installation without modifying your configuration:
nix profile install github:rodeyseijkens/gen-commitTo use it temporarily in a shell:
nix shell github:rodeyseijkens/gen-commit -c gen-commit [OPTIONS]{
inputs = {
gen-commit = {
url = "github:rodeyseijkens/gen-commit";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, gen-commit, ... }:
{
nixosConfigurations.yourHost = nixpkgs.lib.nixosSystem {
modules = [
{
environment.systemPackages = [
gen-commit.packages.x86_64-linux.default
];
}
];
};
# Or in a devShell
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
packages = [
gen-commit.packages.x86_64-linux.default
];
};
};
}If you prefer using pkgs.gen-commit, add this flake's overlay:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
gen-commit.url = "github:rodeyseijkens/gen-commit";
};
outputs = { self, nixpkgs, gen-commit, ... }:
{
nixosConfigurations.yourHost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
nixpkgs.overlays = [gen-commit.overlays.default];
environment.systemPackages = [
pkgs.gen-commit
];
}
];
};
};
}The tool analyzes your git changes (staged, unstaged, or untracked files) and uses the llm command to generate an appropriate commit message following the Conventional Commits specification with gitmoji. You can optionally provide additional context using the -n, --note option to guide the LLM's message generation.
<type>[scope]: <gitmoji> <description>
See scripts/README.md for detailed information on development, testing, and release workflows.
MIT β see the LICENSE file for details.
Made with β€οΈ by @rodeyseijkens