Overview
Inline assistance provides AI-powered help at your cursor position:- Transform selections - Refactor, explain, or modify selected code
- Generate code - Create new code at cursor position
- Context-aware - Uses surrounding code for better results
- Fast responses - Optimized for quick interactions
Activation
Trigger the inline assistant:- Keyboard
- Command Palette
Keyboard Shortcuts
| Action | macOS | Linux/Windows |
|---|---|---|
| Open inline assistant | cmd-i | ctrl-i |
| Accept suggestion | tab or cmd-enter | tab or ctrl-enter |
| Reject suggestion | escape | escape |
| Cancel generation | escape | escape |
Usage Modes
Transform Selection
Modify existing code:Describe Transformation
Type what you want to do:
- “Refactor this to use async/await”
- “Add error handling”
- “Convert to TypeScript”
- “Optimize this loop”
Generate Code
Create new code at cursor:Describe Intent
Type what you want to create:
- “Write a function to validate email addresses”
- “Create a React component for a user profile”
- “Add JSDoc comments”
Quick Actions
Predefined prompts for common tasks:Explain
Get a detailed explanation of selected code
Refactor
Improve code structure and readability
Add Tests
Generate unit tests for selected code
Fix Bug
Identify and fix issues in selected code
Add Docs
Generate documentation comments
Optimize
Improve performance of selected code
Inline Prompts
The inline assistant supports various prompt types:Natural Language
Code Examples
Specific Instructions
Model Configuration
Configure which model handles inline requests:Recommended Models
| Use Case | Model | Why |
|---|---|---|
| General use | Claude 4.6 Sonnet | Best quality |
| Fast responses | GPT-4o Mini | Quick, cost-effective |
| Complex refactoring | Claude 4.6 Sonnet | Better reasoning |
Context Handling
Automatic Context
The inline assistant automatically includes:- Selected code - The highlighted text
- Surrounding code - Lines above and below selection
- File type - Language-specific context
- Project structure - When relevant
Context Window
Control how much context is included:Larger context windows provide better results but use more tokens.
Diff Preview
Inline suggestions show as diffs:- Inline Diff
- Side-by-Side
Inline View
Changes appear directly in the editor:- Green: Added lines
- Red: Removed lines
- Yellow: Modified lines
Multi-step Editing
Chain multiple inline transformations:Performance Tips
Advanced Features
Custom Prompts
Create reusable prompts:Code Templates
Generate boilerplate from templates:Language-Specific Features
TypeScript/JavaScript
- Add type annotations
- Convert between JS and TS
- Generate interfaces from objects
- Async/await transformations
Python
- Add type hints
- Generate docstrings
- Convert to/from dataclasses
- Refactor to use list comprehensions
Rust
- Add lifetime annotations
- Convert to use
Result<T, E> - Generate error handling
- Derive trait implementations
Go
- Add error handling
- Generate method stubs
- Convert to interfaces
- Add context parameters
Troubleshooting
Slow responses
Slow responses
- Switch to a faster model (e.g., GPT-4o Mini)
- Reduce context window size
- Select less code at once
- Check network latency
Poor suggestions
Poor suggestions
- Be more specific in your prompt
- Include more context (select more code)
- Try a different model
- Provide example of desired output
Assistant not appearing
Assistant not appearing
- Verify model is configured
- Check API key authentication
- Ensure feature is enabled in settings
- Try restarting Glass
Keyboard Reference
| Action | macOS | Linux/Windows |
|---|---|---|
| Open inline assistant | cmd-i | ctrl-i |
| Accept suggestion | tab or cmd-enter | tab or ctrl-enter |
| Reject suggestion | escape | escape |
| Next suggestion | cmd-] | ctrl-] |
| Previous suggestion | cmd-[ | ctrl-[ |
| Show diff | cmd-d | ctrl-d |
| Undo | cmd-z | ctrl-z |