Overview
Code completion provides natural, context-aware code suggestions as you type in Xcode. This brings AI-powered autocomplete to your Swift development workflow, helping you write code faster and with fewer errors.Supported Providers
cmd supports code completion from three leading providers:GitHub Copilot
Use your existing GitHub Copilot subscription for code suggestions
Mistral AI
Fast and accurate completions powered by Mistral’s Codestral model
Mercury Coder
Inception’s Mercury Coder for thoughtful, context-aware suggestions
Configuration
Choose a Provider
Select your preferred completion provider:
- GitHub Copilot: Requires a GitHub Copilot subscription
- Mistral AI: Requires a Mistral API key
- Claude: Uses your configured Anthropic API key
Provider Setup
GitHub Copilot
GitHub Copilot requires an active subscription. Visit github.com/features/copilot to subscribe.
Mistral AI / Mercury Coder
Get API Key
Create an API key at console.mistral.ai
Trigger Modes
Automatic Mode
In automatic mode, code completions appear as you type after a brief pause. This provides a seamless experience where suggestions flow naturally with your coding rhythm.- Suggestions appear automatically after you stop typing
- Minimal interruption to your workflow
- Best for developers who want continuous assistance
On-Demand Mode
In on-demand mode, you control when completions appear by pressing a keyboard shortcut.- Trigger completions only when you want them
- Less visual noise while coding
- Best for developers who prefer explicit control
Using Code Completion
Once configured, code completion works seamlessly in Xcode:- Start typing in any Swift file
- View suggestions that appear inline as ghost text
- Accept a suggestion by pressing
Tab - Dismiss a suggestion by pressing
Escapeor continuing to type
Best Practices
Write Clear Comments
Add comments describing what you want to implement. Code completion uses these as context for better suggestions.
Use Meaningful Names
Descriptive function and variable names help the AI understand your intent and provide more relevant completions.

