@@ -18,6 +18,7 @@ OpenCode is a Go-based CLI application that brings AI assistance to your termina
18
18
- ** Persistent Storage** : SQLite database for storing conversations and sessions
19
19
- ** LSP Integration** : Language Server Protocol support for code intelligence
20
20
- ** File Change Tracking** : Track and visualize file changes during sessions
21
+ - ** External Editor Support** : Open your preferred editor for composing messages
21
22
22
23
## Installation
23
24
@@ -100,41 +101,31 @@ You can configure OpenCode using environment variables:
100
101
101
102
## Supported AI Models
102
103
103
- ### OpenAI Models
104
-
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 |
111
- | ` gpt-4o ` | GPT-4o | 128,000 tokens |
112
- | ` gpt-4o-mini ` | GPT-4o Mini | 128,000 tokens |
113
- | ` o1 ` | O1 | 200,000 tokens |
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 |
119
-
120
- ### Anthropic Models
121
-
122
- | Model ID | Name | Context Window |
123
- | ------------------- | ----------------- | -------------- |
124
- | ` claude-3.5-sonnet ` | Claude 3.5 Sonnet | 200,000 tokens |
125
- | ` claude-3-haiku ` | Claude 3 Haiku | 200,000 tokens |
126
- | ` claude-3.7-sonnet ` | Claude 3.7 Sonnet | 200,000 tokens |
127
- | ` claude-3.5-haiku ` | Claude 3.5 Haiku | 200,000 tokens |
128
- | ` claude-3-opus ` | Claude 3 Opus | 200,000 tokens |
129
-
130
- ### Other Models
131
-
132
- | Model ID | Provider | Name | Context Window |
133
- | --------------------------- | ----------- | ----------------- | -------------- |
134
- | ` gemini-2.5 ` | Google | Gemini 2.5 Pro | - |
135
- | ` gemini-2.0-flash ` | Google | Gemini 2.0 Flash | - |
136
- | ` qwen-qwq ` | Groq | Qwen Qwq | - |
137
- | ` bedrock.claude-3.7-sonnet ` | AWS Bedrock | Claude 3.7 Sonnet | - |
104
+ OpenCode supports a variety of AI models from different providers:
105
+
106
+ ### OpenAI
107
+ - GPT-4.1 family (gpt-4.1, gpt-4.1-mini, gpt-4.1-nano)
108
+ - GPT-4.5 Preview
109
+ - GPT-4o family (gpt-4o, gpt-4o-mini)
110
+ - O1 family (o1, o1-pro, o1-mini)
111
+ - O3 family (o3, o3-mini)
112
+ - O4 Mini
113
+
114
+ ### Anthropic
115
+ - Claude 3.5 Sonnet
116
+ - Claude 3.5 Haiku
117
+ - Claude 3.7 Sonnet
118
+ - Claude 3 Haiku
119
+ - Claude 3 Opus
120
+
121
+ ### Google
122
+ - Gemini 2.5
123
+ - Gemini 2.5 Flash
124
+ - Gemini 2.0 Flash
125
+ - Gemini 2.0 Flash Lite
126
+
127
+ ### AWS Bedrock
128
+ - Claude 3.7 Sonnet
138
129
139
130
## Usage
140
131
@@ -161,12 +152,14 @@ opencode -c /path/to/project
161
152
162
153
### Global Shortcuts
163
154
164
- | Shortcut | Action |
165
- | -------- | ------------------------------------------------------- |
166
- | ` Ctrl+C ` | Quit application |
167
- | ` Ctrl+? ` | Toggle help dialog |
168
- | ` Ctrl+L ` | View logs |
169
- | ` Esc ` | Close current overlay/dialog or return to previous mode |
155
+ | Shortcut | Action |
156
+ | --------- | ------------------------------------------------------- |
157
+ | ` Ctrl+C ` | Quit application |
158
+ | ` Ctrl+? ` | Toggle help dialog |
159
+ | ` ? ` | Toggle help dialog (when not in editing mode) |
160
+ | ` Ctrl+L ` | View logs |
161
+ | ` Ctrl+A ` | Switch session |
162
+ | ` Esc ` | Close current overlay/dialog or return to previous mode |
170
163
171
164
### Chat Page Shortcuts
172
165
@@ -183,13 +176,34 @@ opencode -c /path/to/project
183
176
| ------------------- | ----------------------------------------- |
184
177
| ` Ctrl+S ` | Send message (when editor is focused) |
185
178
| ` Enter ` or ` Ctrl+S ` | Send message (when editor is not focused) |
179
+ | ` Ctrl+E ` | Open external editor |
186
180
| ` Esc ` | Blur editor and focus messages |
187
181
182
+ ### Session Dialog Shortcuts
183
+
184
+ | Shortcut | Action |
185
+ | ------------- | ---------------- |
186
+ | ` ↑ ` or ` k ` | Previous session |
187
+ | ` ↓ ` or ` j ` | Next session |
188
+ | ` Enter ` | Select session |
189
+ | ` Esc ` | Close dialog |
190
+
191
+ ### Permission Dialog Shortcuts
192
+
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 |
201
+
188
202
### Logs Page Shortcuts
189
203
190
- | Shortcut | Action |
191
- | ----------- | ------------------- |
192
- | ` Backspace ` | Return to chat page |
204
+ | Shortcut | Action |
205
+ | ---------------- | ------------------- |
206
+ | ` Backspace ` or ` q ` | Return to chat page |
193
207
194
208
## AI Assistant Tools
195
209
@@ -275,28 +289,13 @@ Once configured, MCP tools are automatically available to the AI assistant along
275
289
276
290
## LSP (Language Server Protocol)
277
291
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.
279
293
280
294
### LSP Features
281
295
282
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
298
- ** File Watching** : Automatically notify language servers of file changes
285
- - ** Diagnostics** : Display errors, warnings, and hints in your code
286
-
287
- ### Supported LSP Features
288
-
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 |
300
299
301
300
### Configuring LSP
302
301
@@ -324,13 +323,14 @@ The AI assistant can access LSP features through the `diagnostics` tool, allowin
324
323
325
324
- Check for errors in your code
326
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.
328
328
329
329
## Development
330
330
331
331
### Prerequisites
332
332
333
- - Go 1.23.5 or higher
333
+ - Go 1.24.0 or higher
334
334
335
335
### Building from Source
336
336
@@ -339,9 +339,6 @@ The AI assistant can access LSP features through the `diagnostics` tool, allowin
339
339
git clone https://github.com/kujtimiihoxha/opencode.git
340
340
cd opencode
341
341
342
- # Build the diff script first
343
- go run cmd/diff/main.go
344
-
345
342
# Build
346
343
go build -o opencode
347
344
@@ -372,4 +369,4 @@ Contributions are welcome! Here's how you can contribute:
372
369
4 . Push to the branch (` git push origin feature/amazing-feature ` )
373
370
5 . Open a Pull Request
374
371
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.
0 commit comments