Skip to content

Server API

Endpoints

MethodPathPhaseDescription
GET/healthAllHealth check, returns server status
POST/registerAllClient registers with server
POST/unregisterAllClient deregisters
POST/context/editAllReport a buffer edit for edit tracking
POST/context/buffersAllReport open buffer list
POST/complete1Request inline completion (SSE)
POST/chat2Send chat message (SSE)
GET/statusAllServer stats, connected clients

Error Handling

ScenarioBehavior
Server not runningLua plugin spawns it, retries connection 3 times with 1s backoff
Server crashesLua plugin detects on next request, removes stale lock, respawns
Agent SDK errorSSE error event sent to client, ghost text cleared, user notified
Request timeout30s default for completions, 120s for chat. Cancel sent to server on timeout.
Network error (localhost)Retry once, then notify user
Multiple rapid triggersNew trigger cancels in-flight request before sending new one

Installation

Requirements

  • Neovim >= 0.10.0 (for inline virtual text support)
  • Node.js >= 20
  • Claude Code CLI installed and authenticated (the Agent SDK uses it internally)
  • Claude Max subscription

lazy.nvim

lua
{
  'username/bonk.nvim',
  build = 'cd server && npm install && npm run build',
  config = function()
    require('bonk').setup({
      completion = {
        model = 'claude-opus-4-6',
      },
    })
  end,
}

Manual

sh
git clone https://github.com/username/bonk.nvim ~/.local/share/nvim/site/pack/bonk/start/bonk.nvim
cd ~/.local/share/nvim/site/pack/bonk/start/bonk.nvim/server
npm install && npm run build

Then in your config:

lua
require('bonk').setup()

Released under the MIT License.