Last updated: 2026-04-12

Neovim & Terminal

Configure Neovim, Vim, and terminal workflows for SpendLil.

For terminal-native developers. Shell aliases, environment setup, Neovim plugin configuration, and command-line testing patterns.

Shell Environment

bash ~/.bashrc or ~/.zshrc
# SpendLil
export SPENDLIL_KEY="sl_abc123def456"

# Provider keys
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."

Shell Aliases

bash Useful aliases
# Quick test — send a prompt through SpendLil
alias sltest='curl -s https://openai.gateway.spendlil.ai/v1/chat/completions \
  -H "X-SpendLil-Key: $SPENDLIL_KEY" \
  -H "X-Provider-Key: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"gpt-4o-mini\",\"messages\":[{\"role\":\"user\",\"content\":\"ping\"}]}" | jq .'

# Health check all gateways
alias slhealth='for p in openai anthropic google mistral; do echo -n "$p: "; curl -s https://$p.gateway.spendlil.ai/health | jq -r .status; done'

direnv (Per-Project Env)

bash .envrc (in project root)
dotenv

Neovim AI Plugins

Most Neovim AI plugins use the standard Authorization header. Use the local header injection proxy (see Cursor & AI IDEs guide) and point plugins at http://localhost:8787.

codecompanion.nvim

lua init.lua (with local proxy running)
require('codecompanion').setup({
  adapters = {
    openai = function()
      return require('codecompanion.adapters').extend('openai', {
        url = 'http://localhost:8787/v1/chat/completions',
      })
    end,
  },
})

HTTPie

bash HTTPie examples
# OpenAI via SpendLil
http POST https://openai.gateway.spendlil.ai/v1/chat/completions \
  X-SpendLil-Key:$SPENDLIL_KEY \
  X-Provider-Key:"Bearer $OPENAI_API_KEY" \
  model=gpt-4o-mini \
  messages:='[{"role":"user","content":"Hello"}]'

# Health check
http https://openai.gateway.spendlil.ai/health