diff options
| author | Franck Cuny <59291+fcuny@users.noreply.github.com> | 2025-02-24 19:24:13 -0800 |
|---|---|---|
| committer | Franck Cuny <59291+fcuny@users.noreply.github.com> | 2025-02-24 19:24:47 -0800 |
| commit | c4fecf6bfdaa846c5657b82325501047189aed5d (patch) | |
| tree | 76ad80e14276d4a184b3c7a0b921641e1d78b7a4 /nix | |
| parent | add ~/.local/bin to the path (diff) | |
| download | infra-c4fecf6bfdaa846c5657b82325501047189aed5d.tar.gz | |
🤖 Add LLM tooling and prompts for Git workflow automation
- Add new section in README about LLM tooling installation
- Create prompts directory with templates for commit and PR messages
- Add new llm.nix module with:
- Configuration for prompt file locations
- Fish shell aliases for generating commit and PR messages using Claude 3.5
- Add `llm` recipe in justfile to install llm CLI tool and Anthropic provider
- Integrate LLM module into home-manager configuration
The changes introduce automation for generating high-quality commit messages and PR descriptions using AI, while keeping the prompts configurable and version controlled.
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/users/fcuny/home-manager.nix | 1 | ||||
| -rw-r--r-- | nix/users/fcuny/llm.nix | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/nix/users/fcuny/home-manager.nix b/nix/users/fcuny/home-manager.nix index 9fd2983..0a3f6fc 100644 --- a/nix/users/fcuny/home-manager.nix +++ b/nix/users/fcuny/home-manager.nix @@ -11,6 +11,7 @@ ./shell.nix ./ssh.nix ./git.nix + ./llm.nix ] ++ lib.optionals darwin [ ./1password.nix diff --git a/nix/users/fcuny/llm.nix b/nix/users/fcuny/llm.nix new file mode 100644 index 0000000..48604c3 --- /dev/null +++ b/nix/users/fcuny/llm.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + + home.file.".config/prompts/pr-prompt.txt".text = + builtins.readFile ../../../configs/prompts/pr-prompt.txt; + + home.file.".config/prompts/commit-system-prompt.txt".text = + builtins.readFile ../../../configs/prompts/commit-system-prompt.txt; + + programs.fish = { + shellAliases = { + commit-msg = "git diff HEAD | llm -m claude-3.5-sonnet -s (cat ~/.config/prompts/commit-system-prompt.txt |psub)"; + pr-msg = "git diff HEAD | llm -m claude-3.5-sonnet -s (cat ~/.config/prompts/pr-prompt.txt |psub)"; + }; + }; +} |
