Files
dotfiles-public/private_dot_config/nvim/lua/plugins/ai_assist.lua
T
bcherb2 170db93f35 fix: nvim first boot on a fresh box — tree-sitter CLI, no luarocks, guarded local plugin
nvim-treesitter (main) hard-requires the tree-sitter CLI: new manifest
row via npm. hererocks failed compiling lua 5.1 (readline headers) for
oxocarbon's incidental rockspec: rocks disabled, the colorscheme works
without. The ~/code/nvim-ai-assist local plugin gets a cond so boxes
without the checkout skip it silently. All three found live, phase 5 VM.
2026-08-22 22:45:47 -04:00

39 lines
1.6 KiB
Lua

return {
dir = vim.fn.expand("~/code/nvim-ai-assist"),
name = "nvim_ai_assist",
-- A local checkout that only some machines have. Without the cond, every
-- fresh box reports "Local plugin does not exist" on first sync.
cond = vim.fn.isdirectory(vim.fn.expand("~/code/nvim-ai-assist")) == 1,
lazy = false,
cmd = { "AI", "AIHealth", "AIRefreshContext" },
keys = {
{ "<leader>ai", ":AI<CR>", desc = "AI command (prompt)", mode = "n" },
{ "<leader>aA", ":AI!<CR>", desc = "AI command (auto-execute)", mode = "n" },
{ "<leader>ah", ":AIHealth<CR>", desc = "AI health + context stats", mode = "n" },
},
config = function()
require("nvim_ai_assist").setup({
-- Active: Z.AI Coding Plan (uses ZAI_API_KEY from env)
provider = "zai-coding",
model = "glm-4.7",
max_tokens = 300,
temperature = 0.05,
debug = true, -- writes request/response to ~/.cache/nvim/nvim_ai_assist.log; :AILog to view
context = {
enabled = true,
max_chars = 1500,
refresh_seconds = 60,
},
-- Local LM Studio fallback — uncomment to use, and comment out the
-- provider/model lines above.
-- The host is deliberately not written down here: this repo is public,
-- and a LAN address is one of the things the tier split exists to keep
-- out of it. Put yours in and do not commit it back.
-- endpoint = "http://<lm-studio-host>:1234/v1/chat/completions",
-- api_key = "lm-studio",
-- model = "qwen3-almost-human-y1-7b",
})
end,
}