large update

This commit is contained in:
2026-02-18 23:21:33 -05:00
parent 7ab9da9c56
commit ded73a5073
20 changed files with 784 additions and 185 deletions

266
README.md
View File

@@ -1,123 +1,164 @@
# 🍩 glaze.nvim
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/taigrr/glaze.nvim/raw/master/docs/glaze-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/taigrr/glaze.nvim/raw/master/docs/glaze-light.svg">
<img alt="glaze.nvim" src="https://github.com/taigrr/glaze.nvim/raw/master/docs/glaze-dark.svg" width="400">
</picture>
> **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.*
<p>
<a href="https://github.com/taigrr/glaze.nvim/releases/latest">
<img alt="Latest release" src="https://img.shields.io/github/v/release/taigrr/glaze.nvim?style=for-the-badge&logo=starship&color=FF6AD5&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver">
</a>
<a href="https://github.com/taigrr/glaze.nvim/pulse">
<img alt="Last commit" src="https://img.shields.io/github/last-commit/taigrr/glaze.nvim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41">
</a>
<a href="https://github.com/taigrr/glaze.nvim/blob/master/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/taigrr/glaze.nvim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41">
</a>
<a href="https://github.com/taigrr/glaze.nvim/stargazers">
<img alt="Stars" src="https://img.shields.io/github/stars/taigrr/glaze.nvim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41">
</a>
</p>
![Lua](https://img.shields.io/badge/Lua-2C2D72?style=flat&logo=lua&logoColor=white)
![Neovim](https://img.shields.io/badge/Neovim%200.9+-57A143?style=flat&logo=neovim&logoColor=white)
![Go Required](https://img.shields.io/badge/Go-required-00ADD8?style=flat&logo=go&logoColor=white)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
**Go + Lazy = Glaze** β€” A centralized manager for Go binaries in Neovim.
## πŸ€” Why Glaze?
<img alt="glaze.nvim demo" src="https://github.com/taigrr/glaze.nvim/raw/master/docs/demo.gif" width="700">
Every Go-based Neovim plugin reinvents the wheel: each one ships its own
`go install` wrapper, its own update command, its own version checking.
## The Problem
**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.
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:
```lua
-- 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 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 keybinds** β€” `u` 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
- πŸ“¦ **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
Using [lazy.nvim](https://github.com/folke/lazy.nvim):
### [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
"taigrr/glaze.nvim",
config = function()
require("glaze").setup({})
require("glaze").setup()
end,
}
```
### [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
use {
"taigrr/glaze.nvim",
config = function()
require("glaze").setup()
end,
}
```
## ⚑ Requirements
- Neovim >= **0.9.0**
- Go >= **1.18** (for `go install` support)
- Optional: [goenv](https://github.com/syndbg/goenv) (auto-detected)
## πŸš€ Quick Start
```lua
local glaze = require("glaze")
-- Setup (usually in your plugin config)
glaze.setup({})
-- Setup
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")
glaze.register("gum", "github.com/charmbracelet/gum")
-- Open the UI
vim.cmd("Glaze")
```
## πŸ“– Usage
## πŸ“– Commands
### 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 |
| 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
### 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 |
| 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
Register your plugin's binaries as a dependency β€” two lines is all it takes:
Make your plugin a Glaze consumer with two lines:
```lua
-- In your plugin's setup or init:
-- In your plugin's setup:
local ok, glaze = pcall(require, "glaze")
if ok then
glaze.register("mytool", "github.com/me/mytool", {
plugin = "myplugin.nvim",
plugin = "myplugin.nvim", -- Shows in UI
callback = function(success)
if success then
vim.notify("mytool updated!")
end
if success then vim.notify("mytool updated!") end
end,
})
end
```
### Providing Update Commands
### Example Consumers
You can still expose plugin-specific commands that delegate to Glaze:
These plugins use Glaze to manage their Go binaries:
```lua
vim.api.nvim_create_user_command("MyPluginUpdate", function()
require("glaze.runner").update({ "mytool" })
end, {})
```
- [**neocrush.nvim**](https://github.com/taigrr/neocrush.nvim) β€” AI-powered coding assistant
- [**freeze.nvim**](https://github.com/taigrr/freeze.nvim) β€” Screenshot code with freeze
- [**blast.nvim**](https://github.com/taigrr/blast.nvim) β€” Code activity tracking
## βš™οΈ Configuration
```lua
require("glaze").setup({
-- UI settings
ui = {
border = "rounded", -- "none", "single", "double", "rounded", "solid", "shadow"
size = { width = 0.7, height = 0.8 }, -- Percentage of screen
size = { width = 0.7, height = 0.8 },
icons = {
pending = "β—‹",
running = "◐",
@@ -125,40 +166,34 @@ require("glaze").setup({
error = "βœ—",
binary = "󰆍",
},
use_system_theming = false, -- Use nvim theme instead of doughnut colors
},
concurrency = 4, -- Max parallel installations
go_cmd = { "go" }, -- Auto-detects goenv if available
-- Parallel installations
concurrency = 4,
-- Go command (auto-detects goenv)
go_cmd = { "go" },
-- Auto-install missing binaries on register
auto_install = {
enabled = true, -- Auto-install missing binaries on register
silent = false, -- Suppress install notifications
enabled = true,
silent = false,
},
-- Auto-check for updates
auto_check = {
enabled = true, -- Auto-check for updates (disabling also disables auto_update)
frequency = "daily", -- "daily", "weekly", or hours as number
enabled = true,
frequency = "daily", -- "daily", "weekly", or hours as number
},
-- Auto-update when newer versions found
auto_update = {
enabled = false, -- Auto-update binaries when newer versions are found (requires auto_check)
enabled = false, -- Requires auto_check
},
})
```
## 🎨 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
```lua
@@ -170,36 +205,53 @@ 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.is_installed(name) -- Check if binary exists
glaze.bin_path(name) -- Get full path to binary
glaze.status(name) -- "installed", "missing", or "unknown"
-- Runner (for programmatic control)
-- Runner
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 }
runner.update({ "freeze" }) -- Update specific binaries
runner.update_all() -- Update all
runner.install_missing() -- Install all missing
runner.abort() -- Stop all tasks
-- Update checker
-- 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
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
```vim
:checkhealth glaze
```
Verifies Go installation, GOBIN configuration, and registered binary status.
## 🀝 Related Projects
- [freeze.nvim](https://github.com/taigrr/freeze.nvim) β€” Screenshot code with freeze
- [neocrush.nvim](https://github.com/taigrr/neocrush.nvim) β€” AI-powered coding assistant
- [blast.nvim](https://github.com/taigrr/blast.nvim) β€” Code activity tracking
- [lazy.nvim](https://github.com/folke/lazy.nvim) β€” UI inspiration
- [mason.nvim](https://github.com/williamboman/mason.nvim) β€” Concept inspiration
Glaze is inspired by:
- [lazy.nvim](https://github.com/folke/lazy.nvim) β€” UI patterns and aesthetics
- [mason.nvim](https://github.com/williamboman/mason.nvim) β€” Centralized tool management concept
## πŸ“„ License
MIT Β© [Tai Groot](https://github.com/taigrr)
[0BSD](LICENSE) Β© [Tai Groot](https://github.com/taigrr)