You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support default values via environment variables #16
Allow llm-commit to use environment variables for setting default values for command-line flags.
Expected Benefits:
Reduces the need to repeatedly specify options for frequent users.
Provides a flexible mechanism for customizing llm-commit behavior.
Ensures compatibility with existing workflows by preserving explicit command-line argument precedence.
Problem statement
Currently, every execution of llm commit requires specifying command-line arguments for options such as model selection, token limits, temperature settings, and truncation behavior. This can be cumbersome, especially for users who consistently use the same settings.
While a previous update introduced LLM_COMMIT_STYLE for defining a default commit style, a broader mechanism for setting defaults via environment variables is still missing.
Proposed solution
Introduce support for environment variables corresponding to existing command-line flags. If an environment variable is set, it will be used as the default value unless overridden by an explicit command-line argument.
Environment Variables to Support:
LLM_COMMIT_MODEL → Default model (--model)
LLM_COMMIT_MAX_TOKENS → Default max tokens (--max-tokens)
LLM_COMMIT_TEMPERATURE → Default temperature (--temperature)
If no environment variable is set, fall back to tool defaults.
Example Usage:
# Set defaults in shell profile (e.g., .bashrc, .zshrc) or in current directory with direnv (.env)export LLM_COMMIT_MODEL="4o"export LLM_COMMIT_MAX_TOKENS=1000
export LLM_COMMIT_TEMPERATURE=0.95
export LLM_COMMIT_HINT="We are working on data-science related projects."# Running without command-line flags uses these defaults
llm commit
# Override behavior using flags
llm commit --model "gpt-3.5-turbo" --temperature 0.9
Activity