Add configuration file support to llm-commit-gen #4

Open
opened 2025-07-06 15:42:35 +00:00 by glenux · 1 comment
Owner

Note: Copy of issue from upstream project: https://github.com/GNtousakis/llm-commit/issues/11


Summary

Introduce support for configuration files in llm-commit to allow users to define default settings such as commit message schemes and default hints.

Expected Benefits :

  • simplifies usage by minimizing repeated command-line options.
  • Enables project-specific or user-specific defaults

Problem

Currently, all configuration options for llm-commit (e.g., message schemes, hints) must be specified via command-line arguments. This requires users to repeatedly provide the same options, which can be tedious and error-prone, especially in larger projects or across multiple repositories.

Proposed solution

Implement a configuration file system with support for:

  • System-global config: /etc/llm-commit/config.yml
  • User-global config: $HOME/.config/llm-commit/config.yml
  • Per-project config: Located in the repository’s top-level directory (same directory as .git)
  • Explicit config file: Allow users to specify an alternate config file via -c FILE or --config FILE

Configuration options supported:

  • Default message format (e.g., default, semantic, conventional, etc.)
  • Default hint text for context

Priority rule:

  • Command-line arguments always override values from configuration files.
  • Priority order:
    Command-line > Per-project config > User-global config > System-global config

Example usage:

# config.yml example
format: semantic
hint: "General code cleanup and refactoring."
llm commit --config ./custom-config.yml

Possible considerations

  • Error handling for invalid/missing configuration files.
  • Backward compatibility (to ensure existing workflows remain unaffected).
Note: Copy of issue from upstream project: https://github.com/GNtousakis/llm-commit/issues/11 --- ## Summary Introduce support for configuration files in `llm-commit` to allow users to define default settings such as commit message schemes and default hints. Expected Benefits : * simplifies usage by minimizing repeated command-line options. * Enables project-specific or user-specific defaults ## Problem Currently, all configuration options for `llm-commit` (e.g., message schemes, hints) must be specified via command-line arguments. This requires users to repeatedly provide the same options, which can be tedious and error-prone, especially in larger projects or across multiple repositories. ## Proposed solution Implement a configuration file system with support for: - System-global config: `/etc/llm-commit/config.yml` - User-global config: `$HOME/.config/llm-commit/config.yml` - Per-project config: Located in the repository’s top-level directory (same directory as `.git`) - Explicit config file: Allow users to specify an alternate config file via `-c FILE` or `--config FILE` Configuration options supported: - Default message format (e.g., `default`, `semantic`, `conventional`, etc.) - Default hint text for context Priority rule: - Command-line arguments always override values from configuration files. - Priority order: `Command-line > Per-project config > User-global config > System-global config` Example usage: ```yaml # config.yml example format: semantic hint: "General code cleanup and refactoring." ``` ```sh llm commit --config ./custom-config.yml ``` ## Possible considerations - Error handling for invalid/missing configuration files. - Backward compatibility (to ensure existing workflows remain unaffected).
Author
Owner

Note: for consistency with configuration file, perhaps it would be worth introducing -f --format (ex: --format semantic) (and make --semantic and --conventional aliases of the new command, or remove them).

Note: for consistency with configuration file, perhaps it would be worth introducing `-f` `--format` (ex: ` --format semantic`) (and make `--semantic` and `--conventional` aliases of the new command, or remove them).
glenux changed title from Add configuration file support to llm-commit to [feature] Add configuration file support to llm-commit 2025-07-06 15:50:49 +00:00
glenux added this to the Default project 2025-07-06 15:52:48 +00:00
glenux changed title from [feature] Add configuration file support to llm-commit to Add configuration file support to llm-commit-gen 2025-07-06 16:16:10 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: glenux/llm-commit-gen#4
No description provided.