https://github.com/jrollin/mistral-codestral.nvim
nvim mistral plugin for Mistral codestral code completion
https://github.com/jrollin/mistral-codestral.nvim
codestral mistral nvim nvim-plugin
Last synced: 4 months ago
JSON representation
nvim mistral plugin for Mistral codestral code completion
- Host: GitHub
- URL: https://github.com/jrollin/mistral-codestral.nvim
- Owner: jrollin
- License: mit
- Created: 2026-01-03T14:40:07.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-06T15:43:53.000Z (6 months ago)
- Last Synced: 2026-01-21T15:59:44.103Z (5 months ago)
- Topics: codestral, mistral, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 113 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 🤖 mistral-codestral.nvim
Intelligent code completion for Neovim using [Mistral Codestral](https://mistral.ai/) AI. Works with `blink.cmp` and `nvim-cmp`.
## ⚡ Quick Start
### 1. Install
Using lazy.nvim:
```lua
return {
"jrollin/mistral-codestral.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"saghen/blink.cmp", -- or "hrsh7th/nvim-cmp"
},
lazy = false,
priority = 1000,
config = function()
require("mistral-codestral").setup({
api_key = "cmd:head -n1 ~/.mistral_codestral_key | tr -d '\\n'",
model = "codestral-latest",
completion_engine = "blink.cmp",
virtual_text = { enabled = true, idle_delay = 800 },
})
end,
}
```
### 2. Setup API Key
```bash
# Save your API key (get one at https://console.mistral.ai/)
echo "your_key_here" > ~/.mistral_codestral_key
chmod 600 ~/.mistral_codestral_key
```
### 3. Start Using
- **Type in any file** → Suggestions appear after 800ms idle
- **Press ``** → Accept completion
- **Press ``** → Clear suggestion
- **`:MistralCodestralComplete`** → Manual trigger
### 4. Version Pinning (Recommended)
For stability in production, pin to a specific version:
```lua
return {
"jrollin/mistral-codestral.nvim",
tag = "v0.1.0", -- Pin to specific version
dependencies = {
"nvim-lua/plenary.nvim",
"saghen/blink.cmp",
},
config = function()
require("mistral-codestral").setup({...})
end,
}
```
Or use version ranges:
```lua
tag = "v0.*", -- Any v0.x version
```
See [releases](https://github.com/jrollin/mistral-codestral.nvim/releases) for available versions.
## 📚 Documentation
- **[CONFIGURATION.md](docs/CONFIGURATION.md)** - All config options with examples
- **[ARCHITECTURE.md](docs/ARCHITECTURE.md)** - How the plugin works (flows, design)
- **[TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** - Common issues and solutions
- **[VIRTUAL-TEXT.md](docs/VIRTUAL-TEXT.md)** - Virtual text mode details
- **[COMPLETION-ENGINES.md](docs/COMPLETION-ENGINES.md)** - nvim-cmp & blink.cmp setup
## 🔑 Commands & Bindings
| Command | Key | Description |
|---------|-----|-------------|
| `:MistralCodestralComplete` | `mc` | Manual completion |
| `:MistralCodestralAuth status` | `ma` | Check API key |
| `:MistralCodestralToggle` | - | Enable/disable plugin |
| `:checkhealth mistral-codestral` | - | Verify setup |
**Insert mode bindings:**
- `` - Accept completion
- `` - Accept next word (virtual text)
- `` - Accept current line (virtual text)
- `` - Clear suggestion
## ✨ Features
- **Virtual text** - GitHub Copilot-style inline suggestions
- **Completion menus** - Integrated with blink.cmp and nvim-cmp
- **Context-aware** - Understands your code structure via LSP
- **Smart caching** - Faster repeated completions
- **Buffer exclusions** - Skips UI buffers (help, neo-tree, etc.)
- **Non-blocking** - Async API calls don't interrupt typing
## 🩺 Verify Installation
See [docs/quick-start.md](docs/quick-start.md) for quick verification or [docs/testing-guide.md](docs/testing-guide.md) for comprehensive testing.
```bash
# Run health check
nvim +checkhealth\ mistral-codestral
# Quick API test
nvim --headless -u ~/.config/nvim/init.lua \
-c "luafile /tests/api_test.lua" 2>&1
# Interactive test
bash /scripts/run_tests.sh
```
**Note:** Replace `` with your plugin's installation directory:
- **lazy.nvim**: `~/.local/share/nvim/lazy/mistral-codestral.nvim` (Linux) or `~/.config/nvim/lazy/mistral-codestral.nvim` (macOS)
- **packer.nvim**: `~/.local/share/nvim/site/pack/packer/start/mistral-codestral.nvim` (Linux)
- **vim-plug**: `~/.vim/plugged/mistral-codestral.nvim` or `~/.config/nvim/plugged/mistral-codestral.nvim`
## ❓ Need Help?
1. Check [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for common issues
2. Run `:MistralCodestralAuth status` to check API key
3. Run `:checkhealth mistral-codestral` to verify setup
4. Review [CONFIGURATION.md](docs/CONFIGURATION.md) for available options
## 📄 License
MIT - See LICENSE file for details
---
**Get API key**: [Mistral Console](https://console.mistral.ai/)