Bring Goose AI power directly into Emacs — with a seamless, terminal-driven workflow.
goose.el is a minimal and extensible Emacs package that connects Emacs to the Goose CLI using a vterm-based major mode.
You can manage multiple named sessions, send instant (buffer, region, file, templates, or custom text), and fast AI-driven automation directly from your editor.
- Dedicated major mode (
goose-mode
) for Goose sessions (inherits from vterm-mode) - Session-based management with automatic labeling and buffer isolation
- One-command context sharing:
Instantly send buffer content, active region, file path, templates, or custom text to Goose - Prompt template integration:
Select and inject templates from~/.config/goose/prompts/
- Fully customizable keybindings and session parameters (via transient menus)
- Optimized for rapid experimentation, coding, debugging, and text workflows with AI
- Emacs 29 or later
- Goose CLI
- emacs-libvterm (vterm) (20218.331 or newer)
- transient
- consult
Manual installation (MELPA planned):
;; Download goose.el and put it somewhere in your load-path.
;; leaf
(leaf goose
:load-path "/path/to/goose.el"
:hook (goose-mode-hook . (lambda ()
(display-line-numbers-mode -1)))
:bind (("C-c g" . goose-transient)))
;; use-package
(use-package goose
:load-path "/path/to/goose.el"
:hook (goose-mode-hook . (lambda ()
(display-line-numbers-mode -1)))
:bind (("C-c g" . goose-transient)))
or simply:
(load "/path/to/goose.el")
- Start a new Goose session:
M-x goose-start-session - Restart the last session:
M-x goose-restart-session - Send current buffer:
M-x goose-add-context-buffer - Send region:
M-x goose-add-context-region - Send file path:
M-x goose-add-context-file-path - Send prompt template:
M-x goose-add-context-template - Send arbitrary text:
M-x goose-add-context-text - Show full menu:
C-c g (transient menu, configurable viagoose-transient-key
)
Each session is isolated in its own buffer using goose-mode
, so you can work in parallel and keep workflows organized!
Use M-x customize-group RET goose RET
or set variables directly:
goose-program-name
(Goose CLI path)goose-default-buffer-name
(buffer name prefix)goose-prompt-directory
(prompt template location)goose-context-format
(format string for context injection)goose-transient-key
(default: C-c g)
Place text templates in ~/.config/goose/prompts/
(customizable) for quick insertion.
Example file: bugfix.txt
Steps to reproduce the bug in my code:
<insert code here>
Describe the causes and suggest solutions.
Insert using M-x goose-add-context-template
- Dedicated major mode: All Goose sessions use
goose-mode
(derived fromvterm-mode
), allowing custom hooks, keymaps, and clean separation from generic vterm buffers. - Hook for customization:
(add-hook 'goose-mode-hook (lambda () (message "Welcome to Goose session!")))
- Copy text from Goose sessions:
Goose uses vterm; press C-c C-t (vterm-copy-mode) to select/copy as in a standard buffer. - Goose CLI not found?
Ensure CLI is in your$PATH
, or setgoose-program-name
. - Prompt templates not visible?
Make suregoose-prompt-directory
contains template files.
This package was built as a companion to Goose CLI,
and follows its philosophy of persistent, contextual AI interactions.
Pull requests and issues are welcome!
Feel free to share your own prompt templates, UX ideas, or bug fixes.
MIT © 2025 Daisuke Terada (@aq2bq) and contributors