kube-utils-nvim icon indicating copy to clipboard operation
kube-utils-nvim copied to clipboard

Commands Not Found Despite Proper Configuration

Open kpinarci opened this issue 3 months ago • 1 comments

Issue Description

I'm experiencing an issue where the plugin commands are not being recognized by Neovim, despite following the installation instructions from the README. All keymaps are configured correctly, but when triggered, I get the error:

E492: Not an editor command: HelmDependencyUpdateFromBuffer

Environment

  • Neovim Version: 0.9.0+ (Lazy.nvim)
  • Plugin Manager: lazy.nvim (lua)
  • OS: macOS
  • Plugin Version: v0.0.4

Dependencies Installed

  • ✅ helm (confirmed installed)
  • ✅ kubectl (confirmed installed)
  • ✅ k9s (confirmed installed)
  • ✅ nvim-telescope/telescope.nvim
  • ✅ folke/which-key.nvim

Current Configuration

Plugin Configuration (lua/plugins/kube-utils.lua)

return {
  {
    "h4ckm1n-dev/kube-utils-nvim",
    dependencies = { "nvim-telescope/telescope.nvim", "folke/which-key.nvim" },
    lazy = true,
    event = "VeryLazy",
    config = function()
      local kube_utils_mappings = {
        { "<leader>k", group = "Kubernetes" },
        -- Helm Commands
        { "<leader>kh", group = "Helm" },
        { "<leader>khT", "<cmd>HelmDryRun<CR>", desc = "Helm DryRun Buffer" },
        { "<leader>khb", "<cmd>HelmDependencyBuildFromBuffer<CR>", desc = "Helm Dependency Build" },
        { "<leader>khd", "<cmd>HelmDeployFromBuffer<CR>", desc = "Helm Deploy Buffer to Context" },
        { "<leader>khr", "<cmd>RemoveDeployment<CR>", desc = "Helm Remove Deployment From Buffer" },
        { "<leader>kht", "<cmd>HelmTemplateFromBuffer<CR>", desc = "Helm Template From Buffer" },
        { "<leader>khu", "<cmd>HelmDependencyUpdateFromBuffer<CR>", desc = "Helm Dependency Update" },
        -- Kubectl Commands
        { "<leader>kk", group = "Kubectl" },
        { "<leader>kkC", "<cmd>SelectSplitCRD<CR>", desc = "Download CRD Split" },
        { "<leader>kkD", "<cmd>DeleteNamespace<CR>", desc = "Kubectl Delete Namespace" },
        { "<leader>kkK", "<cmd>OpenK9s<CR>", desc = "Open K9s" },
        { "<leader>kka", "<cmd>KubectlApplyFromBuffer<CR>", desc = "Kubectl Apply From Buffer" },
        { "<leader>kkc", "<cmd>SelectCRD<CR>", desc = "Download CRD" },
        { "<leader>kkk", "<cmd>OpenK9sSplit<CR>", desc = "Split View K9s" },
        { "<leader>kkl", "<cmd>ToggleYamlHelm<CR>", desc = "Toggle YAML/Helm" },
        -- Logs Commands
        { "<leader>kl", group = "Logs" },
        { "<leader>klf", "<cmd>JsonFormatLogs<CR>", desc = "Format JSON" },
        { "<leader>klv", "<cmd>ViewPodLogs<CR>", desc = "View Pod Logs" },
      }
      
      require("which-key").add(kube_utils_mappings)
    end,
  },
}

Steps Taken

  1. Initial Configuration: Configured plugin with lazy = false (didn't work)
  2. Updated Configuration: Changed to lazy = true, event = "VeryLazy" as per README
  3. Keymap Management: Moved keymaps from global keymaps.lua to plugin config
  4. Dependencies: Verified all required dependencies are installed and available
  5. Restart: Restarted Neovim multiple times
  6. Plugin Update: Ensured plugin is on latest version

Expected Behavior

Commands like HelmDependencyUpdateFromBuffer, HelmDryRun, KubectlApplyFromBuffer, etc. should be available and functional when triggered via keymaps.

Actual Behavior

All commands result in:

E492: Not an editor command: [CommandName]

Debug Information

  • Which-key shows the keymaps correctly
  • No error messages during plugin loading
  • :Lazy shows plugin is loaded successfully
  • Commands are not available via :command completion

Questions

  1. Setup Function: Does the plugin require an explicit setup call that's not mentioned in the README?
  2. Load Order: Could this be a plugin loading order issue with Lazy.nvim?
  3. Command Registration: Are the commands supposed to be registered automatically on plugin load?
  4. Debugging: What's the best way to debug whether the plugin's commands are being registered?

Additional Context

Using Lazy.nvim as the base configuration. The plugin loads without errors, but none of its commands are available. This suggests the plugin might not be registering its commands properly or there's a configuration step missing from the documentation.

Any help or guidance would be greatly appreciated!

kpinarci avatar Aug 19 '25 07:08 kpinarci