Skip to content

mrychlik/agentic.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agentic.el

CI

Agentic workflows for Emacs offer a streamlined interface to enhance your coding experience by leveraging GPT (via [gptel]). This package allows you to rewrite buffers, generate unified diffs for your repository, and apply these diffs with Git, all while facilitating the opening of pull requests (PRs) with [Forge]. Ideal for those teaching AI or Data Science, agentic.el efficiently follows the workflow from prompt → patch → PR with you maintaining full control via Magit.

Requirements

  • Emacs 27 or later
  • Configured [gptel] with an API key and selected model
  • Recommended packages: Magit, Forge, and yasnippet for enhanced functionality

Features

Agentic.el activates specific keybindings when agentic-mode is enabled, allowing for easy access to powerful features:

  • C-c g rRewrite: Rewrite the selected region or entire buffer based on provided instructions. Returns raw code.
  • C-c g pPatch (apply): Request a single unified diff for the current project and apply it using git apply.
  • C-c g PPatch (preview): View the unified diff without applying it to the codebase; useful for review before making changes.
  • C-c g bSafe branch: Create a new branch for your changes.
  • C-c g cCommit: Commit your changes to the repository.
  • C-c g uPush: Push your committed changes to the remote repository.
  • C-c g ROpen PR: Initiate a pull request using Forge for collaborative reviews.
  • C-c g CCompose PATCH: Open a prompt to compose a patch.
  • C-c g WCompose REWRITE: Open a prompt to compose a rewrite instruction.
  • C-c g vProject review: Read and review all files within the current project directory.
  • C-c g lOpen log file: Show the ChatGPT interaction log.

Installation

A) Using straight.el

To install the package using straight.el, add the following configuration to your Emacs initialization file:

(use-package agentic
  :straight (agentic :type git :host github :repo "mrychlik/agentic.el" :branch "main")
  :config
  (global-agentic-mode 1))

Incorporate agentic.el into your Emacs setup to simplify your development process with intelligent tools powered by GPT. Enjoy a seamless coding experience with version control integration and collaborative features at your fingertips!

Troubleshooting

No output / nothing inserted?
Use C-u C-c RET in a gptel buffer to open the routing menu and ensure output isn’t redirected elsewhere. agentic.el calls the request API directly; if the model returns no text it will warn instead of erroring.

“Contacting model…” but nothing happens.
Check that gptel is installed and your API key is set:

(use-package gptel :straight t)
(setq gptel-api-key (getenv "OPENAI_API_KEY"))

Binary/huge files during review

The review command skips files with NUL bytes and enforces byte budgets. Increase:

(setq agentic/review-max-files 60
      agentic/review-max-bytes-per-file 40000
      agentic/review-total-byte-budget 500000)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors