@@ -18,6 +18,7 @@ OpenCode is a Go-based CLI application that brings AI assistance to your termina
18- **Persistent Storage**: SQLite database for storing conversations and sessions
18- **Persistent Storage**: SQLite database for storing conversations and sessions
19- **LSP Integration**: Language Server Protocol support for code intelligence
19- **LSP Integration**: Language Server Protocol support for code intelligence
20- **File Change Tracking**: Track and visualize file changes during sessions
20- **File Change Tracking**: Track and visualize file changes during sessions
21+- **External Editor Support**: Open your preferred editor for composing messages
22## Installation
23## Installation
@@ -100,41 +101,31 @@ You can configure OpenCode using environment variables:
101## Supported AI Models
102## Supported AI Models
104+OpenCode supports a variety of AI models from different providers:
103−### OpenAI Models
106+### OpenAI
104−
107+- GPT-4.1 family (gpt-4.1, gpt-4.1-mini, gpt-4.1-nano)
105−| Model ID | Name | Context Window |
106−| ----------------- | --------------- | ---------------- |
107−| `gpt-4.1` | GPT 4.1 | 1,047,576 tokens |
108−| `gpt-4.1-mini` | GPT 4.1 Mini | 200,000 tokens |
109−| `gpt-4.1-nano` | GPT 4.1 Nano | 1,047,576 tokens |
110−| `gpt-4.5-preview` | GPT 4.5 Preview | 128,000 tokens |
108+- GPT-4.5 Preview
111−| `gpt-4o` | GPT-4o | 128,000 tokens |
109+- GPT-4o family (gpt-4o, gpt-4o-mini)
112−| `gpt-4o-mini` | GPT-4o Mini | 128,000 tokens |
110+- O1 family (o1, o1-pro, o1-mini)
113−| `o1` | O1 | 200,000 tokens |
111+- O3 family (o3, o3-mini)
114−| `o1-pro` | O1 Pro | 200,000 tokens |
115−| `o1-mini` | O1 Mini | 128,000 tokens |
116−| `o3` | O3 | 200,000 tokens |
117−| `o3-mini` | O3 Mini | 200,000 tokens |
118−| `o4-mini` | O4 Mini | 128,000 tokens |
112+- O4 Mini
120−### Anthropic Models
114+### Anthropic
122−| Model ID | Name | Context Window |
123−| ------------------- | ----------------- | -------------- |
124−| `claude-3.5-sonnet` | Claude 3.5 Sonnet | 200,000 tokens |
115+- Claude 3.5 Sonnet
125−| `claude-3-haiku` | Claude 3 Haiku | 200,000 tokens |
116+- Claude 3.5 Haiku
126−| `claude-3.7-sonnet` | Claude 3.7 Sonnet | 200,000 tokens |
117+- Claude 3.7 Sonnet
127−| `claude-3.5-haiku` | Claude 3.5 Haiku | 200,000 tokens |
118+- Claude 3 Haiku
128−| `claude-3-opus` | Claude 3 Opus | 200,000 tokens |
119+- Claude 3 Opus
130−### Other Models
121+### Google
132−| Model ID | Provider | Name | Context Window |
133−| --------------------------- | ----------- | ----------------- | -------------- |
134−| `gemini-2.5` | Google | Gemini 2.5 Pro | - |
123+- Gemini 2.5 Flash
135−| `gemini-2.0-flash` | Google | Gemini 2.0 Flash | - |
125+- Gemini 2.0 Flash Lite
136−| `qwen-qwq` | Groq | Qwen Qwq | - |
126+
137−| `bedrock.claude-3.7-sonnet` | AWS Bedrock | Claude 3.7 Sonnet | - |
128+- Claude 3.7 Sonnet
@@ -161,12 +152,14 @@ opencode -c /path/to/project
162### Global Shortcuts
153### Global Shortcuts
164−| Shortcut | Action |
155+| Shortcut | Action |
165−| -------- | ------------------------------------------------------- |
156+| --------- | ------------------------------------------------------- |
166−| `Ctrl+C` | Quit application |
157+| `Ctrl+C` | Quit application |
167−| `Ctrl+?` | Toggle help dialog |
158+| `Ctrl+?` | Toggle help dialog |
159+| `?` | Toggle help dialog (when not in editing mode) |
168−| `Ctrl+L` | View logs |
160+| `Ctrl+L` | View logs |
161+| `Ctrl+A` | Switch session |
169−| `Esc` | Close current overlay/dialog or return to previous mode |
162+| `Esc` | Close current overlay/dialog or return to previous mode |
171### Chat Page Shortcuts
164### Chat Page Shortcuts
@@ -183,13 +176,34 @@ opencode -c /path/to/project
183| ------------------- | ----------------------------------------- |
176| ------------------- | ----------------------------------------- |
184| `Ctrl+S` | Send message (when editor is focused) |
177| `Ctrl+S` | Send message (when editor is focused) |
185| `Enter` or `Ctrl+S` | Send message (when editor is not focused) |
178| `Enter` or `Ctrl+S` | Send message (when editor is not focused) |
179+| `Ctrl+E` | Open external editor |
186| `Esc` | Blur editor and focus messages |
180| `Esc` | Blur editor and focus messages |
182+### Session Dialog Shortcuts
184+| Shortcut | Action |
185+| ------------- | ---------------- |
186+| `↑` or `k` | Previous session |
187+| `↓` or `j` | Next session |
188+| `Enter` | Select session |
189+| `Esc` | Close dialog |
191+### Permission Dialog Shortcuts
193+| Shortcut | Action |
194+| ------------------------- | ----------------------- |
195+| `←` or `left` | Switch options left |
196+| `→` or `right` or `tab` | Switch options right |
197+| `Enter` or `space` | Confirm selection |
198+| `a` | Allow permission |
199+| `A` | Allow permission for session |
200+| `d` | Deny permission |
188### Logs Page Shortcuts
202### Logs Page Shortcuts
190−| Shortcut | Action |
204+| Shortcut | Action |
191−| ----------- | ------------------- |
205+| ---------------- | ------------------- |
192−| `Backspace` | Return to chat page |
206+| `Backspace` or `q` | Return to chat page |
194## AI Assistant Tools
208## AI Assistant Tools
@@ -275,28 +289,13 @@ Once configured, MCP tools are automatically available to the AI assistant along
276## LSP (Language Server Protocol)
290## LSP (Language Server Protocol)
278−OpenCode integrates with Language Server Protocol to provide rich code intelligence features across multiple programming languages.
292+OpenCode integrates with Language Server Protocol to provide code intelligence features across multiple programming languages.
280### LSP Features
294### LSP Features
282- **Multi-language Support**: Connect to language servers for different programming languages
296- **Multi-language Support**: Connect to language servers for different programming languages
283−- **Code Intelligence**: Get diagnostics, completions, and navigation assistance
297+- **Diagnostics**: Receive error checking and linting information
284- **File Watching**: Automatically notify language servers of file changes
298- **File Watching**: Automatically notify language servers of file changes
285−- **Diagnostics**: Display errors, warnings, and hints in your code
287−### Supported LSP Features
289−| Feature | Description |
290−| ----------------- | ----------------------------------- |
291−| Diagnostics | Error checking and linting |
292−| Completions | Code suggestions and autocompletion |
293−| Hover | Documentation on hover |
294−| Definition | Go to definition |
295−| References | Find all references |
296−| Document Symbols | Navigate symbols in current file |
297−| Workspace Symbols | Search symbols across workspace |
298−| Formatting | Code formatting |
299−| Code Actions | Quick fixes and refactorings |
301### Configuring LSP
300### Configuring LSP
@@ -324,13 +323,14 @@ The AI assistant can access LSP features through the `diagnostics` tool, allowin
325- Check for errors in your code
324- Check for errors in your code
326- Suggest fixes based on diagnostics
325- Suggest fixes based on diagnostics
327−- Provide intelligent code assistance
326+
327+While the LSP client implementation supports the full LSP protocol (including completions, hover, definition, etc.), currently only diagnostics are exposed to the AI assistant.
329## Development
329## Development
331### Prerequisites
331### Prerequisites
333−- Go 1.23.5 or higher
333+- Go 1.24.0 or higher
335### Building from Source
335### Building from Source
@@ -339,9 +339,6 @@ The AI assistant can access LSP features through the `diagnostics` tool, allowin
339git clone https://github.com/kujtimiihoxha/opencode.git
339git clone https://github.com/kujtimiihoxha/opencode.git
340cd opencode
340cd opencode
342−# Build the diff script first
343−go run cmd/diff/main.go
346go build -o opencode
343go build -o opencode
@@ -372,4 +369,4 @@ Contributions are welcome! Here's how you can contribute:
3724. Push to the branch (`git push origin feature/amazing-feature`)
3694. Push to the branch (`git push origin feature/amazing-feature`)
3735. Open a Pull Request
3705. Open a Pull Request
375−Please make sure to update tests as appropriate and follow the existing code style.
372+Please make sure to update tests as appropriate and follow the existing code style.