Skip to content

🍩 A Mason/Lazy-style manager for Go binaries in Neovim. Go + Lazy = Glaze.

License

Notifications You must be signed in to change notification settings

taigrr/glaze.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

glaze.nvim

Latest release Last commit License Stars

Go + Lazy = Glaze β€” A centralized manager for Go binaries in Neovim.

glaze.nvim demo

The Problem

Every Go-based Neovim plugin reinvents the wheel:

  • freeze.nvim needs freeze β†’ ships its own installer
  • glow.nvim needs glow β†’ ships its own installer
  • mods.nvim needs mods β†’ ships its own installer

Each plugin implements go install, update checking, and version management from scratch. Users run different update commands for each plugin. Plugin authors duplicate code.

The Solution

Glaze provides a single source of truth for Go binaries:

-- Plugin authors: two lines
local ok, glaze = pcall(require, "glaze")
if ok then glaze.register("freeze", "github.com/charmbracelet/freeze") end

-- Users: one command
:Glaze

✨ Features

  • πŸ“¦ Centralized management β€” Register binaries from any plugin, manage from one UI
  • πŸš€ Parallel installations β€” Configurable concurrency for fast updates
  • 🎯 Cursor-aware keybinds β€” u updates binary under cursor, U updates all
  • πŸ”„ Auto-update checking β€” Daily/weekly checks with non-intrusive notifications
  • πŸ“ Smart binary detection β€” Finds binaries in PATH, GOBIN, and GOPATH
  • 🎨 Sugary-sweet aesthetic β€” Pink/magenta theme reminding you of doughnuts...
  • πŸ”” Callback support β€” Get notified when your binary is updated
  • ⚑ Zero config for plugins β€” Register and go

πŸ“¦ Installation

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

⚑ Requirements

  • Neovim >= 0.9.0
  • Go >= 1.18 (for go install support)
  • Optional: goenv (auto-detected)

πŸš€ Quick Start

local glaze = require("glaze")

-- Setup
glaze.setup()

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

-- Open the UI
vim.cmd("Glaze")

πŸ“– 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

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
q / <Esc> Close window

πŸ”Œ For Plugin Authors

Make your plugin a Glaze consumer with two lines:

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

Example Consumers

These plugins use Glaze to manage their Go binaries:

βš™οΈ Configuration

require("glaze").setup({
  -- UI settings
  ui = {
    border = "rounded",  -- "none", "single", "double", "rounded", "solid", "shadow"
    size = { width = 0.7, height = 0.8 },
    icons = {
      pending = "β—‹",
      running = "◐",
      done = "●",
      error = "βœ—",
      binary = "󰆍",
    },
    use_system_theming = false,  -- Use nvim theme instead of doughnut colors
  },

  -- Parallel installations
  concurrency = 4,

  -- Go command (auto-detects goenv)
  go_cmd = { "go" },

  -- Auto-install missing binaries on register
  auto_install = {
    enabled = true,
    silent = false,
  },

  -- Auto-check for updates
  auto_check = {
    enabled = true,
    frequency = "daily",  -- "daily", "weekly", or hours as number
  },

  -- Auto-update when newer versions found
  auto_update = {
    enabled = false,  -- Requires auto_check
  },
})

πŸ“‹ 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
glaze.bin_path(name)              -- Get full path to binary
glaze.status(name)                -- "installed", "missing", or "unknown"

-- Runner
local runner = require("glaze.runner")
runner.update({ "freeze" })       -- Update specific binaries
runner.update_all()               -- Update all
runner.install_missing()          -- Install all missing
runner.abort()                    -- Stop all tasks

-- Checker
local checker = require("glaze.checker")
checker.check()                   -- Check for updates
checker.get_update_info()         -- Get cached update info

🎨 Highlight Groups

Group Description
GlazeH1 Main title
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)

🩺 Health Check

:checkhealth glaze

Verifies Go installation, GOBIN configuration, and registered binary status.

🀝 Related Projects

Glaze is inspired by:

  • lazy.nvim β€” UI patterns and aesthetics
  • mason.nvim β€” Centralized tool management concept

πŸ“„ License

0BSD Β© Tai Groot

About

🍩 A Mason/Lazy-style manager for Go binaries in Neovim. Go + Lazy = Glaze.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published