A Neovim plugin that integrates Amazon Q CLI to provide AI assistance directly in your editor.
- Interactive chat interface within Neovim
- Streaming responses (appear progressively)
- Maintains full conversation context
- Support for markdown formatting in responses
- Syntax highlighting for messages and code
- Floating windows for a clean user experience
- Intuitive commands to interact with Amazon Q
- Customizable theme and icon support
- Neovim 0.7.0+
- Amazon Q CLI installed and configured
- Lua 5.1+
- (Optional) A Nerd Font for icons
Before using this plugin, you must install Amazon Q CLI by following the official AWS instructions: Amazon Q CLI Installation Guide
Summary of steps:
# For Ubuntu
curl -L https://d3op2l3ur5y0ol.cloudfront.net/latest/installer.sh | bash
sudo apt-get install -f
sudo dpkg -i amazon-q.deb
q
After installing Amazon Q CLI, you need to authenticate:
q loginFollow the on-screen instructions to complete authentication with your AWS account.
With packer.nvim
use {
'your-username/amazon-q.nvim',
requires = {
'nvim-lua/plenary.nvim', -- Optional, for additional utilities
}
}With lazy.nvim
{
'your-username/amazon-q.nvim',
dependencies = {
'nvim-lua/plenary.nvim', -- Optional, for additional utilities
}
}require('amazon-q').setup({
-- Configuration options (optional)
window = {
width = 0.8, -- Window width (percentage of total width)
height = 0.8, -- Window height (percentage of total height)
border = 'rounded', -- Border style: 'none', 'single', 'double', 'rounded'
title = ' Amazon Q ', -- Window title
title_pos = 'center', -- Title position: 'left', 'center', 'right'
background_color = '#1E1E2E', -- Background color for the window
zindex = 50, -- Z-index to control overlapping
},
theme = {
user_color = '#4B9CD3', -- Color for user messages
assistant_color = '#FF9900', -- Color for Amazon Q messages
code_bg = '#1E1E1E', -- Background color for code blocks
code_fg = '#DCDCAA', -- Text color for code blocks
separator_char = '─', -- Character for separators
use_icons = true, -- Use icons (requires an icon font)
},
mappings = {
close = 'q', -- Key to close the chat window
input = 'i', -- Key to open the input prompt
cancel = '<Esc>', -- Key to cancel input
send = '<CR>', -- Key to send message
},
format = {
user_prefix = '## User:',
assistant_prefix = '## Amazon Q:',
processing_text = '⏳ Processing response...',
user_icon = ' ', -- Icon for user (requires Nerd Font)
assistant_icon = ' ', -- Icon for Amazon Q (requires Nerd Font)
},
command = {
path = 'q', -- Path to Amazon Q CLI executable
args = {'chat'}, -- Arguments for the command
debug = false, -- Enable/disable debug mode
}
}):AmazonQChat- Opens the chat window:AmazonQClose- Closes the chat session:AmazonQKill- Forcefully kills the chat instance (useful if it gets stuck):AmazonQRestart- Restarts the chat session:AmazonQDebug on/off- Enables/disables debug mode
- Press
ito open the input prompt - Type your message and press Enter to send it
- Press
qto close the window
If you encounter issues with the plugin:
-
Verify that Amazon Q CLI is installed correctly:
q --version
-
Make sure you are authenticated:
q login
-
Enable debug mode to see more information:
:AmazonQDebug on -
Check the log file:
:e ~/.cache/nvim/amazon-q-debug.log
MIT