Files
glaze.nvim/README.md
Tai Groot c905edc162 feat: add auto-install for missing binaries on register
- New config: auto_install.enabled (default true) and auto_install.silent
- When a plugin registers a binary via glaze.register() and it's missing,
  glaze automatically installs it in the background
- Can be disabled with auto_install = { enabled = false }
- Updated README and help docs
2026-02-19 03:23:15 +00:00

6.5 KiB

🍩 glaze.nvim

Go + Lazy = Glaze — A Mason/Lazy-style manager for Go binaries in Neovim. Charmbracelet-inspired aesthetic. Zero duplication. One source of truth.

Like a fresh doughnut glaze — smooth, sweet, and holds everything together.

Lua Neovim Go Required License: MIT

🤔 Why Glaze?

Every Go-based Neovim plugin reinvents the wheel: each one ships its own go install wrapper, its own update command, its own version checking.

Glaze stops the madness. Register your binaries once, manage them all from one beautiful UI. Plugin authors get a two-line integration. Users get a single :Glaze command.

Features

  • Centralized binary management — Register binaries from any plugin, update them all at once
  • Lazy.nvim-style UI — Floating window with progress bars, spinners, and status indicators
  • Cursor-aware keybindsu updates the binary under your cursor, U updates all
  • Parallel installations — Configurable concurrency for fast updates
  • Auto-update checking — Daily/weekly checks with non-intrusive notifications
  • GOBIN/GOPATH awareness — Finds binaries even if not in PATH
  • Detail expansion — Press <CR> to see URL, install path, version info
  • Charmbracelet aesthetic — Pink/magenta color scheme that matches the Charm toolchain
  • Zero config for dependents — Just register and go
  • Callback support — Get notified when your binary is updated

📦 Installation

Using lazy.nvim:

{
  "taigrr/glaze.nvim",
  config = function()
    require("glaze").setup({})
  end,
}

🚀 Quick Start

local glaze = require("glaze")

-- Setup (usually in your plugin config)
glaze.setup({})

-- Register binaries
glaze.register("freeze", "github.com/charmbracelet/freeze")
glaze.register("glow", "github.com/charmbracelet/glow")
glaze.register("mods", "github.com/charmbracelet/mods")

📖 Usage

Commands

Command Description
:Glaze Open the Glaze UI
:GlazeUpdate [name] Update all or specific binary
:GlazeInstall [name] Install missing or specific binary
:GlazeCheck Manually check for available updates

Keybinds (in Glaze UI)

Key Action
U Update ALL binaries
u Update binary under cursor
I Install all missing binaries
i Install binary under cursor
x Abort running tasks
<CR> Toggle details (URL, path, version)
q / <Esc> Close window

🔌 For Plugin Authors

Register your plugin's binaries as a dependency — two lines is all it takes:

-- In your plugin's setup or init:
local ok, glaze = pcall(require, "glaze")
if ok then
  glaze.register("mytool", "github.com/me/mytool", {
    plugin = "myplugin.nvim",
    callback = function(success)
      if success then
        vim.notify("mytool updated!")
      end
    end,
  })
end

Providing Update Commands

You can still expose plugin-specific commands that delegate to Glaze:

vim.api.nvim_create_user_command("MyPluginUpdate", function()
  require("glaze.runner").update({ "mytool" })
end, {})

⚙️ Configuration

require("glaze").setup({
  ui = {
    border = "rounded",  -- "none", "single", "double", "rounded", "solid", "shadow"
    size = { width = 0.7, height = 0.8 },  -- Percentage of screen
    icons = {
      pending = "○",
      running = "◐",
      done = "●",
      error = "✗",
      binary = "󰆍",
    },
  },
  concurrency = 4,  -- Max parallel installations
  go_cmd = { "go" },  -- Auto-detects goenv if available
  auto_install = {
    enabled = true,      -- Auto-install missing binaries on register
    silent = false,      -- Suppress install notifications
  },
  auto_check = {
    enabled = true,      -- Auto-check for updates
    frequency = "daily", -- "daily", "weekly", or hours as number
  },
})

🎨 Highlight Groups

Glaze defines these highlight groups (all prefixed with Glaze):

Group Description
GlazeH1 Main title (pink)
GlazeH2 Section headers
GlazeBinary Binary names
GlazeUrl Module URLs
GlazePlugin Plugin names
GlazeDone Success status
GlazeError Error status
GlazeRunning In-progress status
GlazeProgressDone Progress bar (filled)
GlazeProgressTodo Progress bar (empty)

📋 API

local glaze = require("glaze")

-- Registration
glaze.register(name, url, opts?)  -- Register a binary
glaze.unregister(name)            -- Remove a binary
glaze.binaries()                  -- Get all registered binaries

-- Status
glaze.is_installed(name)          -- Check if binary exists (PATH + GOBIN + GOPATH)
glaze.bin_path(name)              -- Get full path to binary
glaze.status(name)                -- "installed", "missing", or "unknown"

-- Runner (for programmatic control)
local runner = require("glaze.runner")
runner.update({ "freeze", "glow" })  -- Update specific binaries
runner.update_all()                  -- Update all
runner.install({ "freeze" })         -- Install specific
runner.install_missing()             -- Install all missing
runner.abort()                       -- Stop all tasks
runner.is_running()                  -- Check if tasks are running
runner.tasks()                       -- Get current task list
runner.stats()                       -- Get { total, done, error, running, pending }

-- Update checker
local checker = require("glaze.checker")
checker.check()                      -- Check for updates (with notifications)
checker.auto_check()                 -- Check only if enough time has passed
checker.get_update_info()            -- Get cached update info

📄 License

MIT © Tai Groot