{"id":25807170,"url":"https://github.com/anongecko/ai-nvim","last_synced_at":"2025-02-27T20:59:50.150Z","repository":{"id":279741102,"uuid":"939795071","full_name":"anongecko/ai-nvim","owner":"anongecko","description":"(WIP) Full AI plugin for Nvim with project support, ability to auto-apply changes, multi-API support, etc.","archived":false,"fork":false,"pushed_at":"2025-02-27T05:50:41.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T06:50:28.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anongecko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T05:49:39.000Z","updated_at":"2025-02-27T05:50:44.000Z","dependencies_parsed_at":"2025-02-27T06:50:30.349Z","dependency_job_id":"8f04ae7b-b8c5-4b9d-8d15-e3d2983b1f89","html_url":"https://github.com/anongecko/ai-nvim","commit_stats":null,"previous_names":["anongecko/ai-nvim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anongecko%2Fai-nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anongecko%2Fai-nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anongecko%2Fai-nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anongecko%2Fai-nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anongecko","download_url":"https://codeload.github.com/anongecko/ai-nvim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241059713,"owners_count":19902428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-27T20:59:49.513Z","updated_at":"2025-02-27T20:59:50.141Z","avatar_url":"https://github.com/anongecko.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"Still working on this one.\n\n# AI Assistant for Neovim\n\nA deep integration of AI assistance into your Neovim workflow with project awareness, multiple AI providers, and advanced context management.\n\n## Features\n\n- **Multiple AI Provider Support**: OpenAI, Anthropic (Claude), Azure OpenAI, and Mistral\n- **Project Context**: Smart project-aware context building for more relevant AI responses\n- **Treesitter Integration**: Intelligent code understanding with syntax awareness\n- **Intuitive UI**: Panel interface for seamless interaction with AI\n- **Command API**: Comprehensive API for extending or integrating with other plugins\n- **Telescope Integration**: Fuzzy finding for providers, history, and context files\n- **Streaming Responses**: Real-time AI responses for a more interactive experience\n- **Code Change Preview**: Preview and selectively apply code suggestions\n\n## Installation\n\nUsing [lazy.nvim](https://github.com/folke/lazy.nvim):\n\n```lua\n{\n  \"anongecko/ai-assistant.nvim\",\n  dependencies = {\n    \"nvim-lua/plenary.nvim\",\n    \"MunifTanjim/nui.nvim\",\n    \"nvim-telescope/telescope.nvim\",\n    \"nvim-treesitter/nvim-treesitter\",\n    \"rcarriga/nvim-notify\", -- optional\n  },\n  config = function()\n    require(\"ai-assistant\").setup({\n      -- Optional configuration here\n    })\n  end,\n}\n```\n\nWith [packer.nvim](https://github.com/wbthomason/packer.nvim):\n\n```lua\nuse {\n  \"username/ai-assistant.nvim\",\n  requires = {\n    \"nvim-lua/plenary.nvim\",\n    \"MunifTanjim/nui.nvim\",\n    \"nvim-telescope/telescope.nvim\",\n    \"nvim-treesitter/nvim-treesitter\",\n    \"rcarriga/nvim-notify\", -- optional\n  },\n  config = function()\n    require(\"ai-assistant\").setup({\n      -- Optional configuration here\n    })\n  end\n}\n```\n\n## Configuration\n\nThe plugin comes with sensible defaults, but you can customize it:\n\n```lua\nrequire(\"ai-assistant\").setup({\n  provider = {\n    default = \"openai\", -- openai, anthropic, azure, mistral\n    openai = {\n      api_key = vim.env.OPENAI_API_KEY, -- or set directly: \"sk-...\"\n      api_model = \"gpt-4-turbo\", -- Model to use\n      max_tokens = 2048, -- Max tokens per request\n      temperature = 0.7, -- Creativity level\n    },\n    anthropic = {\n      api_key = vim.env.ANTHROPIC_API_KEY,\n      api_model = \"claude-3-opus-20240229\",\n    },\n    -- Configure other providers similarly\n  },\n  context = {\n    enable_project_context = true, -- Include project files in context\n    enable_buffer_context = true, -- Include current buffer in context\n    max_context_tokens = 7000, -- Max context size in tokens\n    max_files = 10, -- Max files to include in context\n    exclusions = {\n      file_patterns = { \"%.git/\", \"node_modules/\", \"%.png$\" }, -- Patterns to exclude\n      paths = { \"dist\", \"build\" }, -- Specific paths to exclude\n      max_file_size = 1048576, -- 1MB max file size\n    },\n  },\n  ui = {\n    panel = {\n      position = \"right\", -- top, right, bottom, left\n      size = 0.4, -- 0.0-1.0 representing percentage of editor size\n      border = \"rounded\", -- none, single, double, rounded, solid, shadow\n    },\n  },\n  keymaps = {\n    toggle_panel = \"\u003cleader\u003eai\", -- Toggle AI panel\n    context_menu = \"\u003cleader\u003eac\", -- Open context menu\n    inline_completion = \"\u003cC-a\u003e\", -- Trigger inline completion\n  },\n})\n```\n\n## Usage\n\n### Commands\n\n- `:AIPanel` - Toggle the AI assistance panel\n- `:AIExplain` - Explain selected code (visual mode)\n- `:AIRefactor` - Refactor selected code (visual mode)\n- `:AIDocument` - Add documentation to selected code (visual mode)\n- `:AITest` - Generate tests for selected code (visual mode)\n- `:AIProvider [name]` - Display or set the current AI provider\n- `:AIClearContext` - Clear the context cache\n\n### Panel Interface\n\nThe panel interface allows you to interact with the AI assistant:\n- Type your prompt in the input area\n- Press `\u003cEnter\u003e` to submit\n- View the response in the output area\n- Use `\u003cEsc\u003e` to close the panel\n\n### API Usage\n\nYou can use the plugin programmatically:\n\n```lua\nlocal ai = require(\"ai-assistant\")\n\n-- Send a query to the AI\nlocal response = ai.query(\"Explain how promises work in JavaScript\")\n\n-- Stream a response with callback\nlocal request_id = ai.stream_query(\"Generate a function that...\", function(chunk)\n  if chunk.content then\n    print(chunk.content)\n  elseif chunk.finish_reason then\n    print(\"Done!\")\n  end\nend)\n\n-- Cancel a request\nai.cancel_query(request_id)\n\n-- Open the panel with a prepared prompt\nai.open_panel({ with_prompt = \"Explain this code:\\n```\\nfunction example() {...}\\n```\" })\n\n-- Explain code\nlocal code = \"function add(a, b) { return a + b }\"\nlocal explanation = ai.explain_code(code, { with_focus = \"performance\" })\n```\n\n### Telescope Integration\n\nIf you have Telescope installed, you can use these additional commands:\n\n```lua\n:Telescope ai_providers  -- Select AI provider\n:Telescope ai_context    -- Browse and select context files\n```\n\n## Requirements\n\n- Neovim \u003e= 0.7.0\n- curl (for API requests)\n- plenary.nvim\n- nui.nvim\n- Optional but recommended:\n  - nvim-treesitter\n  - telescope.nvim\n  - nvim-notify\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanongecko%2Fai-nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanongecko%2Fai-nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanongecko%2Fai-nvim/lists"}