A Neovim plugin for FluxCD Kustomization manifest management and dry-run rendering.
This plugin was heavily inspired by kusomization.nvim and can work in conjunction with it.
It was coded purely using claude-4-sonnet, courtesy of Cursor, which means I have to make myself clear on couple of things:
- I do not have the slightest idea how all this code works, I just needed a tool at hand right away and was able to create one using LLMs.
- Therefore I'm not sure that I'll be able to support or develop it any further past my personal needs.
- Feel free to fork, modify, develop it in any possible way you see fit.
- π Auto-detection - Automatically detects FluxCD Kustomization manifests
- πββοΈ Dry-run rendering - Renders manifests using
flux build kustomization --dry-run - π Smart path management - File-specific kustomization paths with Telescope directory picker
- πΎ Persistent storage - Remembers paths across Neovim sessions
- πͺ Smart window management - Preserves your layout (neo-tree friendly)
- π§ Seamless workflow - One-command operation from path selection to rendering
- Neovim 0.8+
- FluxCD CLI - Install from fluxcd.io
- Dependencies:
fluxcd.nvim/
βββ .gitignore
βββ LICENSE
βββ README.md
βββ doc/
β βββ fluxcd.txt # Vim help documentation
βββ examples/
β βββ lazy.lua # lazy.nvim configuration example
β βββ packer.lua # packer.nvim configuration example
β βββ sample-kustomization.yaml # Sample FluxCD manifest
βββ lua/
β βββ fluxcd.lua # Main entry point
β βββ fluxcd/
β βββ init.lua # Core plugin logic
βββ plugin/
βββ fluxcd.lua # Plugin initialization
Using lazy.nvim
{
'vgromanov/fluxcd.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
ft = 'yaml',
config = function()
require('fluxcd').setup()
end,
}Using packer.nvim
use {
'vgromanov/fluxcd.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
ft = 'yaml',
config = function()
require('fluxcd').setup()
end,
}Using vim-plug
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'vgromanov/fluxcd.nvim'
" Add to your init.vim/init.lua
lua require('fluxcd').setup()require('fluxcd').setup({
flux_cmd = 'flux', -- FluxCD CLI command
})Add custom keymaps to your configuration:
-- Default keymaps (if you want to override them)
vim.keymap.set('n', '<leader>fd', '<cmd>FluxcdDryRun<CR>', { desc = 'FluxCD dry-run' })
vim.keymap.set('n', '<leader>fp', '<cmd>FluxcdSetPath<CR>', { desc = 'Set FluxCD path' })
vim.keymap.set('n', '<leader>fs', '<cmd>FluxcdStatus<CR>', { desc = 'FluxCD status' })-
Open a FluxCD Kustomization YAML file
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 kind: Kustomization metadata: name: my-app spec: interval: 1m path: "./apps" sourceRef: kind: GitRepository name: my-repo
-
Run dry-run - Press
<leader>fdor use:FluxcdDryRun- First time: Telescope picker opens for kustomization path selection
- Subsequent runs: Uses remembered path automatically
-
View results - Rendered manifests appear in a split window
| Command | Description |
|---|---|
:FluxcdDryRun |
Run FluxCD dry-run for current kustomization |
:FluxcdSetPath |
Set/change kustomization path with directory picker |
:FluxcdStatus |
Show plugin status and debug information |
| Keymap | Command | Description |
|---|---|---|
<leader>fd |
:FluxcdDryRun |
Run dry-run |
<leader>fp |
:FluxcdSetPath |
Set kustomization path |
<leader>fs |
:FluxcdStatus |
Show status |
The plugin automatically detects FluxCD Kustomization manifests with these API versions:
kustomize.toolkit.fluxcd.io/v1kustomize.toolkit.fluxcd.io/v1beta1kustomize.toolkit.fluxcd.io/v1beta2
Each FluxCD manifest can have its own kustomization path:
apps/frontend.yamlβ./apps/frontendclusters/prod.yamlβ./clusters/production- Paths are stored persistently in
~/.local/share/nvim/fluxcd_paths.json
The plugin intelligently manages windows:
- Finds main editor window (skips neo-tree, terminals, etc.)
- Creates splits from the correct window
- Preserves your existing layout
- Reuses result buffers for the same kustomization
{
'vgromanov/fluxcd.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
ft = 'yaml',
keys = {
{ '<leader>fd', '<cmd>FluxcdDryRun<CR>', desc = 'FluxCD dry-run' },
{ '<leader>fp', '<cmd>FluxcdSetPath<CR>', desc = 'Set FluxCD path' },
{ '<leader>fs', '<cmd>FluxcdStatus<CR>', desc = 'FluxCD status' },
},
config = function()
require('fluxcd').setup({
flux_cmd = 'flux', -- Custom flux command if needed
})
end,
}If your flux binary is in a custom location:
require('fluxcd').setup({
flux_cmd = '/usr/local/bin/flux',
})Ensure FluxCD CLI is installed and in your PATH:
# Install FluxCD CLI
curl -s https://fluxcd.io/install.sh | sudo bash
# Verify installation
flux versionUse :FluxcdStatus to see:
- Whether current file is detected as FluxCD Kustomization
- Storage file location and status
- Total stored paths
- Debug information
Kustomization paths are stored in:
- Linux/macOS:
~/.local/share/nvim/fluxcd_paths.json - Windows:
%LOCALAPPDATA%\nvim-data\fluxcd_paths.json
Contributions are welcome! Please feel free to submit a Pull Request.
- Clone the repository
- Make your changes
- Test with your FluxCD manifests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by kustomize.vim
- Built with plenary.nvim and telescope.nvim
- FluxCD team for the amazing GitOps toolkit
- β FluxCD API version detection
- β Dry-run execution with flux CLI
- β File-specific path management
- β Persistent storage
- β Telescope integration
- β Smart window management
- β Auto-detection and notifications
Made with β€οΈ for the FluxCD and Neovim communities