StackGen is the Generative Infrastructure Platform. You can use StackGen to build, manage, and deploy your infrastructure using Terraform.
Try StackGen for free at StackGen Cloud Console.
This plugin provides a Neovim interface to StackGen, allowing you to interact with StackGen directly from neovim.
- Browse, manage, and publish available terraform modules in StackGen
- Neovim 0.9 or later
- nvim-lua/plenary.nvim
- nvim-telescope/telescope.nvim
Using lazy.nvim:
{
'stackgenhq/stackgen.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
opts = {
url = 'https://cloud.stackgen.com', -- StackGen Cloud Console URL
},
config = function(_, opts)
require("stackgen").setup(opts)
vim.keymap.set("n", "<leader>sgl", "<cmd>StackGenModuleList<CR>")
vim.keymap.set("n", "<leader>sgs", "<cmd>StackGenModuleSync<CR>")
end
}
You need to set up your StackGen token to authenticate with the StackGen API. You can do this by running the following command in Neovim:
:StackGen set_token <your_token>
Note: You can generate a personal access token in the StackGen Cloud Console in settings.
Make sure to run :checkhealth stackgen
to verify that the plugin is set up correctly.
Note: You must set up url and token before running
:checkhealth stackgen
.
All stackgen.nvim
functions are wrapped in vim
commands for easy access, tab completion, and key mappings.
:StackGen set_token <token>
: Set the StackGen personal access token for authentication.:StackGen module_list
List available terraform modules in StackGen and open them in Telescope.:StackGen module_get <module_uuid>
: Search for terraform modules in StackGen and open the module files in Telescope.:StackGen module_sync
Sync the local module cache with StackGen.:StackGen module_publish <version-name>
: Publish a terraform module to StackGen.:StackGen show_config
: Show the current StackGen configuration.
" Show all commands
:StackGen
" Tab completion
:StackGen |<tab>
:StackGen module_list
" Setting options
:StackGen module_get <module_uuid>
You can set up key mappings for the commands in your Neovim configuration. For example:
vim.keymap.set("n", "<leader>sgl", "<cmd>StackGen module_list<CR>")
vim.keymap.set("n", "<leader>sgs", "<cmd>StackGen module_sync<CR>")