Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No luck (yet) configuring this package on Doom Emacs #7

Closed
hyperfocus1337 opened this issue Oct 14, 2024 · 2 comments
Closed

No luck (yet) configuring this package on Doom Emacs #7

hyperfocus1337 opened this issue Oct 14, 2024 · 2 comments

Comments

@hyperfocus1337
Copy link

hyperfocus1337 commented Oct 14, 2024

Thanks for your work in this project!

I understood from your comment we should use the master branch of this project from this point onwards. And once the gptel-backend variable is configured correctly, magit-gptcommit should work as expected.

However, so far, I wasn't able to get the package commands to show inside of the magit buffer.

This is the content of my gptel-backend variable:

#s(gptel-openai "OpenRouter" "openrouter.ai" #<subr F616e6f5e796d6f797a2d6c616d626461_anonymous_lambda_12> "https" t "/api/v1/chat/completions" gptel-api-key-from-auth-source
                ("chatgpt-4o-latest" "gpt-4o-mini" "gemini-pro")
                "https://openrouter.ai/api/v1/chat/completions" nil)

This is the minimal config I'm using:

(use-package! magit-gptcommit
  :demand t
  :after magit
  :bind (:map git-commit-mode-map
              ("C-c C-g" . magit-gptcommit-commit-accept))
  :config
  ;; Enable magit-gptcommit-mode to watch staged changes and generate commit message automatically in magit status buffer
  ;; This mode is optional, you can also use `magit-gptcommit-generate' to generate commit message manually
  ;; `magit-gptcommit-generate' should only execute on magit status buffer currently
  ;; (magit-gptcommit-mode 1)
  ;; Add gptcommit transient commands to `magit-commit'
  ;; Eval (transient-remove-suffix 'magit-commit '(1 -1)) to remove gptcommit transient commands
  (magit-gptcommit-status-buffer-setup))

What am I missing? Any further guidance would be appreciated, thanks in advance!

@hyperfocus1337
Copy link
Author

hyperfocus1337 commented Oct 14, 2024

Turns out, I needed to make sure I had source code staged in the Magit buffer before the package options would show. I expected the options to be there by default (but I guess I missed reading that in the setup instructions).

Above config snippet is not enough, magit-gptcommit-llm-provider also needs to be set, as I now get:

magit-gptcommit--insert: No llm provider, please configure ‘magit-gptcommit-llm-provider’.

@hyperfocus1337
Copy link
Author

hyperfocus1337 commented Oct 14, 2024

Added #8 as separate issue related to the provided config example from README.md.

I will work on trying to make that work, and closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant