Skip to content

Kraust/codecompanion-gitlab.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeCompanion Gitlab Duo Adapter

Neovim Lua License: MIT

A Gitlab Duo Adapter for CodeCompanion.nvim

πŸ“‹ Requirements

πŸ“¦ Installation

vim.pack.add

vim.pack.add({
    "https://github.com/olimorris/codecompanion.nvim",
    "https://github.com/Kraust/codecompanion-gitlab.nvim",
})

Use Gilab Duo as an Adapter for CodeCompanion.nvim

require("codecompanion").setup({
    opts = {
        language = "English",
        system_prompt = "",
    },
    strategies = {
        chat = {
            adapter = "gitlab_duo",
            roles = {
                llm = function(adapter)
                    return "CodeCompanion (" .. adapter.formatted_name .. ")"
                end,
                user = "Me",
            },
            keymaps = {
                submit = {
                    modes = { n = "<CR>" },
                    description = "Submit",
                    callback = function(chat)
                        chat:submit()
                    end,
                },
            },
        },
        inline = {
            adapter = "gitlab_duo",
        },
    },
    adapters = {
        gitlab_duo = function()
            return require("codecompanion-gitlab.adapters.gitlab_duo")
        end,
    },
})

Environmental Variables

  • GITLAB_API_KEY - Your Gitlab Personal Access Token
  • GITLAB_URL - The URL to your Gitlab Instance (e.g. http://gitlab.my.domain:1235/)

About

CodeCompanion Integration for Gitlab Duo

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages