You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: github/README.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,24 @@ Leave the following comment on a GitHub PR. opencode will implement the requeste
30
30
Delete the attachment from S3 when the note is removed /oc
31
31
```
32
32
33
+
#### Review specific code lines
34
+
35
+
Leave a comment directly on code lines in the PR's "Files" tab. opencode will automatically detect the file, line numbers, and diff context to provide precise responses.
36
+
37
+
```
38
+
[Comment on specific lines in Files tab]
39
+
/oc add error handling here
40
+
```
41
+
42
+
When commenting on specific lines, opencode receives:
43
+
44
+
- The exact file being reviewed
45
+
- The specific lines of code
46
+
- The surrounding diff context
47
+
- Line number information
48
+
49
+
This allows for more targeted requests without needing to specify file paths or line numbers manually.
50
+
33
51
## Installation
34
52
35
53
Run the following command in the terminal from your GitHub repo:
@@ -51,6 +69,8 @@ This will walk you through installing the GitHub app, creating the workflow, and
51
69
on:
52
70
issue_comment:
53
71
types: [created]
72
+
pull_request_review_comment:
73
+
types: [created]
54
74
55
75
jobs:
56
76
opencode:
@@ -135,3 +155,9 @@ Replace the image URL `https://github.com/user-attachments/assets/xxxxxxxx` with
return`Review this code change and suggest improvements for the commented lines:\n\nFile: ${reviewContext.file}\nLines: ${reviewContext.line}\n\n${reviewContext.diffHunk}`
return`${body}\n\nContext: You are reviewing a comment on file "${reviewContext.file}" at line ${reviewContext.line}.\n\nDiff context:\n${reviewContext.diffHunk}`
425
+
}
426
+
returnbody
427
+
}
391
428
thrownewError("Comments must mention `/opencode` or `/oc`")
return`Review this code change and suggest improvements for the commented lines:\n\nFile: ${reviewContext.file}\nLines: ${reviewContext.line}\n\n${reviewContext.diffHunk}`
return`${body}\n\nContext: You are reviewing a comment on file "${reviewContext.file}" at line ${reviewContext.line}.\n\nDiff context:\n${reviewContext.diffHunk}`
570
+
}
571
+
returnbody
572
+
}
539
573
thrownewError("Comments must mention `/opencode` or `/oc`")
Copy file name to clipboardExpand all lines: packages/web/src/content/docs/github.mdx
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,8 @@ Or you can set it up manually.
45
45
on:
46
46
issue_comment:
47
47
types: [created]
48
+
pull_request_review_comment:
49
+
types: [created]
48
50
49
51
jobs:
50
52
opencode:
@@ -129,3 +131,20 @@ Here are some examples of how you can use opencode in GitHub.
129
131
```
130
132
131
133
opencode will implement the requested change and commit it to the same PR.
134
+
135
+
-**Review specific code lines**
136
+
137
+
Leave a comment directly on code lines in the PR's "Files" tab. opencode automatically detects the file, line numbers, and diff context to provide precise responses.
138
+
139
+
```
140
+
[Comment on specific lines in Files tab]
141
+
/oc add error handling here
142
+
```
143
+
144
+
When commenting on specific lines, opencode receives:
145
+
- The exact file being reviewed
146
+
- The specific lines of code
147
+
- The surrounding diff context
148
+
- Line number information
149
+
150
+
This allows for more targeted requests without needing to specify file paths or line numbers manually.
0 commit comments