tai.nvim

a minimal Neovim plugin built to bring AI coding
agents directly to your editor.


features

- agents can read files and run commands
- responses show up in a split buffer in Neovim
- apply patches or run commands
- agents create plans for big code changes


providers

- groq
- gemini
- mistral (wip, their handoff is not working)
- ollama
- z.ai


keybindings

<leader>ti 	- prompt input and send
<leader>tr 	- reset the chat history


installation

clone or place lua/tai/ into your Neovim config dir
~/.config/nvim/lua/ and add keymaps to init.lua:

  vim.g.mapleader = " "

  local tai = require("tai")

  vim.keymap.set("n", "gT", function()
    vim.cmd("set operatorfunc=v:lua.tai_operator_send")
    vim.api.nvim_feedkeys("g@", "n", false)
  end)

  vim.keymap.set("n", "gP", function()
    vim.cmd("set operatorfunc=v:lua.tai_operator_send_with_prompt")
    vim.api.nvim_feedkeys("g@", "n", false)
  end)

  vim.keymap.set("v", "<leader>t", function()
    tai.operator_send("char")
  end, { noremap = true, silent = true })

  vim.keymap.set("i", "<leader>ti", function()
    vim.schedule(tai.prompt_input)
  end, { noremap = true })

  vim.keymap.set("i", "<leader>tf", function()
    vim.schedule(tai.prompt_full_file)
  end, { noremap = true })


configuring

tai only needs a simple config file located at the
root of your project, create a file named .tai with
this structure:

{
	"provider": string,
	"tai": {
		"tools": []string
		"model": string
	}
}

tool options: read_file, shell, patch.


usage

make sure the correct env var is set: GROQ_API_KEY,
for Groq or GEMINI_API_KEY for Gemini.
create a .tai file at the root or your project.
editting any file in that project should start tai.
then just use the keybindings above.


screenshots

- side panel
- input for prompt


license

MIT License

(C) 2025 Brian Mayer