# 💬 Basic Chat Operations This guide explains how to use the basic chat functionality of the Acode AI CLI Assistant Plugin. ## 🎯 Accessing the AI Assistant There are several ways to open the AI assistant: ### Keyboard Shortcut - **Windows/Linux**: `Ctrl + Shift + A` - **Mac**: `Cmd + Shift + A` ### Through Menu 1. Open Acode 2. Tap the AI CLI Assistant icon in the sidebar ## 📝 Chat Interface The chat interface consists of three main components: ### Message Display Area - Shows the conversation history between you and the AI - Displays both your queries and AI responses - Supports markdown formatting for rich text - Auto-scrolls to show the latest messages ### Input Text Area - Where you type your queries - Supports multi-line input (use Shift + Enter for new lines) - Has a placeholder with usage instructions ### Action Buttons - **Send Button**: Submit your query to the AI - **Stop Button**: Cancel ongoing AI generation - **New Chat Button**: Start a fresh conversation - **History Button**: Access previous conversations ## 📥 Sending Queries ### Simple Questions You can ask the AI anything related to coding: ``` How do I create a React component? Explain what a promise is in JavaScript What's the difference between let and const? ``` ### Code-Related Queries For more specific coding assistance: ``` How can I optimize this function? Explain this SQL query Convert this Python code to JavaScript ``` ### Project-Level Questions Ask about your entire project: ``` How should I organize this project? What's the best way to structure these files? Suggest improvements to my architecture ``` ## 📤 Receiving Responses ### Response Formatting AI responses are formatted with: - **Markdown support**: Code blocks, lists, headers, etc. - **Syntax highlighting**: For code snippets in responses - **Copy buttons**: Easy copying of code blocks - **Smooth animations**: For better visual experience ### Response Actions After receiving a response, you can: - **Copy code blocks**: Click the copy button on any code block - **Copy entire messages**: Use the menu option to copy all messages - **Export conversations**: Save chats for future reference ## 📚 Conversation History The plugin automatically saves your conversations: ### Accessing History 1. Click the **History** button in the chat header 2. Browse through previous conversations 3. Click on any conversation to load it ### Managing History - **Delete conversations**: Use the X button next to each history item - **Clear all history**: Use the menu option to clear all chat history - **Export conversations**: Save chats as JSON files for backup ### History Storage - Conversations are saved locally on your device - Each conversation is associated with its first query - History is encrypted along with API keys for security ## 🔄 Starting New Conversations To start a fresh conversation: 1. Click the **New Chat** button in the chat header 2. Or use the menu option "Clear Chat History" 3. The message display area will be cleared 4. Previous conversation history is saved automatically ## ⚡ Real-Time Features ### Streaming Responses - AI responses appear character by character for a natural feel - You can stop generation at any time using the Stop button - Visual indicators show when the AI is thinking ### Context Awareness The AI automatically has context about: - Current file name and extension - Current file content - Cursor position - Project structure ## 🛠️ Advanced Chat Options ### Menu Features Click the menu icon (three dots) in the chat header to access: - **Clear Chat History**: Start with a clean slate - **Export Conversation**: Save the current chat - **Copy All Messages**: Copy entire conversation to clipboard - **Bulk Operations**: Access file management tools - **Project Organization**: Get AI-powered project structure suggestions - **Settings**: Adjust plugin configuration ### Model Selection Change the AI model without switching providers: 1. Click the menu icon 2. Select "Model" 3. Choose from available models 4. The conversation continues with the new model ## 📋 Best Practices for Chatting ### Effective Queries - Be specific about what you need - Include relevant context when possible - Ask one question at a time for clearer responses ### Code Examples When asking about code: - Include the relevant code snippet - Mention the programming language if not obvious - Describe what you're trying to achieve ### Follow-Up Questions - You can ask follow-up questions in the same conversation - The AI remembers previous messages in the conversation - This helps provide more contextually relevant responses ## 🐛 Troubleshooting Chat Issues ### Common Chat Problems #### No Response - Check your internet connection - Verify your API key is valid - Ensure the selected AI provider is functioning #### Slow Responses - Some providers may be slower than others - Large context can slow down responses - Try switching to a faster model or provider #### Inaccurate Responses - AI models can sometimes provide incorrect information - Verify critical code before implementing - Try rephrasing your query for better results #### Formatting Issues - Some complex markdown may not render perfectly - Code blocks should always display correctly - Report rendering issues on GitHub ### Chat Verification To verify chat functionality: 1. Open the AI assistant 2. Send a simple test query 3. Wait for response 4. Check that formatting and code blocks display correctly ## 📞 Getting Help If you encounter issues with chat operations: 1. Check the [Common Issues](Common-Issues.md) documentation 2. Visit our [GitHub Issues](https://github.com/RenzMc/Acode-Plugin-AI-cli/issues) page 3. Join our [Discussions](https://github.com/RenzMc/Acode-Plugin-AI-cli/discussions) community for support ---