on main help sign in
update readme
commitd03a73a8d36565cf00ccdee0b1689f295999ad51 authorKujtim Hoxha <kujtimii.h@gmail.com> dateMon 21 Apr 2025, 16:22 (2 years ago) parent1e11805
1 file changed+64−67
README.md+64−67
README.md+64−67
@@ -18,6 +18,7 @@ OpenCode is a Go-based CLI application that brings AI assistance to your termina
1818- **Persistent Storage**: SQLite database for storing conversations and sessions
1919- **LSP Integration**: Language Server Protocol support for code intelligence
2020- **File Change Tracking**: Track and visualize file changes during sessions
21+- **External Editor Support**: Open your preferred editor for composing messages
2122
2223## Installation
2324
@@ -100,41 +101,31 @@ You can configure OpenCode using environment variables:
100101
101102## Supported AI Models
102103
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
138129
139130## Usage
140131
@@ -161,12 +152,14 @@ opencode -c /path/to/project
161152
162153### Global Shortcuts
163154
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 |
170163
171164### Chat Page Shortcuts
172165
@@ -183,13 +176,34 @@ opencode -c /path/to/project
183176| ------------------- | ----------------------------------------- |
184177| `Ctrl+S` | Send message (when editor is focused) |
185178| `Enter` or `Ctrl+S` | Send message (when editor is not focused) |
179+| `Ctrl+E` | Open external editor |
186180| `Esc` | Blur editor and focus messages |
187181
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+
188202### Logs Page Shortcuts
189203
190−| Shortcut | Action |
191−| ----------- | ------------------- |
192−| `Backspace` | Return to chat page |
204+| Shortcut | Action |
205+| ---------------- | ------------------- |
206+| `Backspace` or `q` | Return to chat page |
193207
194208## AI Assistant Tools
195209
@@ -275,28 +289,13 @@ Once configured, MCP tools are automatically available to the AI assistant along
275289
276290## LSP (Language Server Protocol)
277291
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.
279293
280294### LSP Features
281295
282296- **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
284298- **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 |
300299
301300### Configuring LSP
302301
@@ -324,13 +323,14 @@ The AI assistant can access LSP features through the `diagnostics` tool, allowin
324323
325324- Check for errors in your code
326325- 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.
328328
329329## Development
330330
331331### Prerequisites
332332
333−- Go 1.23.5 or higher
333+- Go 1.24.0 or higher
334334
335335### Building from Source
336336
@@ -339,9 +339,6 @@ The AI assistant can access LSP features through the `diagnostics` tool, allowin
339339git clone https://github.com/kujtimiihoxha/opencode.git
340340cd opencode
341341
342−# Build the diff script first
343−go run cmd/diff/main.go
344−
345342# Build
346343go build -o opencode
347344
@@ -372,4 +369,4 @@ Contributions are welcome! Here's how you can contribute:
3723694. Push to the branch (`git push origin feature/amazing-feature`)
3733705. Open a Pull Request
374371
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.