{"id":27743504,"url":"https://github.com/julwrites/llm-nvim","last_synced_at":"2026-01-28T10:10:00.032Z","repository":{"id":287905512,"uuid":"966155929","full_name":"julwrites/llm-nvim","owner":"julwrites","description":"Neovim plugin for llm CLI","archived":false,"fork":false,"pushed_at":"2025-12-31T01:32:15.000Z","size":694,"stargazers_count":8,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"staging","last_synced_at":"2026-01-04T02:16:52.783Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/julwrites.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security/README.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-04-14T13:42:12.000Z","updated_at":"2025-12-31T01:32:16.000Z","dependencies_parsed_at":"2025-04-14T15:51:21.057Z","dependency_job_id":"c116e774-e0a0-4716-95f4-ce3c4250899d","html_url":"https://github.com/julwrites/llm-nvim","commit_stats":null,"previous_names":["julwrites/llm-nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/julwrites/llm-nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julwrites%2Fllm-nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julwrites%2Fllm-nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julwrites%2Fllm-nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julwrites%2Fllm-nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julwrites","download_url":"https://codeload.github.com/julwrites/llm-nvim/tar.gz/refs/heads/staging","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julwrites%2Fllm-nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-04-28T18:00:31.424Z","updated_at":"2026-01-28T10:10:00.026Z","avatar_url":"https://github.com/julwrites.png","language":"Lua","funding_links":[],"categories":["AI","Recently Updated"],"sub_categories":["(requires Neovim 0.5)","[Apr 28, 2025](/content/2025/04/28/README.md)","Diagnostics"],"readme":"# llm-nvim\n\nA Neovim plugin for integrating with [Simon Willison's llm CLI tool](https://github.com/simonw/llm).\n\n## Feature Demos\n\n### Model, Plugin and Key Management\nhttps://github.com/user-attachments/assets/d8c9b2f8-4617-4534-9a64-05a2447d9380\n\n### Schema Management\nhttps://github.com/user-attachments/assets/b326370e-5752-46af-ba5c-6ae08d157f01\n\n### Fragment Management\nhttps://github.com/user-attachments/assets/2fc30538-6fd5-4cfa-9b7b-7fd7757f20c1\n\n\n\n## Feature List\n\n- Unified LLM command interface (`:LLM`)\n- Interactive prompting with fragments support\n- Process selected text or entire files with LLMs \n- Explain code in current buffer\n- Support for custom models and system prompts\n- API key management for multiple providers\n- Fragment management (files, URLs, GitHub repos)\n- Unified manager window (`:LLMConfig`) with views for:\n  - Models\n  - Plugins\n  - API Keys\n  - Fragments\n- Markdown-formatted responses with syntax highlighting\n- Asynchronous command execution\n\n## Requirements\n\n- Neovim 0.7.0 or later\n- Lua 5.2+ (Neovim bundles LuaJIT 2.1+ which is compatible)\n- [llm CLI tool](https://github.com/simonw/llm) installed (`pip install llm` or `brew install llm`)\n\n### Lua Compatibility Note\n\nThis plugin uses Lua 5.2+ APIs (`table.unpack`) for forward compatibility. Neovim bundles LuaJIT 2.1+ which provides these APIs, so no additional Lua installation is required.\n\n## Installation\n\n### Using [vim-plug](https://github.com/junegunn/vim-plug)\n\n```vim\nPlug 'julwrites/llm-nvim'\n```\n\n### Using [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse 'julwrites/llm-nvim'\n```\n\n### Using [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n-- Example lazy.nvim configuration\nreturn {\n  {\n    'julwrites/llm-nvim',\n    -- Optional: Specify dependencies if needed, e.g., for UI components\n    -- dependencies = { 'nvim-lua/plenary.nvim' },\n    config = function()\n      -- Configure the plugin\n      require('llm').setup({\n        -- Specify the default LLM model to use\n        model = 'gpt-4o', -- Or 'claude-3-haiku-20240307', 'llama3', etc.\n\n        -- Define a default system prompt (optional)\n        system_prompt = 'You are a helpful Neovim assistant.',\n\n        -- Disable default key mappings if you prefer to set your own\n        -- no_mappings = true,\n\n        -- Enable debug logging (optional)\n        -- debug = true,\n\n        -- Enable or disable automatic updates for the underlying `llm` CLI tool.\n        -- Defaults to `false`.\n        -- auto_update_cli = false,\n\n        -- Set the interval in days for checking for `llm` CLI updates.\n        -- Defaults to `7`.\n        -- auto_update_interval_days = 7,\n      })\n\n      -- Example custom key mappings (if no_mappings = true or for overrides)\n      -- vim.keymap.set('n', '\u003cleader\u003elp', '\u003cPlug\u003e(llm-prompt)', { desc = \"LLM Prompt\" })\n      -- vim.keymap.set('v', '\u003cleader\u003els', '\u003cPlug\u003e(llm-selection)', { desc = \"LLM Selection\" })\n      -- vim.keymap.set('n', '\u003cleader\u003elt', '\u003cPlug\u003e(llm-toggle)', { desc = \"LLM Toggle Manager\" })\n    end\n  }\n}\n```\n\n## Configuration\n\n```lua\n-- Setup with configuration options\nrequire('llm').setup({\n  model = 'gpt-4o',                          -- Default model to use\n  system_prompt = 'You are a helpful assistant.', -- Default system prompt\n  no_mappings = false,                       -- Set to true to disable default mappings\n  debug = false,                             -- Set to true to enable debug output\n  auto_update_cli = false,                   -- Enable/disable CLI auto-updates (default: false)\n  auto_update_interval_days = 7,             -- Interval in days for CLI update checks (default: 7)\n})\n\n-- Custom mappings\nvim.keymap.set('n', '\u003cleader\u003elp', '\u003cPlug\u003e(llm-prompt)')\nvim.keymap.set('v', '\u003cleader\u003els', '\u003cPlug\u003e(llm-selection)')\nvim.keymap.set('n', '\u003cleader\u003ele', '\u003cPlug\u003e(llm-explain)')\nvim.keymap.set('n', '\u003cleader\u003elm', '\u003cPlug\u003e(llm-models)') -- Note: \u003cPlug\u003e(llm-select-model) is deprecated\n```\n\n### Automatic CLI Updates\n\nThe plugin includes a feature to automatically check for updates to the `llm` command-line tool upon startup.\n\n- When enabled via the `auto_update_cli = true` setting, the plugin will check if the configured `auto_update_interval_days` has passed since the last check.\n- If an update check is due, it will attempt to update the `llm` CLI tool. The update mechanism tries common upgrade methods including `uv tool upgrade llm`, `pipx upgrade llm`, `pip install --upgrade llm` (and `python -m pip install --upgrade llm`), and `brew upgrade llm` to keep the tool current.\n- This check runs asynchronously in the background to avoid impacting Neovim's startup time.\n- You will receive a notification about the outcome of the update attempt (success or failure).\n\nThis helps ensure your `llm` tool stays up-to-date with the latest features and fixes.\n\n## Usage Examples\n\n### Commands\n\n#### Unified LLM Command\n- `:LLM {prompt}` - Send prompt to LLM\n- `:LLM file [{prompt}]` - Send current file's content with optional prompt  \n- `:LLM selection [{prompt}]` - Send visual selection with optional prompt\n- `:LLM explain` - Explain current buffer's code\n- `:LLM fragments` - Interactive prompt with fragment selection\n- `:LLM update` - Manually trigger an update check for the underlying `llm` CLI tool.\n\n#### Unified Manager\n- `:LLMConfig [view]` - Open unified manager window\n  - Optional views: `models`, `plugins`, `keys`, `fragments`\n- `:LLMConfig models` - Open Models view\n- `:LLMConfig plugins` - Open Plugins view\n- `:LLMConfig keys` - Open API Keys view\n- `:LLMConfig fragments` - Open Fragments view\n\n### Basic Prompting\n\n1.  Type `:LLM Write a short poem about Neovim` and press Enter.\n2.  A new buffer will open with the LLM's response.\n\n### Working with Code\n\n1.  Visually select a block of code.\n2.  Type `:LLMWithSelection Refactor this code for clarity` and press Enter.\n3.  The selected code and your prompt will be sent to the LLM.\n\n### Explaining Code\n\n1.  Open a code file.\n2.  Type `:LLMExplain` and press Enter.\n3.  The LLM will explain the code in the current buffer.\n\n### Using the Unified Manager\n\n1.  Type `:LLMConfig` or press `\u003cleader\u003ell` (default mapping).\n2.  The manager window opens, likely showing the Models view first.\n3.  Press `P` to switch to the Plugins view.\n4.  Press `K` to switch to the API Keys view.\n5.  Navigate the list using `j` and `k`.\n6.  Follow the instructions in the header for actions (e.g., press `s` in the Models view to set a default model).\n7.  Press `q` or `\u003cEsc\u003e` to close the manager.\n\n## Suggested Mappings\n\nThe plugin provides default key mappings that can be disabled with `no_mappings = true`. Here are the default mappings and some suggested alternatives:\n\n```lua\n-- Toggle unified manager\nvim.keymap.set('n', '\u003cleader\u003ell', '\u003cCmd\u003eLLMConfig\u003cCR\u003e', { desc = \"Toggle LLM Manager\" })\n\n-- Basic prompt\nvim.keymap.set('n', '\u003cleader\u003elp', '\u003cCmd\u003eLLM\u003cSpace\u003e', { desc = \"LLM Prompt\" })\n\n-- Explain current buffer\nvim.keymap.set('n', '\u003cleader\u003ele', '\u003cCmd\u003eLLM explain\u003cCR\u003e', { desc = \"Explain Code\" })\n\n-- Prompt with visual selection\nvim.keymap.set('v', '\u003cleader\u003els', '\u003cCmd\u003eLLM selection\u003cCR\u003e', { desc = \"LLM Selection\" })\n\n-- Interactive fragments\nvim.keymap.set('n', '\u003cleader\u003elf', '\u003cCmd\u003eLLM fragments\u003cCR\u003e', { desc = \"LLM with Fragments\" })\n```\n\n## Development\n\n### Testing\n\nThe plugin includes a test suite using [busted](https://github.com/Olivine-Labs/busted). To run the tests, you first need to install the test dependencies:\n\n```bash\nsudo luarocks install busted\nsudo luarocks install luassert\n```\n\nThen, you can run the tests:\n\n```bash\n# Run all tests\nmake test\n\n# Run a specific test file\nmake test file=init_spec.lua\n```\n\nTests cover:\n- Core functionality (prompts, code explanation)\n- Model management\n- Plugin management\n- API key management\n- Fragment management\n\n### Code Coverage\n\nThis project enforces a minimum code coverage of 70%. The CI/CD pipeline will fail if the coverage drops below this threshold. To run the coverage check locally, you first need to install the coverage dependencies:\n\n```bash\nsudo luarocks install luacov\nsudo luarocks install luacov-console\n```\n\nThen, you can run the coverage check:\n\n```bash\nmake coverage\n```\n\nThis will run the tests with Luacov and print a coverage report to the console.\n\n\n## Troubleshooting\n\n### Lua Compatibility Errors\n\nIf you encounter errors like \"attempt to call a nil value (global 'unpack')\":\n- Ensure you're using Neovim 0.7.0 or later\n- Check your Lua version: `:lua print(_VERSION)` in Neovim\n- Update Neovim if you're using an older version\n- Report the issue with your Neovim and Lua versions if problems persist\n\nThe plugin requires Lua 5.2+ APIs which are provided by Neovim's bundled LuaJIT 2.1+.\n\n## Documentation\n\nFor more detailed documentation, including architecture and contribution guides, see the [Documentation Directory](docs/README.md).\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulwrites%2Fllm-nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulwrites%2Fllm-nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulwrites%2Fllm-nvim/lists"}