Skip to content

Mrthnx/amazon-q.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amazon Q.nvim

A Neovim plugin that integrates Amazon Q CLI to provide AI assistance directly in your editor.

Features

  • 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

Requirements

  • Neovim 0.7.0+
  • Amazon Q CLI installed and configured
  • Lua 5.1+
  • (Optional) A Nerd Font for icons

Prerequisites

1. Install Amazon Q CLI

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

2. Authenticate with Amazon Q

After installing Amazon Q CLI, you need to authenticate:

q login

Follow the on-screen instructions to complete authentication with your AWS account.

Installation

use {
  'your-username/amazon-q.nvim',
  requires = {
    'nvim-lua/plenary.nvim', -- Optional, for additional utilities
  }
}
{
  'your-username/amazon-q.nvim',
  dependencies = {
    'nvim-lua/plenary.nvim', -- Optional, for additional utilities
  }
}

Configuration

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
  }
})

Usage

Basic Commands

  • :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

In the Chat Window

  • Press i to open the input prompt
  • Type your message and press Enter to send it
  • Press q to close the window

Troubleshooting

If you encounter issues with the plugin:

  1. Verify that Amazon Q CLI is installed correctly:

    q --version
  2. Make sure you are authenticated:

    q login
  3. Enable debug mode to see more information:

    :AmazonQDebug on
    
  4. Check the log file:

    :e ~/.cache/nvim/amazon-q-debug.log
    

License

MIT

About

Plugin de chat usando amazon Q

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages