Skip to content

Commit 66a667d

Browse files
authoredMar 27, 2025··
Update main readme file + improve help docs (#1653)
* Update main readme file + improve help docs * Add guide on running help_docs as a GitHub action.
1 parent 482cd7c commit 66a667d

File tree

2 files changed

+89
-26
lines changed

2 files changed

+89
-26
lines changed
 

‎README.md

+25-22
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,19 @@ Supported commands per platform:
9797

9898
| | | GitHub | GitLab | Bitbucket | Azure DevOps |
9999
|-------|---------------------------------------------------------------------------------------------------------|:--------------------:|:--------------------:|:---------:|:------------:|
100-
| TOOLS | [Review](https://qodo-merge-docs.qodo.ai/tools/review/) |||||
101-
| | [Describe](https://qodo-merge-docs.qodo.ai/tools/describe/) |||||
102-
| | [Improve](https://qodo-merge-docs.qodo.ai/tools/improve/) |||||
103-
| | [Ask](https://qodo-merge-docs.qodo.ai/tools/ask/) |||||
104-
| |[Ask on code lines](https://qodo-merge-docs.qodo.ai/tools/ask/#ask-lines) ||| | |
105-
| | [Update CHANGELOG](https://qodo-merge-docs.qodo.ai/tools/update_changelog/) |||||
106-
| | [Ticket Context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/) 💎 |||| |
107-
| | [Utilizing Best Practices](https://qodo-merge-docs.qodo.ai/tools/improve/#best-practices) 💎 |||| |
108-
| | [PR Chat](https://qodo-merge-docs.qodo.ai/chrome-extension/features/#pr-chat) 💎 || | | |
109-
| | [Suggestion Tracking](https://qodo-merge-docs.qodo.ai/tools/improve/#suggestion-tracking) 💎 ||| | |
100+
| TOOLS | [Review](https://qodo-merge-docs.qodo.ai/tools/review/) |||||
101+
| | [Describe](https://qodo-merge-docs.qodo.ai/tools/describe/) |||||
102+
| | [Improve](https://qodo-merge-docs.qodo.ai/tools/improve/) |||||
103+
| | [Ask](https://qodo-merge-docs.qodo.ai/tools/ask/) |||||
104+
| |[Ask on code lines](https://qodo-merge-docs.qodo.ai/tools/ask/#ask-lines) ||| | |
105+
| | [Update CHANGELOG](https://qodo-merge-docs.qodo.ai/tools/update_changelog/) |||||
106+
| | [Help Docs](https://qodo-merge-docs.qodo.ai/tools/help_docs/?h=auto#auto-approval) |||| |
107+
| | [Ticket Context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/) 💎 |||| |
108+
| | [Utilizing Best Practices](https://qodo-merge-docs.qodo.ai/tools/improve/#best-practices) 💎 |||| |
109+
| | [PR Chat](https://qodo-merge-docs.qodo.ai/chrome-extension/features/#pr-chat) 💎 || | | |
110+
| | [Suggestion Tracking](https://qodo-merge-docs.qodo.ai/tools/improve/#suggestion-tracking) 💎 ||| | |
110111
| | [CI Feedback](https://qodo-merge-docs.qodo.ai/tools/ci_feedback/) 💎 || | | |
111-
| | [PR Documentation](https://qodo-merge-docs.qodo.ai/tools/documentation/) 💎 ||| | |
112+
| | [PR Documentation](https://qodo-merge-docs.qodo.ai/tools/documentation/) 💎 ||| | |
112113
| | [Custom Labels](https://qodo-merge-docs.qodo.ai/tools/custom_labels/) 💎 ||| | |
113114
| | [Analyze](https://qodo-merge-docs.qodo.ai/tools/analyze/) 💎 ||| | |
114115
| | [Similar Code](https://qodo-merge-docs.qodo.ai/tools/similar_code/) 💎 || | | |
@@ -117,21 +118,21 @@ Supported commands per platform:
117118
| | [Implement](https://qodo-merge-docs.qodo.ai/tools/implement/) 💎 |||| |
118119
| | [Auto-Approve](https://qodo-merge-docs.qodo.ai/tools/improve/?h=auto#auto-approval) 💎 |||| |
119120
| | | | | | |
120-
| USAGE | [CLI](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#local-repo-cli) |||||
121-
| | [App / webhook](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#github-app) |||||
122-
| | [Tagging bot](https://github.com/Codium-ai/pr-agent#try-it-now) || | | |
123-
| | [Actions](https://qodo-merge-docs.qodo.ai/installation/github/#run-as-a-github-action) |||||
121+
| USAGE | [CLI](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#local-repo-cli) |||||
122+
| | [App / webhook](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#github-app) |||||
123+
| | [Tagging bot](https://github.com/Codium-ai/pr-agent#try-it-now) || | | |
124+
| | [Actions](https://qodo-merge-docs.qodo.ai/installation/github/#run-as-a-github-action) |||||
124125
| | | | | | |
125-
| CORE | [PR compression](https://qodo-merge-docs.qodo.ai/core-abilities/compression_strategy/) |||||
126+
| CORE | [PR compression](https://qodo-merge-docs.qodo.ai/core-abilities/compression_strategy/) |||||
126127
| | Adaptive and token-aware file patch fitting |||||
127-
| | [Multiple models support](https://qodo-merge-docs.qodo.ai/usage-guide/changing_a_model/) |||||
128-
| | [Local and global metadata](https://qodo-merge-docs.qodo.ai/core-abilities/metadata/) |||||
129-
| | [Dynamic context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/) |||||
130-
| | [Self reflection](https://qodo-merge-docs.qodo.ai/core-abilities/self_reflection/) |||||
128+
| | [Multiple models support](https://qodo-merge-docs.qodo.ai/usage-guide/changing_a_model/) |||||
129+
| | [Local and global metadata](https://qodo-merge-docs.qodo.ai/core-abilities/metadata/) |||||
130+
| | [Dynamic context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/) |||||
131+
| | [Self reflection](https://qodo-merge-docs.qodo.ai/core-abilities/self_reflection/) |||||
131132
| | [Static code analysis](https://qodo-merge-docs.qodo.ai/core-abilities/static_code_analysis/) 💎 ||| | |
132133
| | [Global and wiki configurations](https://qodo-merge-docs.qodo.ai/usage-guide/configuration_options/) 💎 |||| |
133-
| | [PR interactive actions](https://www.qodo.ai/images/pr_agent/pr-actions.mp4) 💎 ||| | |
134-
| | [Impact Evaluation](https://qodo-merge-docs.qodo.ai/core-abilities/impact_evaluation/) 💎 ||| | |
134+
| | [PR interactive actions](https://www.qodo.ai/images/pr_agent/pr-actions.mp4) 💎 ||| | |
135+
| | [Impact Evaluation](https://qodo-merge-docs.qodo.ai/core-abilities/impact_evaluation/) 💎 ||| | |
135136
- 💎 means this feature is available only in [Qodo-Merge](https://www.qodo.ai/pricing/)
136137

137138
[//]: # (- Support for additional git providers is described in [here](./docs/Full_environments.md))
@@ -147,6 +148,8 @@ ___
147148
\
148149
**Update Changelog ([`/update_changelog`](https://qodo-merge-docs.qodo.ai/tools/update_changelog/))**: Automatically updating the CHANGELOG.md file with the PR changes.
149150
\
151+
**Help Docs ([`/help_docs`](https://qodo-merge-docs.qodo.ai/tools/help_docs/))**: Answers a question on any repository by utilizing given documentation.
152+
\
150153
**Add Documentation 💎 ([`/add_docs`](https://qodo-merge-docs.qodo.ai/tools/documentation/))**: Generates documentation to methods/functions/classes that changed in the PR.
151154
\
152155
**Generate Custom Labels 💎 ([`/generate_labels`](https://qodo-merge-docs.qodo.ai/tools/custom_labels/))**: Generates custom labels for the PR, based on specific guidelines defined by the user.

‎docs/docs/tools/help_docs.md

+64-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,85 @@
11
## Overview
22

3-
The `help_docs` tool answers a question based on a given relative path of documentation, either from the repository of this merge request or from a given one.
4-
It can be invoked manually by commenting on any PR:
3+
The `help_docs` tool answers a question based on a given relative path of documentation (which defaults to docs/), either from the repository of this merge request or from a given one.
4+
It can be invoked manually by commenting on any PR or Issue:
55
```
66
/help_docs "..."
77
```
88

99
## Example usage
10-
10+
#### Asking a question about this repository:
1111
![help_docs on the documentation of this repository](https://codium.ai/images/pr_agent/help_docs_comment.png){width=512}
1212

13+
#### Asking a question about another repository under branch: main:
1314
![help_docs on the documentation of another repository](https://codium.ai/images/pr_agent/help_docs_comment_explicit_git.png){width=512}
1415

16+
#### Response for the first question:
1517
![help_docs response](https://codium.ai/images/pr_agent/help_docs_response.png){width=512}
1618

1719
## Configuration options
1820

19-
Under the section `--pr_help_docs`, the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'help docs' tool:
21+
Under the section `pr_help_docs`, the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'help docs' tool:
2022

2123
- `repo_url`: If not overwritten, will use the repo from where the context came from (issue or PR), otherwise - use the given repo as context.
2224
- `repo_default_branch`: The branch to use in case repo_url overwritten, otherwise - has no effect.
2325
- `docs_path`: Relative path from root of repository (either the one this PR has been issued for, or above repo url).
2426
- `exclude_root_readme`: Whether or not to exclude the root README file for querying the model.
2527
- `supported_doc_exts` : Which file extensions should be included for the purpose of querying the model.
28+
29+
---
30+
## Run as a GitHub Action
31+
32+
You can use our pre-built Github Action Docker image to run help_docs on any newly created issue, as a Github Action. Here's how:
33+
34+
1) Follow the steps depicted under [Run as a Github Action](https://qodo-merge-docs.qodo.ai/installation/github/#run-as-a-github-action) to create a new workflow, such as:`.github/workflows/help_docs.yml`:
35+
36+
2) Edit your yaml file to the following:
37+
38+
```yaml
39+
name: Run pr agent on every opened issue, respond to user comments on an issue
40+
41+
#When the action is triggered
42+
on:
43+
issues:
44+
types: [opened] #New issue
45+
46+
# Read env. variables
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GITHUB_API_URL: ${{ github.api_url }}
50+
GIT_REPO_URL: ${{ github.event.repository.clone_url }}
51+
ISSUE_URL: ${{ github.event.issue.html_url || github.event.comment.html_url }}
52+
ISSUE_BODY: ${{ github.event.issue.body || github.event.comment.body }}
53+
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
54+
55+
# The actual set of actions
56+
jobs:
57+
issue_agent:
58+
runs-on: ubuntu-latest
59+
if: ${{ github.event.sender.type != 'Bot' }} #Do not respond to bots
60+
61+
# Set required permissions
62+
permissions:
63+
contents: read # For reading repository contents
64+
issues: write # For commenting on issues
65+
66+
steps:
67+
- name: Run PR Agent on Issues
68+
if: ${{ env.ISSUE_URL != '' }}
69+
uses: docker://codiumai/pr-agent:latest
70+
with:
71+
entrypoint: /bin/bash #Replace invoking cli.py directly with a shell
72+
args: |
73+
-c "cd /app && \
74+
echo 'Running Issue Agent action step on ISSUE_URL=$ISSUE_URL' && \
75+
export config__git_provider='github' && \
76+
export github__user_token=$GITHUB_TOKEN && \
77+
export github__base_url=$GITHUB_API_URL && \
78+
export openai__key=$OPENAI_KEY && \
79+
export config__verbosity_level=2 && \
80+
python -m pr_agent.cli --issue_url=$ISSUE_URL help_docs \"$ISSUE_BODY\""
81+
```
82+
83+
3) Following completion of the remaining steps (such as adding secrets and any env. variables), merge this change to your main branch.
84+
When a new issue is opened, you should see a comment from `github-actions` bot with an auto response, assuming the question is a relevant one.
85+
---

0 commit comments

Comments
 (0)
Please sign in to comment.