Because the sweetest workflows come from tasting many truffles, not just sticking to one - experiment and discover what works for you!
A Neovim plugin that adds a cozy sidebar terminal where you can chat with your favorite CLI-based AI tools like cursor-agent, gemini, codex, opencode, and friends. Think of it as your personal AI assistant panel that's always just a keystroke away!
- ๐ฏ Multi-Profile Support: Switch between different AI tools seamlessly
- ๐ Flexible Layout: Sidebar on left, right, or bottom - you choose!
- ๐ Quick Actions: Send files or selections with ease
Using lazy.nvim
{
"Nkr1shna/truffle.nvim",
config = function()
require("truffle").setup({
profiles = {
cursor = {
command = "cursor-agent",
default = true,
},
codex = {
command = "codex",
env = "~/.env"
},
gemini = {
command = "gemini-cli",
cwd = "~/projects/current",
env = {
GOOGLE_API_KEY="YOUR_API_KEY"
}
},
}
})
end,
}Using packer.nvim
use {
"Nkr1shna/truffle.nvim",
config = function()
require("truffle").setup({
profiles = {
cursor = { command = "cursor-agent", default = true },
claude = { command = "claude-cli" },
}
})
end
}Using vim-plug
Plug 'Nkr1shna/truffle.nvim'
" Add to your init.lua or in a lua block:
lua << EOF
require("truffle").setup({
profiles = {
cursor = { command = "cursor-agent", default = true },
claude = { command = "claude-cli" },
}
})
EOFUsing dein.vim
call dein#add('Nkr1shna/truffle.nvim')
" Configuration in init.lua or lua block
lua require("truffle").setup({ profiles = { cursor = { command = "cursor-agent", default = true } } })| Option | Type | Default | Description |
|---|---|---|---|
side |
string |
"right" |
Panel position: "right", "left", or "bottom" |
size |
number/string |
nil |
Panel size (cols/rows) or percentage like "33%" |
start_insert |
boolean |
false |
Start in insert mode when opening |
create_mappings |
boolean |
true |
Create default key mappings |
mappings |
table |
See below | Custom key mapping overrides |
profiles |
table |
Required | Profile configurations (see below) |
| Mapping | Default Key | Mode | Description |
|---|---|---|---|
toggle |
<leader>tc |
Normal | Toggle the truffle panel |
send_selection |
<leader>ts |
Visual | Send selected text |
send_file |
<leader>tf |
Normal | Send current file |
next_profile |
]c |
Normal | Switch to next profile |
prev_profile |
[c |
Normal | Switch to previous profile |
Each profile is a table with the following options:
| Option | Type | Required | Description |
|---|---|---|---|
command |
string |
โ | CLI command to execute |
cwd |
string |
โ | Working directory for the command |
env |
table/string |
โ | Environment variables (table) or path to .env file |
default |
boolean |
โ | Mark as default profile when multiple profiles are configured (only one allowed) |
require("truffle").setup({
side = "right",
size = "30%",
profiles = {
cursor = {
command = "cursor-agent",
default = true,
},
claude = {
command = "claude-cli --interactive",
cwd = "~/code/current-project",
},
gemini = {
command = "gemini-chat",
env = { API_KEY = "your-key-here" },
},
}
})require("truffle").setup({
side = "bottom",
size = 15,
start_insert = true, -- Override default to start in insert mode
mappings = {
toggle = "<leader>ai",
send_selection = "<leader>as",
send_file = "<leader>af",
},
profiles = {
work_claude = {
command = "claude",
cwd = "~/work/projects",
env = "~/.config/truffle/work.env", -- Load from file
default = true,
},
personal_gpt = {
command = "codex",
cwd = "~/personal",
env = {
OPENAI_API_KEY = "sk-...",
MODEL = "gpt-4",
},
},
}
})require("truffle").setup({
profiles = {
ai = { command = "cursor-agent", default = true }
}
})| Command | Description |
|---|---|
:TruffleToggle |
Toggle the truffle panel |
:TruffleOpen |
Open the truffle panel |
:TruffleClose |
Close the truffle panel |
:TruffleFocus |
Focus the truffle panel |
:TruffleSwitchProfile [name] [cwd=path] |
Switch to a different profile by providing another cwd |
" List all available profiles
:TruffleSwitchProfile
" Switch to claude profile
:TruffleSwitchProfile claude
" Switch to cursor profile with custom working directory
:TruffleSwitchProfile cursor cwd=~/special-projectlocal truffle = require("truffle")
-- Panel control
truffle.toggle()
truffle.open()
truffle.close()
truffle.focus()
-- Send content
truffle.send_visual() -- Send current visual selection
truffle.send_file({ path = "current" })
-- Profile management
truffle.switch_profile("claude", { cwd = "/path/to/project" })
truffle.next_profile()
truffle.prev_profile()
-- State inspection
local current = truffle.get_current_profile()
local jobs = truffle.get_background_jobs()-
Quick Profile Switching: Use
]cand[cto cycle through your AI tools without leaving your keyboard home row! -
Environment Files: Store your API keys in separate
.envfiles for each profile:# ~/.config/truffle/claude.env ANTHROPIC_API_KEY=your_key_here MODEL=claude-3-sonnet -
Project-Specific AI: Set different working directories per profile to keep context relevant:
profiles = { work = { command = "claude-cli", cwd = "~/work" }, personal = { command = "gpt-cli", cwd = "~/personal" }, }
-
Send Files Easily: Use
<leader>tfto send the current file to your AI for review or questions. -
Custom Mappings: Don't like the defaults? Change them:
mappings = { toggle = "<C-a>", -- Ctrl+a to toggle send_selection = "gs", -- gs in visual mode }
Found a bug? Have a feature idea? Want to add support for a new AI tool? Contributions are welcome!
MIT License - see LICENSE for details.
Happy coding with your AI companions! ๐โจ

