# Best Practices Source: https://alexcodes.app/docs/chat/best-practices Guidelines for effective code assistance and documentation usage in Alex Sidebar ## Writing Effective Prompts * Be specific about your goals * State what you want to achieve * Provide clear success criteria * Share relevant code snippets * Include error messages * Mention project requirements ## Using Think First Mode * Complex architectural decisions * Bug investigation * Performance optimization * Security considerations * Quick syntax questions * Simple code completions * Documentation lookups * Basic refactoring ### Tips for Think First Mode * Allow extra time for the dual-model processing * Provide detailed context for better analysis * Use it for mission-critical code changes * Consider disabling for rapid prototyping phases ### Examples ❌ **Ineffective**: `My code isn't working. Can you help?` ✅ **Effective**: `I'm getting a 'Thread 1: Fatal error: Unexpectedly found nil' when trying to unwrap an optional UIImage in my custom UICollectionViewCell. Here's my cellForItemAt implementation...` ✅ **Feature Request**: `I need to implement a custom tab bar in SwiftUI that shows a circular progress indicator around the selected tab icon. The progress should be animated. Here's my current TabView implementation...` ## Managing Context * Use @ Files to add specific files * Include related dependencies * Share configuration files * Use @ Codebase for framework-level questions * Reference specific components * Share relevant modules ### Examples ❌ **Limited**: `How do I update this delegate method?` ✅ **Complete**: `I need to update this UITableViewDelegate method to handle custom swipe actions. Here's my current implementation (@Files TableViewController.swift) and the custom SwipeActionView (@Files Views/SwipeActionView.swift) I want to integrate.` ✅ **Framework**: `I'm building a custom networking layer (@Codebase Networking/*). Can you help me implement proper retry logic with exponential backoff?` ## Using Documentation * Use @ Apple Docs for framework reference * Reference specific APIs * Include version information * Use @ Apple Docs (Individual) for specific methods * Reference specific classes * Include parameter details ### Examples ❌ **Vague**: `How do I use Core Data?` ✅ **Specific**: `I need help implementing NSFetchedResultsController (@Apple Docs NSFetchedResultsController) with multiple sections based on dates. Here's my current Core Data model (@Files Model.xcdatamodeld)...` ✅ **API Reference**: `Can you explain how to use URLSession's (@Apple Docs URLSession) background download tasks with proper delegate handling (@Apple Docs URLSessionDownloadDelegate)?` ## Platform-Specific Best Practices * Use Swift-specific terminology * Reference Swift documentation * Include Swift version * Reference UI frameworks * Include view hierarchy * Share layout constraints ### Examples ❌ **Ambiguous**: `How do I create a button?` ✅ **SwiftUI**: `I'm using SwiftUI (iOS 16+) and need to create a custom button with a gradient background, dynamic shadow, and haptic feedback. Here's my current Button implementation...` ✅ **UIKit Integration**: `I need to embed this SwiftUI view (@Files CustomView.swift) into my existing UIKit navigation stack. Here's my current UIHostingController setup...` ## Common Scenarios * Share error messages * Include stack traces * Reference relevant code * Explain current structure * Describe desired outcome * Share relevant files ### Examples ❌ **Unclear**: `The app crashes sometimes.` ✅ **Detailed**: `The app crashes when switching between tabs while a network request is in progress. Here's the crash log and relevant networking code (@Files NetworkManager.swift). The issue started after implementing async/await...` ✅ **Refactoring**: `I want to refactor this massive view controller (@Files ProfileViewController.swift) into smaller components using MVVM. Here's my planned architecture diagram...` ### Examples ❌ **Too Much**: `Sharing entire project files for a simple UI fix` ✅ **Just Right**: `Continuing from our previous chat about the networking layer (see chat history), I need to add request caching. Here's the specific RequestCaching protocol I want to implement...` ✅ **Breaking Down**: \`I need to migrate this UIKit project to SwiftUI. Let's break it down: 1. First, let's handle the navigation structure 2. Then, convert each view controller individually 3. Finally, implement the data flow with @StateObject and ObservableObject\` ## Community Resources Need more help? Join the [Discord community](https://discord.gg/T5zxfReEnd) for support and tips from other developers. # Agents Source: https://alexcodes.app/docs/chat/context/agents AI agents specialized for development tasks Alex Sidebar's agents are specialized AI assistants, each trained for specific development tasks. Alex automatically selects the right agent for your workflow for autonomously handling your development tasks! Agent mode is now always on! Claude 3.5 Sonnet remains the default model for its superior code generation capabilities, but you can now use other supported models including: * DeepSeek R1 * DeepSeek V3 * Claude 3.7 Sonnet * o3-mini * GPT-4o * o1 * Gemini 2.0 Flash Choose your preferred model from the model selector while maintaining all agent capabilities. ## Quick Actions Let agents handle repetitive tasks while you focus on core development work. Switch between different AI models while maintaining agent capabilities and context. ## Understanding Agents Agents work best by: * Learning your project structure and patterns * Maintaining contextual understanding across sessions * Automating common development tasks * Suggesting improvements based on best practices * Using regex code search for precise file analysis You can make agents more effective over time by providing more notes about your project and coding preferences. Learn more about project notes [here](/chat/context/memory). ## Getting Started Press **Command + Shift + A** or use the **Agent Settings** dropdown to toggle **Use agent** for your project. Use voice or text to describe your project: ```swift "This is an iOS app using SwiftUI and MVVM architecture. The main features include user authentication and data persistence." ``` The agent will: * Analyze project structure * Study coding patterns * Build contextual understanding * Use regex search to find relevant code patterns ## Best Practices Provide specific requirements and context for best results Break complex tasks into smaller, manageable steps Always review and test agent-suggested modifications Keep project notes updated for better agent performance # Commands Source: https://alexcodes.app/docs/chat/context/commands Available commands and shortcuts in Alex Sidebar's chat interface ## Available Commands Available commands and shortcuts in the chat interface showing @ commands menu Access and reference files in your project directly from the chat interface. Search and reference your entire codebase context during chat conversations. Search and reference official Apple documentation without leaving the chat. Access specific Apple documentation entries for targeted reference. ## Using Commands Type `@` or click the + button in the chat interface to see available commands. Use the search bar at the top to filter available commands and find what you need quickly. Commands help you efficiently access resources and context without leaving your chat workflow. ## Files Command Access your project files directly within the chat interface. Browse, search, and reference specific files during your conversations. Files command interface showing file browser and search functionality ## Codebase Command Search through your entire codebase context, find specific implementations, and reference code snippets in your discussions. Codebase command interface showing code search and reference features ## Apple Documentation Command Search and browse through the complete Apple documentation library without switching contexts or leaving your chat. Apple Documentation command interface showing documentation search and browsing ## Individual Apple Documentation Command Access and reference specific documentation entries, methods, or APIs for technical discussions. Individual Apple Documentation command interface showing specific documentation reference # Memory Source: https://alexcodes.app/docs/chat/context/memory Learn how to provide Alex notes for better context of your project Memory or project notes enables Alex to maintain context across conversations for better and more contextually relevant interactions. This documentation explains how memory works and how to manage it well. ## Understanding Memory ### Purpose Memory allows Alex to: * Maintain context from previous conversations * Provide more relevant and personalized responses * Learn from your coding patterns and preferences * Improve response accuracy over time ### How It Works The memory system: * Stores key information from your conversations * Analyzes patterns in your coding style * References past solutions when relevant * Adapts responses based on historical context ## Managing Memory ### Enabling and Disabling You can control memory settings through the Settings panel: 1. Open the Settings panel 2. Navigate to Memory preferences 3. Toggle the memory switch on/off ### Memory Search Access previous conversations using the **Memory Settings** panel. ### Memory Cleanup Keep your memory system optimized by: * Removing individual conversation records * Clearing topic-specific memories ## Privacy and Security ### Data Storage All memory data is: * Stored locally on your device * Never shared with external services ## Best Practices For best results, enable memory for: * Long-term projects * Complex coding tasks * Learning sessions ### Memory Management Regular maintenance helps optimize performance: 1. Review memories periodically 2. Remove outdated information 3. Keep relevant context # Image to Code Source: https://alexcodes.app/docs/chat/input-modes/image-to-code Transform designs into code by dragging images into Alex Sidebar The Image-to-Code feature allows you to quickly convert design mockups, screenshots, or UI elements into code. You can input images through multiple methods: ## Input Methods Use **Command + Shift + 6** to: * Take window screenshots * Capture specific UI selections * Perfect for quick UI component captures Drag images directly into the chat interface from: * Finder * Browser * Design tools ## Screenshot Tool (⌘ + ⇧ + 6) The built-in screenshot tool provides a quick way to capture UI elements and convert them to code. You can customize its behavior in the settings to match your workflow. ### Capture Options Capture entire windows with a single click. Perfect for: * Full screen interfaces * Complete view hierarchies * Dialog boxes and alerts Select specific areas to capture. Ideal for: * Individual UI components * Specific sections of an interface * Custom-sized regions ### Settings Customization ![Screenshot settings showing capture options](https://mintlify.s3.us-west-1.amazonaws.com/alex/chat/images/screenshot-settings.png) You can customize the screenshot tool in three ways: #### 1. Quick Access Menu When you click the screenshot button or use ⌘ + ⇧ + 6, a dropdown menu appears with three options: * **Capture window**: Take a screenshot of the entire window * **Capture selection**: Draw a selection box around the desired area * **Attach file**: Choose a file from your system instead #### 2. Default Behavior Settings You can set your preferred default screenshot behavior in Settings: 1. Open Settings 2. Navigate to "Chat Settings" 3. Look for "Default Screenshot Behavior" under the chat options 4. Choose between: * Capture window (automatically capture the entire window) * Capture selection (start with selection tool) * Show options (always show the dropdown menu) #### 3. Customize Keyboard Shortcut You can change the default ⌘ + ⇧ + 6 shortcut: 1. Open Settings 2. Go to "Chat Settings" 3. Find "Take Screenshot" in the list 4. Click on the current shortcut (⌘ + ⇧ + 6) to change it 5. Press your desired key combination Even with a default behavior set, you can always access other capture modes through the dropdown menu or by using your configured keyboard shortcut. ### Best Practices for Screenshots 1. **Clean Captures** * Close unnecessary windows or tabs * Hide sensitive information * Ensure the UI is in its final state 2. **Component Focus** * Zoom in for small components * Include padding for context * Capture in the correct state (hover, active, etc.) ## Getting Started Supported formats: * PNG * JPEG * Screenshots directly from Xcode/Figma For best results, ensure your images clearly show the UI elements you want to convert. Choose your preferred method: 1. Use **Command + Shift + 6** to take a screenshot 2. Drag and drop images into the chat 3. Copy-paste images directly The eligible model will analyze the images and generate corresponding code. You can: * Copy the code directly * Request modifications * Ask for explanations of specific parts ## Best Practices ### Image Preparation * Use high-resolution images for better accuracy * Crop to include only relevant UI elements * Ensure good contrast between elements * Include any specific styling details as prompt you want to capture ### Code Generation * Start with simple components before complex layouts * Review generated code for customization needs * Use follow-up questions to refine the output * Consider breaking complex UIs into smaller pieces For complex designs, try generating code for individual components first, then combine them into the final layout. ## Example Workflows ### Basic UI Component Take a screenshot of a button or card design Drag the image into Alex Sidebar ```swift // Generated code example struct CustomButton: View { var body: some View { Button(action: {}) { Text("Get Started") .font(.headline) .foregroundColor(.white) .padding(.horizontal, 24) .padding(.vertical, 12) .background(Color.blue) .cornerRadius(8) } } } ``` ### Complex Layout Identify main components in your layout. You can: * Split your design into logical sections * Take screenshots of individual components * Prepare multiple images for different parts You have two options: * Drag multiple component images at once to generate all parts simultaneously * Generate code for each major section individually Ask Alex to help combine components into a cohesive layout. You can: * Request adjustments to match the overall design * Fine-tune spacing and alignment * Add container views and navigation elements ## Troubleshooting ### Common Issues * Ensure image quality is high * Try cropping closer to the component * Use screenshots rather than photos * Provide additional context in your prompt * Specify exact colors if known * Include style guide references * Ask for specific modifications * Use follow-up questions for refinement * Break complex layouts into sections * Specify constraints explicitly * Ask for alternative layout approaches * Provide reference screenshots ## Tips for Better Results 1. **Start Simple**: Begin with basic components before attempting complex layouts 2. **Iterate**: Use follow-up questions to refine the generated code 3. **Combine Methods**: Use both image and text descriptions for better results 4. **Review Output**: Always review and test generated code in your project Remember that Image-to-Code is a starting point. You can always ask Alex to modify the generated code to better match your needs. # Voice Mode Source: https://alexcodes.app/docs/chat/input-modes/voice-mode Use voice commands to interact with Alex Sidebar more naturally ## Overview Voice Mode allows you to interact with Alex Sidebar using speech instead of typing, making code discussions more natural and efficient. This feature is particularly useful when you need to explain complex problems or want to reduce typing fatigue. Voice mode interface showing microphone button and transcription ## Quick Actions Toggle voice recording on/off. Use this shortcut to quickly start or stop voice input without clicking. Click the microphone icon in the chat input area to start/stop recording. ## Using Voice Mode 1. Open Settings (gear icon) 2. Navigate to Chat Settings 3. Enable Voice Mode Voice mode interface showing microphone button and transcription Voice Mode requires microphone permissions. You will be prompted to grant access when first enabling this feature. Two ways to start: * Press **Command + Shift + V** * Click the microphone icon Voice recording button in chat interface Speak clearly into your microphone. Use any of these methods to stop: * Press **Command + Shift + V** again * Click the microphone icon * Press **Return/Enter** key * Press **Escape** key to cancel recording Your speech will be automatically transcribed and inserted into the chat input box. Voice transcribing indicator showing speech-to-text conversion in progress Use the Escape key if you want to cancel the recording without transcribing the audio. ## Auto Mode Voice mode interface showing microphone button and transcription Enable "Auto Mode" in settings to automatically send transcribed messages: * Finish speaking and stop recording * Press Return/Enter * Message sends automatically and starts AI inference Voice auto mode interface showing automatic message sending after transcription ## Best Practices * Speak at a natural pace * Enunciate clearly * Avoid background noise * Use technical terms carefully * Use voice for longer explanations * Review transcription before sending * Combine with code selection ## Accessibility Benefits Voice Mode makes Alex more accessible and easier to use for everyone. * When you are coding for long periods, **Voice Mode** lets you take breaks from typing while staying productive. * For developers with mobility challenges or strain injuries, voice input provides a comfortable way to interact with Alex. You can dictate code explanations and questions instead. * Having voice as an additional input option means you can choose what works best for you in different situations. Sometimes speaking is just more convenient than typing. And when you need to explain complex concepts or walk through detailed logic, speaking it out loud often feels more natural and fluid than typing it all out. # Overview Source: https://alexcodes.app/docs/chat/overview Learn how to use Alex Sidebar's chat for code assistance Alex Sidebar's chat feature enables code discussions and improvements in Xcode running on the side. By prompting your queries, you can assist your coding process and resolve issues more quickly. ## Quick Actions Select code in Xcode or text in supported browsers (Chrome, Firefox, Arc, Safari) to start a **new chat**. The selected content will automatically be added as a reference. When used in browsers, it automatically adds the webpage URL to context and includes any selected text (supported in Chrome and Arc browsers). Add selected code to your existing chat without opening a new window. Perfect for building context incrementally. Start a chat with entire codebase as context. Useful for high-level questions about your project. Access documentation, add more files and more using the @ menu in your chat. Copy-paste or drag images directly into chat for design analysis and code generation. Perfect for UI discussions and visual debugging. ## Getting Started In Xcode's editor window, highlight the code you want to discuss or improve. Providing relevant code context helps the AI better understand your question and provide more accurate responses. Select code and press **Command + L** to start a chat. The more relevant context you provide, the more accurate and helpful the responses will be. ## Context Management * Chats are automatically saved * Access previous chats from history * Clear individual history * Reference multiple files in one chat * Generate changes for multiple files ## Common Use Cases * Select complex functions or blocks * Press **Command + L** * Ask for step-by-step explanations * Get detailed breakdowns of code behavior * Highlight code that needs improvement * Start a chat with **Command + L** * Request refactoring suggestions * Apply changes directly from chat * Select problematic code sections * Include error messages if available * Ask for debugging assistance * Get targeted solutions and fixes ## Applying Changes * Smart and fast code diff * Handles both simple and complex changes * Chunks mode enabled by default for better handling * Quick Apply for instant changes without diff panel * Fast-forward button (⏩) for instant application * Perfect for all types of code modifications from quick fixes to refactoring ## Think First Mode Think First mode toggle in chat interface The "Think First" option combines DeepSeek R1's reasoning capabilities with Claude's responses for the best possible results. When enabled: 1. DeepSeek R1 first reasons about the problem using thinking tokens 2. This analysis is then used to guide Claude's response 3. Results in more thorough and accurate solutions Think First mode can be toggled for individual messages using the "Think first" option under each message input. ## Best Practices * Be specific about what you want * Provide necessary context * Use appropriate commands * Break complex questions into smaller parts * Keep context focused and relevant * Remove unnecessary files * Update context when switching tasks * Clear context for new topics Need more detailed guidance? Learn more about best practices in our [Best Practices guide](/best-practices). ## Web Search Integration Web search feature showing iOS-specific search results The **Web** button in chat provides access to curated iOS development resources. When enabled: * Automatically searches popular iOS development blogs * Finds relevant GitHub repositories and discussions * Retrieves up-to-date documentation and examples ### Using Web Search 1. Click the "Web" button in chat 2. Alex searches relevant iOS resources 3. Results are automatically added as context 4. Get responses based on the latest information The web search feature ensures you get the most current solutions and best practices from the iOS development community. # Chat Tabs Source: https://alexcodes.app/docs/chat/tabs Manage multiple concurrent chat sessions Chat Tabs enable parallel chat sessions, each maintaining independent context and history. This allows you to work on multiple tasks or components within your project. Chat Tabs interface showing multiple concurrent chat sessions ## Core Functionality Chat Tabs provide: * Isolated chat contexts per tab * Persistent session history * Independent memory and context management * Easycontext switching between tasks ## Keyboard Controls `CMD+T` Create new session `CMD+W` Terminate current session `Ctrl+Tab` Switch between sessions ## Best Practices 1. **Resource Management** * Close inactive sessions to optimize performance * Maintain focused contexts per tab * Limit concurrent sessions based on workflow needs 2. **Context Organization** * Dedicate tabs to specific components or features * Separate research and implementation sessions * Maintain distinct contexts for debugging and development 3. **Workflow Optimization** * Use tabs for parallel documentation reference * Separate long-running tasks from quick queries * Maintain dedicated tabs for recurring operations # UI Customization Source: https://alexcodes.app/docs/chat/ui/customization Customize Alex Sidebar chat interface to match your preferences ## Code Section Expansion Control how code sections are displayed in chat by default. This setting helps you manage the visibility of code blocks in your conversations. Code section expansion settings in Alex Sidebar Code sections now expand by default for immediate visibility of complete code blocks. Customize this behavior in Settings > Window Management to match your workflow preferences. ## Configure Code Expansion You can configure the code expansion behavior in Settings > Window Management. This setting allows you to control whether code blocks automatically expand or remain collapsed by default. Configure code expansion in Settings ## Pin Chat to Bottom Keep the chat input field fixed at the bottom of the window for easy access and improved usability. Pin chat to bottom settings in Alex Sidebar Keep the chat input field in view at all times for instant access. Access the chat feature directly without searching or scrolling. Interact with the chat interface for a natural conversation rhythm. Optimize the display of long chat histories while keeping the input accessible. Pin chat input view in Alex Sidebar ## Code Apply View Position The code apply view position feature lets you keep the code changes interface at the bottom of the window, allowing you to quickly apply changes without needing to scroll up through the code changes. Code apply view position settings in Alex Sidebar Keep the code apply interface fixed at the bottom for easy access to changes. Review and apply code changes without scrolling up through long conversations. # Error & Warning Resolution Source: https://alexcodes.app/docs/completions/error-fixes Learn how to use Alex Sidebar to quickly resolve Xcode errors and warnings ## Quick Fix Integration Alex Sidebar seamlessly integrates with Xcode's diagnostic system to help resolve errors and warnings efficiently. Click any error or warning indicator in Xcode's gutter to get instant AI-powered solutions. Automatic context gathering and error analysis for targeted fixes. ## Using Quick Fix Hover over the line containing the red (error) or yellow (warning) indicator in Xcode's, then click the indicator Xcode error indicator in the gutter that can be clicked to trigger quick fix Alex Sidebar starts a new chat with the warning and error message and code context. Alex Sidebar chat interface with warning context and suggestions Click "Apply" to implement the suggested changes. The smart apply button will handle both simple fixes like missing imports and complex changes that require accurate diffing. For faster application, use Quick Apply (⏩) to instantly apply changes without the diff panel. Alex Sidebar quick fix apply interface Always review the proposed changes before applying them to ensure they match your codebase requirements ## Common Fixes Handles common build-time issues: * Missing imports * Type mismatches * Protocol conformance * Initialization errors * Access control issues Addresses potential runtime problems: * Memory management * Thread safety * Deprecated API usage * Performance optimizations * Best practice violations Resolves preview-specific issues: * Missing preview providers * Environment requirements * Device configuration * Preview context setup ## Advanced Usage For specialized error cases: * Select the problematic code * Use Command + L to start a chat * Provide additional context * Get customized solutions When dealing with multiple related issues: * Group similar errors using Command + Shift + L to add the context in the existing chat * Apply fixes systematically * Validate changes incrementally Pro Tip: Use the chat interface for more complex error scenarios that might require additional context or explanation. # Inline Code Suggestions Source: https://alexcodes.app/docs/completions/inline-suggestions Learn how to use Alex Sidebar's code completion features ## Quick Code Generation Alex Sidebar provides inline code suggestions and completions **directly in Xcode** to help you write code faster. Trigger in-file suggestions to get AI-powered completions based on your current code context. Get real-time suggestions as you type. Press Tab to accept the highlighted suggestion. ## Using Inline Completions Example showing inline code completion with ghost text suggestions appearing as you type Position your cursor where you want to generate code (or select existing code) in **Xcode** and press **Command + K** K\*\* The AI analyzes your current file context to provide relevant suggestions Choose from available AI models for completion: * Claude 3.5 Sonnet: Advanced model for complex completions * GPT-4: Balanced performance and accuracy * Gemini Flash 2.0: Fast, lightweight completions You can add additional models through the Model Settings, including: * Local models via Ollama integration * Custom API-compatible models * Other OpenAI-compatible endpoints See the [Model Configuration](/configuration/model-configuration) section for detailed setup instructions. Example showing inline code completion with ghost text suggestions appearing as you type * Press Enter to accept the current suggestion * Press Esc to dismiss suggestions * Click retry button to generate new suggestions Inline code completion in action ## Tab Completion Real-time code completion in action showing suggestions as you type Alex Sidebar provides high-performance autocomplete suggestions with just 300-350ms latency - faster than GitHub Copilot and Xcode's built-in completions. * Press Tab to accept suggestion * Suggestions appear mid-sentence as you type * Context-aware code suggestions * Variable and method completions ### Enabling Autocomplete Autocomplete settings showing enable toggle and fast mode option To configure autocomplete: 1. Open Settings 2. Go to Features & Keybindings 3. Find "Autocomplete Settings" 4. Configure the available options: * **Enable Autocomplete**: Turn the feature on/off * **Use Fast Autocomplete**: Switch to an optimized model that provides \~50% faster completions, ideal for rapid development * **Inline completion**: Configure the ⌘ + K shortcut The base autocomplete model has been optimized for better performance with large files (>600 lines). ## Best Practices * Use Claude 3.5 Sonnet for complex logic * Choose GPT-4 for balanced performance * Select Gemini Flash 2.0 for quick completions * Use Command + K for larger completions * Try different models if results aren't ideal * Use retry option for alternative suggestions * Tab complete for quick suggestions ## SwiftUI Code Examples Here are some practical examples of how Alex Sidebar's inline suggestions work with SwiftUI code: Start typing a basic SwiftUI view and let inline suggestions help: ```swift struct ContentView: View { var body: some View { // Type "VStack", wait for a bit and then press TAB VStack(spacing: 16) { Text("Hello, World!") .font(.title) .foregroundColor(.blue) Button("Tap me") { // Suggestions will offer action implementations } } } } ``` Get intelligent suggestions for SwiftUI property wrappers: ```swift struct TodoView: View { // Type "@St" and use Tab completion @State private var taskTitle = "" // Type "@Ob" for Observable properties @ObservedObject var viewModel: TodoViewModel var body: some View { Form { TextField("Task Title", text: $taskTitle) // Suggestions will offer common modifiers } } } ``` Get suggestions for custom view modifiers: ```swift struct CardModifier: ViewModifier { // Type "func" and let suggestions complete the method func body(content: Content) -> some View { content .padding() .background(Color.white) .cornerRadius(10) .shadow(radius: 5) } } // Usage example with inline suggestions Text("Card Content") .modifier(CardModifier()) ``` The examples above demonstrate common SwiftUI patterns where inline suggestions are particularly helpful. As you type these patterns, Alex Sidebar will suggest: - Property wrapper completions - View modifier chains - Common SwiftUI view structures - Closure completions While AI suggestions are powerful, always review generated code to ensure it meets your requirements and follows your project's conventions. # Code & Context Shortcuts Source: https://alexcodes.app/docs/configuration/code-context-shortcuts Keyboard shortcuts for managing code interactions and chat context ![Essential shortcuts demo](https://mintlify.s3.us-west-1.amazonaws.com/alex/images/shortcuts-settings.png) These shortcuts can be customized by clicking on any default shortcut in the Settings panel. * **Command + L**: Start a new chat with your selected code * **Command + Shift + L**: Add selected code to your current chat * **Command + N**: Create a fresh chat (without code) * **Command + Delete**: Stop the current generation Just getting started? The **Command + L** shortcut is essential for starting AI chats about your code directly from Xcode. # Codebase Indexing Source: https://alexcodes.app/docs/configuration/codebase-indexing Learn how to manage and optimize codebase indexing for better AI assistance When you open a project in Alex Sidebar, it automatically analyzes and indexes your code files to better understand your codebase. Think of this like creating a smart map of your code - Alex reads through each file and then can utilize this information to provide more accurate and relevant suggestions when going through your queries. Codebase indexing interface showing indexed files and management options ### What is Indexing? Indexing is the process where Alex: * Scans through all your code files * Creates special embeddings for each file * Stores these embeddings to quickly reference later ### Why is it Important? This indexing helps Alex: * Give you more accurate code suggestions * Better understand the context when you ask questions * Find relevant code examples from your own project * Make smarter recommendations based on your actual codebase ## Code Maps Building on top of basic indexing, Alex now automatically parses your Swift project and constructs a "Code Map" for the files you are chatting about. This means Alex has an understanding of how files interact with each other, resulting in better code generation. When you start a chat, Alex: * Analyzes file dependencies and imports * Maps class and type relationships * Understands protocol conformances * Tracks function calls between files This deeper understanding helps Alex: * Generate more accurate code suggestions * Provide better refactoring recommendations * Maintain consistency across related files * Respect your project's architecture Code Maps are enabled by default for all chats, so you don't need to do anything extra to get these benefits! ## Managing Indexes Open the "Indexed Files" section in Settings to access the indexing UI. Here you can: * View all indexed files * Check indexing status * Manage existing indexes * Set custom override paths The following operations are available: * **Reload Index**: Initialize or refresh indexing for files * **Delete Index**: Remove existing index data * **Set override path**: Manually specify a folder path to index ## Automatic Synchronization Your codebase index automatically updates when: * Files are modified * New files are added * Files are deleted * Git branches are switched This ensures Alex Sidebar always has the most up-to-date information about your codebase! # Custom Prompts Source: https://alexcodes.app/docs/configuration/custom-prompts Make Alex work better for you with custom prompts Use the two different kinds of prompts that work together to help you code: Global prompts that apply across all projects. These define your general preferences and requirements. Specific prompts that apply only to the current project, working in combination with system prompts. ## Prompt Configuration Interface Prompt configuration interface showing system and project prompts ### Key Components 1. **System Prompt Section** * Text area for global prompt configuration * Dropdown menu to select active prompt * "Add New Prompt +" button for creating additional prompts Adding a new custom prompt 2. **Project-Specific Section** * Dedicated prompt area for current project * Project identifier display * Automatic combination with system prompt Changes to prompts take effect immediately and persist across sessions. ## SwiftUI Project Example Here are some examples of how to configure prompts for a SwiftUI project to take inspiration from. ### System Prompt: SwiftUI Expert ```swift You are a SwiftUI and iOS development expert. For all interactions: **ARCHITECTURE:** - Recommend MVVM pattern implementation - Ensure proper view composition - Follow SwiftUI best practices - Consider performance implications **CODE STYLE:** - Use modern Swift syntax - Implement proper property wrappers - Follow Swift naming conventions - Write clear documentation comments **REQUIREMENTS:** - Consider accessibility - Follow Apple HIG - Include SwiftUI previews - Handle error cases ``` ### Project Prompt: Custom App ```swift Project: MLXFasting (Intermittent Fasting App) **ARCHITECTURE:** - Uses MVVM + Coordinator pattern - CoreData for persistence - Combine for data flow - HealthKit integration **CUSTOM COMPONENTS:** - TimerView: Custom circular progress - FastingCell: Reusable fasting period cell - StatsView: Charts and statistics display **DESIGN SYSTEM:** - Colors defined in Theme.swift - Typography in Typography.swift - Custom modifiers in ViewModifiers.swift **CODING GUIDELINES:** - Use existing design system components - Follow established patterns - Consider offline-first approach - Include HealthKit permissions ``` ### API Integration ```swift API Guidelines: - Use URLSession with async/await - Implement proper error handling - Cache responses when appropriate - Follow RESTful conventions - Include request timeout handling ``` ### Performance Focus ```swift Performance Requirements: - Implement lazy loading for lists - Use proper image caching - Optimize CoreData queries - Profile memory usage - Consider background task handling ``` ## Best Practices * One primary goal per prompt * Clear, specific instructions * Avoid redundant information * Reference existing patterns * Include architecture details * Specify dependencies * Update as project evolves * Reflect new requirements * Remove obsolete patterns * Share effective prompts * Standardize across team * Document prompt purposes Avoid including sensitive information like API keys, credentials, or internal business logic in your prompts. # Git Integration Source: https://alexcodes.app/docs/configuration/git-integration Using AI-powered Git features in Alex Sidebar Alex Sidebar provides Git integration to quickly manage your version control workflow with AI-powered commit message suggestions. ## AI-Powered Commit Messages * Automatically generates contextual commit message suggestions * Preview generated messages before committing * One-click commit with suggested messages ## Quick Access * Use **CMD+Shift+G** shortcut to open the Git status panel * Select and manage multiple files at once * View both staged and unstaged changes Git panel showing staged changes and modified files The Git panel shows all your staged and unstaged changes, making it easy to review before committing. ## Using Git Integration Press **CMD+Shift+G** to open the Git status panel. * Use the checkboxes to select individual files * Click "Select All" to include all changed files * Click "Generate Commit Message" to get AI suggestions * Review the preview of the suggested message * Use "Copy Message" to copy to clipboard if needed AI-generated commit message suggestions interface showing multiple message options Click "Accept and Commit" to commit your changes with the selected message. ## Configuration The Git integration works out of the box with your existing Git configuration. No additional setup is required. Make sure your repository is properly initialized with Git before using these features. # Model Configuration Source: https://alexcodes.app/docs/configuration/model-configuration Configure and customize AI models in Alex Sidebar Alex Sidebar supports multiple AI models to suit different development needs and preferences. This guide explains the available models and how to configure them. ## Available Models Available AI models configuration in Alex Sidebar Anthropic's model with a 200,000-token context window, offering exceptional code understanding and generation. Best for handling large codebases, complex tasks, and detailed explanations. A powerful reasoning model optimized for code generation and analysis. Available with unlimited messages. Particularly effective for iOS/Swift code generation, complex refactoring tasks, and architecture suggestions. The latest update to DeepSeek's V3 model is optimized for speed and efficiency. Perfect for rapid development in large files. A streamlined version of Claude optimized for fast response times and efficient code completions. Ideal for real-time coding assistance and quick iterative development. Google's latest optimized model designed for speed and efficiency. Available in both chat and Cmd+K interfaces, perfect for quick code completions and rapid prototyping. Grok Beta is a frontier language model with state-of-the-art reasoning capabilities. It is suitable for chat, coding, and reasoning tasks. A conversational search engine providing real-time, sourced answers. While not tailored for coding, it's great for accessing coding documentation, examples, and swift explanations. OpenAI's model known for versatile code generation and reliable outputs. Excellent for general coding tasks, debugging, and refactoring. A compact version of GPT-4, optimized for speed while retaining the core capabilities of the main model. Perfect for faster responses in routine coding tasks. Designed for advanced reasoning in coding, math, and science. With a 128,000-token context window, it excels in maintaining extensive context and solving intricate problems. A lightweight version of O1, optimized for speed and cost-\`effectiveness. Ideal for quick code completions and everyday coding tasks with fast responses. ## Model Selection You can switch between models in two ways: ### Model Selector Menu 1. Click on the default model on the bottom left corner of the chat input view 2. Select the model you want to use from the dropdown menu ### Keyboard Shortcut Press `Command` + `/` to quickly cycle through your enabled models during a chat session. Note that o1 model is limited to 50 credits - to purchase additional credits, join our Discord community and message @DanielEdrisian on our [Discord server](https://discord.gg/T5zxfReEnd). ## API Key Configuration You can add your API keys directly in the Model Settings screen. Simply click the settings icon on the top right corner of the sidebar and look for the API key input fields for each provider under the section "Model Settings". API configured models settings in Alex Sidebar To use GPT-4 or OpenAI models: 1. Get an API key from [OpenAI's platform](https://platform.openai.com) 2. Find the "OpenAI Key" field 3. Enter your API key in the input box To use Claude models: 1. Obtain an API key from [Anthropic's console](https://console.anthropic.com) 3. Find the "Anthropic Key" field 4. Enter your API key in the input box Additional model providers like Perplexity and VoyageAI can also be configured: 1. Obtain the appropriate API key from the provider's website 2. Find the corresponding key field in settings 3. Enter your API key Your API keys are stored securely and only used to authenticate with the respective AI providers. You can update or remove them at any time from the settings screen. ## Custom Model Setup Custom models settings configuration in Alex Sidebar You can add custom models that comply with the OpenAI API scheme. Follow these steps to configure a custom model: 1. Navigate to "Settings" by selecting the gear icon on the top right corner of the sidebar 2. Select "Models" and you will find the section on "Custom Models" section 3. Click the "Add New Model" button to create a new custom model configuration 1. Enter the Model ID (e.g., `qwen2.5-coder-32b-instruct`, `deepseek-chat`) 2. Provide the Base URL for your model's API endpoint 3. Add your API Key for authentication 4. (Optional) Specify if the model supports image inputs To run the DeepSeek V3 model: * Model ID: `deepseek-chat` * Base URL: `https://api.deepseek.com/v1` * Enter your DeepSeek API Key in the provided field Go back to the chat screen by clicking on the close icon on the top right corner of the sidebar and you will see the custom model in the model selection options. Custom model selection is currently only available in normal chat mode, not in agent mode. You can toggle between modes using Command + Shift + A. ## Running Local Models Alex Sidebar supports running local AI models through Ollama, providing a free and privacy-focused alternative to cloud-based models. Here is an example of how to set up a local powerful model like Qwen2.5-Coder: 1. Install Ollama to manage and serve the local model 2. Install ngrok for creating a secure tunnel (temporary requirement until direct localhost support) 3. Create a free ngrok account at [ngrok.com](https://ngrok.com) to get an authentication token ```bash # Pull the Qwen2.5-Coder model ollama pull qwen2.5-coder:32b # Start the Ollama server ollama serve ``` ```bash # Install ngrok brew install ngrok # Authenticate with your token ngrok config add-authtoken YOUR_AUTH_TOKEN # Create tunnel to Ollama server ngrok http 11434 --host-header="localhost:11434" ``` Add a custom model with these settings: * Model ID: `qwen2.5-coder:32b` * Base URL: Your ngrok URL + `/v1` (e.g., `https://your-subdomain.ngrok-free.app/v1`) * API Key: Your ngrok authentication token Direct localhost support is coming soon to Alex Sidebar, which will eliminate the need for ngrok tunneling. Local models may run slower than cloud-based alternatives, especially on less powerful hardware. Consider your performance requirements when choosing between local and cloud models. Credit: This setup process was documented by [Daniel Raffel](https://danielraffel.me/til/2024/11/13/how-to-set-up-a-local-ai-model-with-xcode-ollama-qwen2-5-coder-alex-sidebar/) who tested and validated the local model configuration with Alex Sidebar. ## Best Practices • Use Claude 3.5 Sonnet or GPT-4 for complex architectural decisions\ • Claude 3.5 Haiku or GPT-4 Mini for quick code completions • Start new chats for long conversations to maintain accuracy\ • Match model capabilities to task complexity ## Troubleshooting If you encounter issues with model responses: 1. Check your API key configuration 2. Verify your internet connection 3. Ensure you're within the model's context limit 4. Try switching to a different model 5. Restart Alex Sidebar if issues persist Need help? Join our [Discord community](https://discord.gg/T5zxfReEnd) for support and tips from other developers. ## Code Apply View Position Code apply view position settings in Alex Sidebar Keep the code apply interface fixed at the bottom for easy access to changes. Review and apply code changes without scrolling through long conversations. # Navigation & Search Shortcuts Source: https://alexcodes.app/docs/configuration/navigation-shortcuts Keyboard shortcuts for navigating and searching within Alex * **Command + K**: Get inline completions * **Command + P**: Open advanced search * **Command + /**: Switch between AI models * **Escape**: Close any open panel Pro tip: The **Escape** key is your universal "close" button - it will close any open panel, whether it is a suggestion, search, or completion window. # Cheatsheet Source: https://alexcodes.app/docs/get-started/cheatsheet A guide to Alex Sidebar's features, shortcuts, and best practices ## Essential Keyboard Shortcuts | Shortcut | Action | Description | | ---------- | ------------------- | ------------------------------------------- | | ⌘ + L | New Chat with code | Start a new AI chat with your selected code | | ⌘ + N | New empty chat | Create a fresh chat without code context | | ⌘ + ⇧ + L | Add to current chat | Append selected code to current chat | | ⌘ + K | Inline completions | Get quick inline code suggestions | | ⌘ + P | Advanced search | Open the advanced search panel | | ⌘ + / | Switch AI models | Toggle between different AI models | | ⌘ + ⌫ | Stop generation | Immediately stop the current AI response | | ⌘ + T | New tab | Create a new chat tab | | ⌘ + W | Close tab | Close the current chat tab | | Ctrl + Tab | Switch tabs | Navigate between chat tabs | | ⌘ + ⇧ + G | Git panel | Open the Git status panel | | ⌘ + ⇧ + V | Voice mode | Toggle voice recording on/off | | esc | Close panel | Universal close button for any open panel | ## AI Models & Their Strengths | Model | Best For | | ----------------- | ----------------------------------------------- | | Claude Sonnet 3.5 | Large codebases and complex tasks | | Grok Beta | Chat and coding tasks | | Perplexity | Coding documentation and examples from internet | | GPT-4o | General coding and chat tasks | | o1 | Advanced reasoning in coding and mathematics | These model recommendations are opinionated and based on general use cases. You should experiment with different models to find which ones work best for your specific needs and coding style. Each developer may have different preferences based on their workflow and the types of problems they are solving. ## Search Features * **Advanced Search (⌘ + P)** * Search through codebase * Filter by file type * Jump to specific files ## Best Practices 1. **Code Context** * Select relevant code before starting chat * Include imports and related types * Provide clear and **specific** questions 2. **Model Selection** * Switch models if not getting desired results ## Common Use Cases & Workflows ### Code Review 1. Select code → ⌘ + L 2. Ask for review 3. Add context with ⌘ + ⇧ + L if needed 4. Use ▶️ to apply suggestions ### Quick Fixes 1. Place cursor where you want to fix 2. ⌘ + K for suggestions 3. Use **esc** to dismiss if needed ### Warnings and Errors 1. Click error/warning indicator in Xcode's editor near line number 2. Review AI-suggested fixes 3. Click ▶️ to implement changes, or use Quick Apply (⏩) for instant application 4. For complex cases: * Select problematic code and copy error/warning * Use ⌘ + L for detailed help * Add context as needed Common fixes include: * Build errors (imports, types) * Deprecated API usage ## Configuration Tips * Customize shortcuts in Settings * Set up system and custom prompts for repeated tasks ## Common Pitfalls to Avoid * Do not provide too little context * Do not stick with one model if struggling # Data Usage Source: https://alexcodes.app/docs/get-started/data-usage Understanding how Alex Sidebar handles and protects your data Alex Sidebar is designed with privacy and security in mind. We maintain strict data handling practices to protect your code and personal information. ## Core Principles * No code storage or collection * Opt-out of all third-party training data * Minimal analytics collection (feature usage and diagnostics only) * Local storage prioritization ## Infrastructure ### API Processing All LLM interactions are processed through our secure infrastructure: 1. API endpoint: [https://api.alexcodes.app](https://api.alexcodes.app) 2. Server location: United States (Render hosting) 3. Processing workflow: * Context collection from user selection * Prompt construction with provided context * Secure routing to model providers * Response delivery without data persistence ### Future Data Practices We maintain a strict opt-out-by-default policy for all users. Any future data collection initiatives will: * Require explicit user consent * Be clearly communicated * Include granular opt-in controls * Maintain existing user preferences ## Data Storage ### Code Embeddings Alex Sidebar implements local embedding storage for search functionality: 1. **Generation Process** * Automatic embedding of Xcode project code * Processing through VoyageAI's embedding service * Explicit opt-out from provider data collection 2. **Storage Location** * Local SQLite database * Path: Application Support/com.DanielEdrisian.AlexSideBar * No cloud storage or sync ### Chat History Chat data management follows local-first principles: * Storage in Application Support directory * No server-side persistence * User-controlled retention ## AI Provider Integration ### Chat Models Current providers: * OpenAI * Anthropic * Perplexity All integrations configured with: * Training data opt-out enabled * No persistent storage * Request-only data transmission ### Code Application Models Implementation providers: * Groq * Cerebras * Fireworks AI * Google (Gemini) Security measures: * Training opt-out enforced * Temporary request processing * No provider-side data retention ## Monitoring Systems ### Analytics Implementation Posthog integration limited to: * Feature activation events * Command usage frequency * No content or context collection * Anonymous usage patterns ### Error Tracking System Sentry implementation captures: * Application crash reports * Error stack traces * Performance metrics * Frame rate analysis * UI responsiveness * Basic system information * OS version * Device identifiers * IP addressing ## Authentication System Firebase implementation handles: * User authentication * O1-Preview credit management * Basic account state For comprehensive details on our data handling practices, refer to our official documentation: * [Terms of Service](https://alexcodes.app/terms) * [Privacy Policy](https://alexcodes.app/privacy) # Installation and Authentication Source: https://alexcodes.app/docs/get-started/getting-started Installation and configuration guide for Alex Sidebar Alex Sidebar extends Xcode with powerful AI capabilities. This guide covers installation and initial setup. ## Installation Download AlexSideBar.dmg from the [official releases page](https://github.com/DanielEdrisian/AlexSideBar-Public/releases/download/prod/AlexSideBar.dmg). Open the downloaded DMG file and drag Alex Sidebar to your Applications folder. Installation: Move to Applications Installation: Move to Applications Open Alex Sidebar from Applications. The Xcode integration will initialize automatically. You may see a popup indicating that "AlexSideBar" is an app downloaded from the Internet. It is safe to proceed. Click "Open" to continue. Security popup: Click Open Security popup: Click Open After launching, Alex Sidebar will request accessibility permissions. These permissions are required to: * Make changes to files * Handle Apple events * Integrate with Xcode effectively Click "Open System Settings" when prompted, then enable Alex Sidebar in the Accessibility permissions list. Accessibility permissions alert ## Folder Access Permissions When you first use Alex Sidebar, you will need to grant access to folders where your projects are stored. This permission helps to analyze your project files and provide relevant context to the AI assistant when working with code across different files and folders. When opening a project, Alex Sidebar will request permission to access the folder where your Xcode project/workspace is located. This typically includes: * Desktop * Downloads * Documents folders Click "Allow" when the system permission dialog appears to grant access. If you need to update permissions later: 1. Open System Settings 2. Navigate to Privacy & Security → Files and Folders 3. Find "Alex Sidebar" in the list 4. Enable access for required folders Folder permissions settings Folder permissions settings ## Sign Up & Authentication After launching Alex Sidebar, you'll be presented with sign up options: * Enter your email and password * Click "Sign Up", or * Use "Sign up with Google" for faster authentication Sign up page If you choose Google sign-in, you'll see a system prompt to authorize the connection: Google authentication prompt Google authentication prompt Click "Continue" to allow Alex Sidebar to authenticate with your Google account. # Introduction Source: https://alexcodes.app/docs/get-started/introduction AI Assisted Coding for Xcode Welcome to **Alex Sidebar**, your AI companion for Xcode development. This documentation will help you understand and make the most of Alex's features to assist your Apple Platform development workflow! ## Essentials Get up and running in under 2 minutes Create your account and get started ## Core Features Select any text in Xcode or supported browsers (Chrome, Arc) and instantly start a chat about it. Get immediate AI assistance for code understanding, web content analysis, and solutions. Transform designs into code. Simply drag any image into the sidebar and let Alex generate the corresponding code for you. Search your entire codebase semantically. Find exactly what you are looking for by describing it in natural language and hitting tab. Generate in-file suggestions instantly. Get smart code completions and improvements without breaking your flow. ## Advanced Features Apply suggested code changes with a single click. Use Quick Apply (⏩) for instant changes without diff panel. Fix compilation errors and warnings. Just click the button and let Alex handle the rest. ## Support and Community Multiple channels for assistance Solutions to common issues How to report bugs effectively Submit and track feature ideas # Adding your API Key for Claude (Anthropic) Source: https://alexcodes.app/docs/keys/adding-claude-anthropic-api-key Learn how to get your API Key To use Claude's models (such as Claude 3.5 Sonnet and Claude 3.7 Sonnet) in Xcode with Alex Sidebar without paying a subscription for Alex, you'll need an Anthropic API key. Here's how to get one: 1. Visit [Anthropic's Console](https://console.anthropic.com/) 2. Create an account or sign in if you already have one 3. Once logged in, navigate to the API Keys section in your account settings 4. Click "Create New API Key" 5. Give your key a name (e.g., "Alex Sidebar") and create it 6. Copy the API key - make sure to save it somewhere secure as you won't be able to see it again 7. In Alex Sidebar: * Open Settings (⚙️) * Select "Models" at the bottom of the page * Paste your Anthropic API key in the Anthropic text field Keep your API key secure and never share it publicly. If you suspect your key has been compromised, you should immediately rotate it in the Anthropic Console. ## Usage & Billing * Anthropic bills based on the number of tokens used * You can monitor your usage in the Anthropic Console * Set up billing alerts to avoid unexpected charges * New accounts typically come with some free credits to get started For more information about Claude's pricing and usage, visit [Anthropic's pricing page](https://www.anthropic.com/pricing). Enabling Anthropic does not give you access to all of Alex's features. To enable codebase indexing, follow the [VoyageAI API Key Instructions](/get-started/adding-voyage-ai-api-key), and to enable Thinking mode, follow the [FireworksAI API Key Instructions](/get-started/adding-fireworks-ai-api-key). For other models like GPT 4o and the o-series (o1, o3, o3-mini), follow the [OpenAI API Key Instructions](/get-started/adding-openai-ai-api-key). # Adding your API Key for Fireworks AI Source: https://alexcodes.app/docs/keys/adding-fireworks-ai-api-key Learn how to get your API Key To use Fireworks AI's models (Thinking mode, DeepSeek R1, and DeepSeek V3 New) in Xcode with Alex Sidebar without paying a subscription for Alex, you'll need a Fireworks AI API key. Here's how to get one: 1. Visit [Fireworks AI's Console](https://fireworks.ai) 2. Create an account or sign in if you already have one 3. Once logged in, navigate to the [API Keys page](https://fireworks.ai/account/api-keys) in your account settings 4. Click "Create API Key" 5. Give your key a name (e.g., "Alex Sidebar") and create it 6. Copy the API key - make sure to save it somewhere secure as you won't be able to see it again 7. In Alex Sidebar: * Open Settings (⚙️) * Select "Models" at the bottom of the page * Paste your Fireworks AI API key in the Fireworks AI text field Keep your API key secure and never share it publicly. If you suspect your key has been compromised, you should immediately rotate it in the Fireworks AI Console. ## Usage & Billing * Fireworks AI bills based on the number of tokens used * You can monitor your usage in the Fireworks AI Console * Set up billing alerts to avoid unexpected charges * New accounts typically come with some free credits to get started For more information about Fireworks AI's pricing and usage, visit [Fireworks AI's pricing page](https://fireworks.ai/pricing). Enabling Fireworks AI does not give you access to all of Alex's features. To enable codebase indexing, follow the [VoyageAI API Key Instructions](/get-started/adding-voyage-ai-api-key), and to enable Claude models, follow the [Anthropic API Key Instructions](/get-started/adding-claude-anthropic-ai-api-key). For other models like GPT 4o and the o-series (o1, o3, o3-mini), follow the [OpenAI API Key Instructions](/get-started/adding-openai-api-key). # Adding your API Key for Gemini (Google) Source: https://alexcodes.app/docs/keys/adding-gemini-api-key Learn how to get your API Key To use Gemini's models (Gemini 2.5 Pro, Gemini 2.0 Flash) in Xcode with Alex Sidebar without paying a subscription for Alex, you'll need a Google AI Studio API key. Here's how to get one: 1. Visit [Google Cloud Console](https://aistudio.google.com) 2. Create an account or sign in if you already have one 3. Go to the (API Keys page)([https://aistudio.google.com/apikey](https://aistudio.google.com/apikey)) 4. Click "Create API Key" and select a project to enable it for 5. Copy the API key - make sure to save it somewhere secure 6. In Alex Sidebar: * Open Settings (⚙️) * Select "Models" at the bottom of the page * Paste your AI Studio API key in the Gemini text field Keep your API key secure and never share it publicly. If you suspect your key has been compromised, you should immediately rotate it in the Google Cloud Console. ## Usage & Billing * Google Cloud bills based on the number of tokens used * You can monitor your usage in the Google Cloud Console * Set up billing alerts to avoid unexpected charges * New accounts typically come with some free credits to get started For more information about Gemini's pricing and usage, visit [Google Cloud's pricing page](https://cloud.google.com/vertex-ai/pricing#gemini). Enabling Gemini does not give you access to all of Alex's features. To enable codebase indexing, follow the [VoyageAI API Key Instructions](/get-started/adding-voyage-ai-api-key), and to enable Thinking mode, follow the [FireworksAI API Key Instructions](/get-started/adding-fireworks-ai-api-key). For other models like GPT 4o and the o-series (o1, o3, o3-mini), follow the [OpenAI API Key Instructions](/get-started/adding-openai-ai-api-key). For Anthropic's models (Claude 3.5 Sonnet, Claude 3.7 Sonnet) follow the [Anthropic API Key Instructions](/get-started/adding-claude-anthropic-ai-api-key). # Adding your API Key for OpenAI Source: https://alexcodes.app/docs/keys/adding-openai-api-key Learn how to get your API Key To use OpenAI's models (such as GPT-4o and the o-series models) in Xcode with Alex Sidebar without paying a subscription for Alex, you'll need an OpenAI API key. Here's how to get one: 1. Visit [OpenAI's Platform](https://platform.openai.com/) 2. Create an account or sign in if you already have one 3. Once logged in, navigate to the API Keys section in your account settings 4. Click "Create New API Key" 5. Give your key a name (e.g., "Alex Sidebar"), select a project (or default project) and create it 6. Copy the API key - make sure to save it somewhere secure as you won't be able to see it again 7. In Alex Sidebar: * Open Settings (⚙️) * Select "Models" at the bottom of the page * Paste your OpenAI API key in the OpenAI text field Keep your API key secure and never share it publicly. If you suspect your key has been compromised, you should immediately rotate it in the OpenAI Platform. ## Usage & Billing * OpenAI bills based on the number of tokens used * You can monitor your usage in the OpenAI Platform * Set up billing alerts to avoid unexpected charges * New accounts typically come with some free credits to get started For more information about OpenAI's pricing and usage, visit [OpenAI's pricing page](https://openai.com/pricing). Enabling OpenAI does not give you access to all of Alex's features. To enable codebase indexing, follow the [VoyageAI API Key Instructions](/get-started/adding-voyage-ai-api-key), and to enable Thinking mode, follow the [FireworksAI API Key Instructions](/get-started/adding-fireworks-ai-api-key). For Claude models like Claude 3.5 Sonnet and Claude 3.7 Sonnet, follow the [Anthropic API Key Instructions](/get-started/adding-claude-anthropic-ai-api-key). # Adding your API Key for Voyage AI Source: https://alexcodes.app/docs/keys/adding-voyage-ai-api-key Learn how to get your API Key To use codebase indexing in Xcode, we use Voyage AI's code embedding models. To use Voyage AI in Alex Sidebar without paying a subscription for Alex, you'll need a Voyage AI API key. Here's how to get one: 1. Visit [Voyage AI's Console](https://voyageai.com/) 2. Create an account or sign in if you already have one 3. Once logged in, navigate to the [API Keys page](https://dashboard.voyageai.com/api-keys) 4. Click "Create New Secret Key" 5. Give your key a name (e.g., "Alex Sidebar") and create it 6. Copy the API key - make sure to save it somewhere secure as you won't be able to see it again 7. In Alex Sidebar: * Open Settings (⚙️) * Select "Models" at the bottom of the page * Paste your Voyage AI API key in the Voyage AI text field Keep your API key secure and never share it publicly. If you suspect your key has been compromised, you should immediately rotate it in the Voyage AI Console. ## Usage & Billing * Voyage AI bills based on the number of tokens used * You can monitor your usage in the Voyage AI Console * Set up billing alerts to avoid unexpected charges * New accounts typically come with some free credits to get started For more information about Voyage AI's pricing and usage, visit [Voyage AI's pricing page](https://docs.voyageai.com/docs/pricing). Enabling Voyage AI does not give you access to all of Alex's features. For other models like Claude Sonnet or GPT 4o, follow the [Anthropic API Key Instructions](/get-started/adding-claude-anthropic-ai-api-key) and [OpenAI API Key Instructions](/get-started/adding-openai-api-key) respectively. To enable Thinking mode, follow the [FireworksAI API Key Instructions](/get-started/adding-fireworks-ai-api-key). # Advanced Semantic Search Source: https://alexcodes.app/docs/search/advanced-search Learn how to use Alex Sidebar's powerful semantic code search capabilities ## Overview Alex Sidebar's advanced semantic search allows you to find code using natural language queries. Instead of relying on exact matches or keywords, you can describe what you're looking for, and the AI will understand your intent. ## Quick Access Open the search panel from anywhere in Xcode. Start typing to see instant results. Switch between traditional and AI-powered semantic search modes for more accurate results. ## Using Semantic Search Press **Command + P** to open the search panel The search panel can be accessed from any view in Xcode Type your search query using natural language Examples: * "Where is my fix issues button?" * "Find the code that handles user authentication" * "Show me the main navigation setup" ## Search Features * Use everyday language * Describe functionality * Ask questions about code * Search by purpose or intent * Project-wide understanding * Related file detection * Function relationships * Code dependencies * Relevance-based ordering * Code preview snippets * Highlighted matches * Quick navigation * Swift files * Source code * Headers * Project resources ## Best Practices ### Writing Effective Queries Instead of searching for specific names, describe what you're looking for: * ✅ "Find the code that handles user login" * ❌ "loginViewController" Describe the behavior or purpose: * ✅ "Where do we process API responses?" * ❌ "apiHandler class" Frame your queries as you would explain to another developer: * ✅ "Show me where we handle push notifications" * ❌ "pushNotification implementation" ## Tips for Better Results * Start broad, then narrow down * Use specific technical terms when needed * Include relevant context * Be explicit about what you're seeking * Consider project structure * Think about related functionality * Include architectural context * Reference specific features ## Troubleshooting If your search returns no results: * Try rephrasing your query * Use more general terms * Check if semantic mode is enabled * Verify file indexing is complete If results don't match expectations: * Add more context to your query * Be more specific about functionality * Use technical terms if available * Check file indexing status The semantic search feature works best when your project is properly indexed. If you've recently added new files, wait for indexing to complete for the most accurate results. # Discord Community Source: https://alexcodes.app/docs/support/discord-channels Understanding Alex Sidebar's Discord channels and community The community is here to help! Do not hesitate to ask questions, but remember to use the appropriate channel for your topic. ## Getting Started 1. Introduce yourself in #general 2. Read pinned messages in channels 3. Join relevant discussions 4. Share your experience 5. Ask questions in appropriate channels ## Best Practices * Check pinned messages before posting * Use threads for detailed discussions * Share learning resources in #ios * Report bugs with clear reproduction steps * Help others when possible * Stay on topic in each channel ## Channel Overview The official channel for all important updates from our team. Here you'll find the latest product releases, new features, critical changes, and upcoming community events. Our welcoming community hub for all members. Feel free to introduce yourself, engage in iOS development discussions, or join casual conversations with fellow developers. Your go-to channel for all technical assistance needs. Get help with troubleshooting, installation guidance, feature usage, and version-specific issues from our helpful community. The central space for shaping the future of our products. Share your experience with beta features, report bugs, suggest improvements, and discuss performance with other testers. The hub for all things AI and automation. Discuss model behavior, share success stories, request features, and learn tips for getting the most out of AI features. A space to celebrate and share your achievements. Present your integration examples, success stories, app releases, and implementation demos with fellow developers. Your essential iOS development knowledge base. Find curated learning materials, development tips, best practices, and discover recommended tools for iOS development. ## Posting Guidelines ### Support Channel Guidelines When posting in #support, include: * Version Information * App version number * OS version * Build number (for beta) * Device model * Problem Description * Expected behavior * Actual behavior * Impact and frequency * Reproduction Steps * Numbered step-by-step guide * Required conditions * Screenshots/recordings if applicable ### Beta Feedback Guidelines When posting in #beta-feedback, provide: * Detailed Report * Clear description * Current vs expected behavior * Impact on workflow * Supporting Information * Use case examples * Related GitHub issues * Visual mockups (if applicable) * Environment details ### Showcase Guidelines When sharing in #showcase, include: * Project Overview * Core features and purpose * Target audience * Technical implementation * Supporting Materials * Screenshots or demos * GitHub repository (if public) * App Store listing (if published) * Integration details # Getting Help Source: https://alexcodes.app/docs/support/getting-help Learn about Alex Sidebar's support channels and how to get assistance ## Support Channels Join our active community for feedback, support, and tips Report bugs and request features, or ask your questions Get direct support for business inquiries and enterprise-level assistance Access guides, troubleshooting tips, and best practices ## Getting the Best Support Search this documentation first - your question might already be answered! Use **Command + K** to open the AI search assistant to answer your questions and queries directly from the documentation. Check GitHub issues and Discord channels for similar problems and solutions. Please provide for the best support: * Alex Sidebar version (e.g. 1.3.7) * Xcode version (e.g. 16.2) * Steps to reproduce (if reporting an issue) ## Reporting Issues Visit our [bug report page](https://github.com/DanielEdrisian/AlexSideBar-Public/issues/new?assignees=DanielEdrisian\&labels=bug\&projects=\&template=bug-report.md\&title=) which will automatically use our bug report template ```markdown **System Information:** - Alex Sidebar Version: x.x.x - macOS Version: xx.xx - Xcode Version: xx.x **Description:** Clear description of the issue **Steps to Reproduce:** 1. Step one 2. Step two 3. Step three **Expected Behavior:** What should happen **Actual Behavior:** What actually happens **Screenshots/Recordings:** If applicable ``` For visual issues or complex workflows: 1. Use macOS Screen Recording (Shift + Command + 5) 2. Keep recordings focused and under 2 minutes 3. Upload to GitHub issue or share via Discord ## Feature Requests Visit our [feature request page](https://github.com/DanielEdrisian/AlexSideBar-Public/issues/new?assignees=DanielEdrisian\&labels=enhancement\&projects=\&template=feature-request.md\&title=) which will automatically use our feature request template ```markdown **Describe the feature** A description of what is happening. **Screenshots/Screen recordings** Please attach any screen shots or screen recordings here. **What version are you on currently?** - Version [e.g. 1.2.0] ``` Share your idea on Discord to gather community feedback and discuss implementation possibilities ## Community Guidelines When participating in our community: * Be respectful and constructive * Stay on topic * Help others when you can * Follow channel-specific guidelines ## Support Hours Our team is primarily based in PST (Pacific Standard Time). * Discord: Community help available 24/7 * GitHub Issues: Monitored during business hours * Email Support: Response within 1-2 business days # Troubleshooting Guide Source: https://alexcodes.app/docs/support/troubleshooting Common issues, solutions, and performance optimization tips for Alex Sidebar ## Common Issues and Solutions ### Chat and Response Issues **Symptoms:** - No responses in chat - Server timeouts - "Error connecting to LLM API" - Rainbow wheel appearing - Infinite spinners **Solutions:** 1. Check API Connection: - Verify internet connection - If using custom API key, ensure it's valid - Try removing custom API key to use beta credits 2. If App Freezes: - Force quit Alex Sidebar - Restart Xcode - Clear chat history 3. For Server Timeouts: - Reduce context size - Break large requests into smaller ones - Check if you're exceeding context limits ### Project Indexing and File Issues **Symptoms:** * Stuck on indexing * Files not being created properly * Wrong file modifications * Issues with multiple Xcode projects **Solutions:** 1. For Indexing Problems: * Restart Alex Sidebar * Clear Xcode's derived data * Check project permissions 2. File Creation Issues: * Use menu options instead of + button * Verify write permissions * Check for path existence 3. Multiple Projects: * Keep only one project active when possible * Verify correct project selection * Double-check file paths before modifications ### UI and Window Management **Symptoms:** * Incorrect window resizing * Text truncation * Sidebar growing to full screen * Font size issues **Solutions:** 1. Window Issues: * Use Cmd+ and Cmd- for font scaling * Restart app if window becomes unresponsive * Maintain minimum window width 2. Display Problems: * Toggle fullscreen mode * Reset window position * Check display scaling settings ## Performance Optimization ### Model Selection and API Usage **Best Practices for API Usage:** * Use appropriate models for different tasks: * GPT-4 for complex code generation * Claude for documentation and explanations * GPT-3.5 for quick queries * When using custom API keys: * Verify correct model selection * Monitor credit usage * Check for rate limits ### Keyboard and Input **Current Issues:** * Escape key capture affecting Vim users * Dvorak keyboard layout conflicts * Some shortcuts may conflict with Xcode **Workarounds:** * Use menu options instead of shortcuts * Check for keyboard shortcut conflicts in System Preferences * Wait for upcoming customizable shortcuts feature **Known Issues:** * Crashes when pasting in input field * Text loss in prompt inputs * Duplicate text in inputs **Temporary Solutions:** * Type text manually instead of pasting * Break large pastes into smaller chunks * Save important prompts externally ## Reporting New Issues If you encounter issues not covered here: 1. Check the version number 2. Document the steps to reproduce 3. Capture relevant screenshots/recordings 4. Report through appropriate channels: * Discord for quick help * GitHub for bug tracking * Email for account/license issues For fastest resolution: - Include your system information - Provide clear reproduction steps - Mention any recent changes or updates - Include relevant error messages # Activation Source: https://alexcodes.app/docs/windows/activation Configure how Alex Sidebar activates and interacts with your Xcode workspace Control how Alex Sidebar becomes active and responds to your workflow.