- Lua 98.7%
- Makefile 1.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| assets | ||
| lua/herdr | ||
| tests | ||
| .busted | ||
| .luacheckrc | ||
| .stylua.toml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
herdr.nvim
Send code from Neovim to a coding agent running in herdr, without leaving the editor.
Select some lines, run :HerdrSend, type what you want ("why does this panic?",
"add a test for this"), and the agent in the next pane gets your instruction
plus file:line and the code in a fenced block, along with any diagnostics on
those lines. Works with any agent herdr runs: Claude Code, Codex, OpenCode, and
others.
requirements
- Neovim ≥ 0.11 (
vim.system,vim.ui). - herdr, with nvim running inside a herdr pane and an agent in another pane of the same workspace.
install
return {
"jwarykowski/herdr.nvim",
cmd = { "HerdrSend", "HerdrFocus" },
keys = {
{ "<leader>ai", "<cmd>HerdrSend<cr>", desc = "agent: ask about this line" },
{ "<leader>ai", ":HerdrSend<cr>", mode = "x", desc = "agent: ask about selection" },
{ "<leader>aI", "<cmd>HerdrSend!<cr>", desc = "agent: ask, picking the agent" },
{ "<leader>af", "<cmd>HerdrFocus<cr>", desc = "agent: focus its pane" },
},
opts = {},
}
Other plugin managers: add the repo and call require("herdr").setup().
usage
:HerdrSend— prompt for an instruction and send it with the cursor'sfile:lineto an agent. With a range (:'<,'>HerdrSend, or from visual mode) it sendsfile:first-lastand the lines in a fenced block.- Agent choice: with one agent in the workspace it goes straight there; with
several you pick, and later sends reuse that agent while it is still running.
:HerdrSend!picks again. - Diagnostics (errors, warnings) on the sent lines are appended, so "fix this" needs no copy-pasting.
:HerdrFocus— jump to the agent's pane (the last one sent to, else pick);:HerdrFocus!picks.
The pane nvim runs in is never offered, so an agent running nvim can't prompt itself.
Run :checkhealth herdr to check the binary, the pane, and herdr agent list.
configuration
require("herdr").setup({
cmd = nil, -- herdr binary; default $HERDR_BIN_PATH, else herdr on $PATH
diagnostics = true, -- append diagnostics on the sent lines
scope = "workspace", -- or "all": offer agents from every herdr workspace
})
keybars Pro
With keybars Pro,
keybars.nvim puts the
editor's work on the keyboard: :KeybarsRun shows a build there, errors can
hold a key, and the statusline shows Focus and typing speed.
development
make fmt # stylua
make lint # stylua --check + luacheck
make test # busted (specs run under Neovim via nlua)
make check # lint + test
Test deps: luarocks install busted nlua. The specs cover the pure helpers
(agent filtering, labels, the prompt and context format, agent choice) exposed
on require("herdr")._internal; CI runs them on Neovim stable and nightly.
support
herdr.nvim is free and MIT licensed. If it saves you some copy and paste, you can sponsor its development.