-
-Click [here](https://codium.ai/images/pr_agent/wiki_configuration_pr_agent.mp4) to see a short instructional video. We recommend surrounding the configuration content with triple-quotes, to allow better presentation when displayed in the wiki as markdown.
-An example content:
-
-\`\`\`
-
-As an alternative, you can filter in your mail provider the notifications specifically from the PR-Agent bot:
-https://www.quora.com/How-can-you-filter-emails-for-specific-people-in-Gmail#:~:text=On%20the%20Filters%20and%20Blocked,the%20body%20of%20the%20email
-
-
-
-## Usage and Automation
-
-### Working from a local repo (CLI)
-When running from your local repo (CLI), your local configuration file will be used.
-Examples of invoking the different tools via the CLI:
-
-- **Review**: `python -m pr_agent.cli --pr_url=
-___
-
-___
-
-### Configuration options
-
-To edit [configurations](./../pr_agent/settings/configuration.toml#L19) related to the review tool (`pr_reviewer` section), use the following template:
-```
-/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
-```
-
-#### General options
-- `num_code_suggestions`: number of code suggestions provided by the 'review' tool. For manual comments, default is 4. For [PR-Agent app](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L142) auto tools, default is 0, meaning no code suggestions will be provided by the review tool, unless you manually edit `pr_commands`.
-- `inline_code_comments`: if set to true, the tool will publish the code suggestions as comments on the code diff. Default is false.
-- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
-- `final_update_message`: if set to true, it will add a comment message after finishing calling `/review`. Default is true.
-- `persistent_comment`: if set to true, the review comment will be persistent, meaning that every new review request will edit the previous one. Default is true.
-
-#### Enable\\disable features
-- `require_focused_review`: if set to true, the tool will add a section - 'is the PR a focused one'. Default is false.
-- `require_score_review`: if set to true, the tool will add a section that scores the PR. Default is false.
-- `require_tests_review`: if set to true, the tool will add a section that checks if the PR contains tests. Default is true.
-- `require_estimate_effort_to_review`: if set to true, the tool will add a section that estimates the effort needed to review the PR. Default is true.
-#### SOC2 ticket compliance 💎
-This sub-tool checks if the PR description properly contains a ticket to a project management system (e.g., Jira, Asana, Trello, etc.), as required by SOC2 compliance. If not, it will add a label to the PR: "Missing SOC2 ticket".
-- `require_soc2_ticket`: If set to true, the SOC2 ticket checker sub-tool will be enabled. Default is false.
-- `soc2_ticket_prompt`: The prompt for the SOC2 ticket review. Default is: `Does the PR description include a link to ticket in a project management system (e.g., Jira, Asana, Trello, etc.) ?`. Edit this field if your compliance requirements are different.
-#### Adding PR labels
-- `enable_review_labels_security`: if set to true, the tool will publish a 'possible security issue' label if it detects a security issue. Default is true.
-- `enable_review_labels_effort`: if set to true, the tool will publish a 'Review effort [1-5]: x' label. Default is true.
-#### Auto-approval
-- `enable_auto_approval`: if set to true, the tool will approve the PR when invoked with the 'auto_approve' command. Default is false. This flag can be changed only from configuration file.
-- `maximal_review_effort`: maximal effort level for auto-approval. If the PR's estimated review effort is above this threshold, the auto-approval will not run. Default is 5.
-
-### Incremental Mode
-Incremental review only considers changes since the last PR-Agent review. This can be useful when working on the PR in an iterative manner, and you want to focus on the changes since the last review instead of reviewing the entire PR again.
-For invoking the incremental mode, the following command can be used:
-```
-/review -i
-```
-Note that the incremental mode is only available for GitHub.
-
-
-
-Under the section 'pr_reviewer', the [configuration file](./../pr_agent/settings/configuration.toml#L19) contains options to customize the 'review -i' tool.
-These configurations can be used to control the rate at which the incremental review tool will create new review comments when invoked automatically, to prevent making too much noise in the PR.
-- `minimal_commits_for_incremental_review`: Minimal number of commits since the last review that are required to create incremental review.
-If there are less than the specified number of commits since the last review, the tool will not perform any action.
-Default is 0 - the tool will always run, no matter how many commits since the last review.
-- `minimal_minutes_for_incremental_review`: Minimal number of minutes that need to pass since the last reviewed commit to create incremental review.
-If less than the specified number of minutes have passed between the last reviewed commit and running this command, the tool will not perform any action.
-Default is 0 - the tool will always run, no matter how much time have passed since the last reviewed commit.
-- `require_all_thresholds_for_incremental_review`: If set to true, all the previous thresholds must be met for incremental review to run. If false, only one is enough to run the tool.
-For example, if `minimal_commits_for_incremental_review=2` and `minimal_minutes_for_incremental_review=2`, and we have 3 commits since the last review, but the last reviewed commit is from 1 minute ago:
-When `require_all_thresholds_for_incremental_review=true` the incremental review __will not__ run, because only 1 out of 2 conditions were met (we have enough commits but the last review is too recent),
-but when `require_all_thresholds_for_incremental_review=false` the incremental review __will__ run, because one condition is enough (we have 3 commits which is more than the configured 2).
-Default is false - the tool will run as long as at least once conditions is met.
-
-### PR Reflection
-By invoking:
-```
-/reflect_and_review
-```
-The tool will first ask the author questions about the PR, and will guide the review based on their answers.
-
-
-___
-
-___
-
-___
-
-
-## Usage Tips
-1) [General guidelines](#general-guidelines)
-2) [Code suggestions](#code-suggestions)
-3) [Automation](#automation)
-4) [Auto-labels](#auto-labels)
-5) [Extra instructions](#extra-instructions)
-6) [Auto-approval](#auto-approval)
-
-### General guidelines
-The `review` tool provides a collection of possible feedbacks about a PR.
-It is recommended to review the [Configuration options](#configuration-options) section, and choose the relevant options for your use case.
-
-Some of the features that are disabled by default are quite useful, and should be considered for enabling. For example:
-`require_score_review`, `require_soc2_ticket`, and more.
-
-On the other hand, if you find one of the enabled features to be irrelevant for your use case, disable it. No default configuration can fit all use cases.
-
-### Code suggestions
-If you set `num_code_suggestions`>0 , the `review` tool will also provide code suggestions.
-
-Notice If you are interested **only** in the code suggestions, it is recommended to use the [`improve`](./IMPROVE.md) feature instead, since it is a dedicated only to code suggestions, and usually gives better results.
-Use the `review` tool if you want to get more comprehensive feedback, which includes code suggestions as well.
-
-### Automation
-- When you first install the app, the [default mode](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) for the `review` tool is:
-```
-pr_commands = ["/review", ...]
-```
-Meaning the `review` tool will run automatically on every PR, with the default configuration.
-Edit this field to enable/disable the tool, or to change the used configurations.
-
-### Auto-labels
-The `review` tool can auto-generate two specific types of labels for a PR:
-- a `possible security issue` label that detects a possible [security issue](https://github.com/Codium-ai/pr-agent/blob/tr/user_description/pr_agent/settings/pr_reviewer_prompts.toml#L136) (`enable_review_labels_security` flag)
-- a `Review effort [1-5]: x` label, where x is the estimated effort to review the PR (`enable_review_labels_effort` flag)
-
-Both modes are useful, and we recommended to enable them.
-
-### Extra instructions
-Extra instructions are important.
-The `review` tool can be configured with extra instructions, which can be used to guide the model to a feedback tailored to the needs of your project.
-
-Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify the relevant sub-tool, and the relevant aspects of the PR that you want to emphasize.
-
-Examples for extra instructions:
-```
-[pr_reviewer] # /review #
-extra_instructions="""
-In the code feedback section, emphasize the following:
-- Does the code logic cover relevant edge cases?
-- Is the code logic clear and easy to understand?
-- Is the code logic efficient?
-...
-"""
-```
-Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.
-
-
-### Auto-approval
-PR-Agent can approve a PR when a specific comment is invoked.
-
-To ensure safety, the auto-approval feature is disabled by default. To enable auto-approval, you need to actively set in a pre-defined configuration file the following:
-```
-[pr_reviewer]
-enable_auto_approval = true
-```
-(this specific flag cannot be set with a command line argument, only in the configuration file, committed to the repository)
-
-
-After enabling, by commenting on a PR:
-```
-/review auto_approve
-```
-PR-Agent will automatically approve the PR, and add a comment with the approval.
-
-
-You can also enable auto-approval only if the PR meets certain requirements, such as that the `estimated_review_effort` label is equal or below a certain threshold, by adjusting the flag:
-```
-[pr_reviewer]
-maximal_review_effort = 5
-```
diff --git a/docs/TOOLS_GUIDE.md b/docs/TOOLS_GUIDE.md
deleted file mode 100644
index a993e0ef..00000000
--- a/docs/TOOLS_GUIDE.md
+++ /dev/null
@@ -1,15 +0,0 @@
-## Tools Guide
-- [DESCRIBE](./DESCRIBE.md)
-- [REVIEW](./REVIEW.md)
-- [IMPROVE](./IMPROVE.md)
-- [ASK](./ASK.md)
-- [SIMILAR_ISSUE](./SIMILAR_ISSUE.md)
-- [UPDATE CHANGELOG](./UPDATE_CHANGELOG.md)
-- [CUSTOM SUGGESTIONS](./CUSTOM_SUGGESTIONS.md) 💎
-- [ADD DOCUMENTATION](./ADD_DOCUMENTATION.md) 💎
-- [GENERATE CUSTOM LABELS](./GENERATE_CUSTOM_LABELS.md) 💎
-- [Analyze](./Analyze.md) 💎
-- [Test](./TEST.md) 💎
-- [CI Feedback](./CI_FEEDBACK.md) 💎
-
-See the **[installation guide](/INSTALL.md)** for instructions on setting up PR-Agent.
diff --git a/docs/docs/CNAME b/docs/docs/CNAME
new file mode 100644
index 00000000..1cbf9740
--- /dev/null
+++ b/docs/docs/CNAME
@@ -0,0 +1 @@
+pr-agent-docs.codium.ai
diff --git a/docs/docs/assets/favicon.ico b/docs/docs/assets/favicon.ico
new file mode 100644
index 00000000..fece6b1e
Binary files /dev/null and b/docs/docs/assets/favicon.ico differ
diff --git a/docs/docs/assets/logo.png b/docs/docs/assets/logo.png
new file mode 100644
index 00000000..4c9fec1d
Binary files /dev/null and b/docs/docs/assets/logo.png differ
diff --git a/PR_COMPRESSION.md b/docs/docs/core-abilities/index.md
similarity index 81%
rename from PR_COMPRESSION.md
rename to docs/docs/core-abilities/index.md
index 101874c0..074d4c09 100644
--- a/PR_COMPRESSION.md
+++ b/docs/docs/core-abilities/index.md
@@ -1,42 +1,52 @@
-# PR Compression Strategy
+## PR Compression Strategy
There are two scenarios:
+
1. The PR is small enough to fit in a single prompt (including system and user prompt)
2. The PR is too large to fit in a single prompt (including system and user prompt)
For both scenarios, we first use the following strategy
-#### Repo language prioritization strategy
+#### Repo language prioritization strategy
We prioritize the languages of the repo based on the following criteria:
+
1. Exclude binary files and non code files (e.g. images, pdfs, etc)
2. Given the main languages used in the repo
-2. We sort the PR files by the most common languages in the repo (in descending order):
+3. We sort the PR files by the most common languages in the repo (in descending order):
* ```[[file.py, file2.py],[file3.js, file4.jsx],[readme.md]]```
-## Small PR
+### Small PR
In this case, we can fit the entire PR in a single prompt:
1. Exclude binary files and non code files (e.g. images, pdfs, etc)
2. We Expand the surrounding context of each patch to 3 lines above and below the patch
-## Large PR
-### Motivation
+### Large PR
+
+#### Motivation
Pull Requests can be very long and contain a lot of information with varying degree of relevance to the pr-agent.
We want to be able to pack as much information as possible in a single LMM prompt, while keeping the information relevant to the pr-agent.
-
-
#### Compression strategy
We prioritize additions over deletions:
- Combine all deleted files into a single list (`deleted files`)
- File patches are a list of hunks, remove all hunks of type deletion-only from the hunks in the file patch
+
#### Adaptive and token-aware file patch fitting
We use [tiktoken](https://github.com/openai/tiktoken) to tokenize the patches after the modifications described above, and we use the following strategy to fit the patches into the prompt:
-1. Within each language we sort the files by the number of tokens in the file (in descending order):
- * ```[[file2.py, file.py],[file4.jsx, file3.js],[readme.md]]```
-2. Iterate through the patches in the order described above
-2. Add the patches to the prompt until the prompt reaches a certain buffer from the max token length
-3. If there are still patches left, add the remaining patches as a list called `other modified files` to the prompt until the prompt reaches the max token length (hard stop), skip the rest of the patches.
-4. If we haven't reached the max token length, add the `deleted files` to the prompt until the prompt reaches the max token length (hard stop), skip the rest of the patches.
-### Example
+1. Within each language we sort the files by the number of tokens in the file (in descending order):
+ - ```[[file2.py, file.py],[file4.jsx, file3.js],[readme.md]]```
+2. Iterate through the patches in the order described above
+3. Add the patches to the prompt until the prompt reaches a certain buffer from the max token length
+4. If there are still patches left, add the remaining patches as a list called `other modified files` to the prompt until the prompt reaches the max token length (hard stop), skip the rest of the patches.
+5. If we haven't reached the max token length, add the `deleted files` to the prompt until the prompt reaches the max token length (hard stop), skip the rest of the patches.
+
+#### Example
+
+
+## YAML Prompting
+TBD
+
+## Static Code Analysis 💎
+TBD
diff --git a/docs/docs/css/custom.css b/docs/docs/css/custom.css
new file mode 100644
index 00000000..0e9b26fe
--- /dev/null
+++ b/docs/docs/css/custom.css
@@ -0,0 +1,98 @@
+
+
+:root {
+ --md-primary-fg-color: #765bfa;
+ --md-accent-fg-color: #AEA1F1;
+ }
+.md-nav__title, .md-nav__link {
+ font-size: 16px; /* Adjust the font size as needed */
+}
+
+.md-tabs__link {
+ font-size: 16px; /* Adjust the font size as needed */
+}
+
+.md-header__title {
+ font-size: 20px; /* Adjust the font size as needed */
+}
+
+/*
+@media (prefers-color-scheme: light) {
+ body {
+ --md-primary-fg-color: #00ffee !important;
+ --md-primary-bg-color: #ff0000 !important;
+ }
+
+ body, .md-main, .md-content {
+ background-color: #4312f5 !important;
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+ body {
+ --md-primary-fg-color: #171518 !important;
+ --md-primary-bg-color: #171518 !important;
+ }
+
+ body, .md-main, .md-content {
+ background-color: #171518 !important;
+ }
+
+ .md-header__title {
+ color: #ffffff !important;
+ }
+
+ .md-tabs .md-tabs__link {
+ color: #ffffff !important;
+ }
+
+ .md-tabs .md-tabs__link:hover,
+ .md-tabs .md-tabs__link:focus {
+ color: #ffffff !important;
+ }
+
+ .md-header__button {
+ color: #ffffff !important;
+ }
+
+ .md-header__button svg {
+ fill: currentColor !important;
+ }
+
+ .md-header__button:hover,
+ .md-header__button:focus {
+ color: #ffffff !important;
+ }
+
+ .md-header__button:hover svg,
+ .md-header__button:focus svg {
+ fill: currentColor !important;
+ }
+
+ .md-search__icon svg {
+ fill: #ffffff !important;
+ }
+
+ .md-search__input {
+ color: #ffffff !important;
+ }
+
+ .md-nav__item--active > .md-nav__link--active,
+ .md-nav__link--active {
+ color: #AEA1F1 !important;
+ }
+
+ .md-nav--secondary .md-nav__title {
+ background: #171518;
+ box-shadow: 0 0 0.4rem 0.4rem #171518;
+ }
+
+ .md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link {
+ background: #171518;
+ box-shadow: 0 0 0.4rem 0.4rem #171518;
+ }
+
+ .md-content a {
+ color: #AEA1F1 !important;
+ }
+} */
\ No newline at end of file
diff --git a/docs/docs/index.md b/docs/docs/index.md
new file mode 100644
index 00000000..48de1a88
--- /dev/null
+++ b/docs/docs/index.md
@@ -0,0 +1,176 @@
+# Overview
+
+CodiumAI PR-Agent is an open-source tool to help efficiently review and handle pull requests.
+
+- See the [Installation Guide](./installation/index.md) for instructions on installing and running the tool on different git platforms.
+
+- See the [Usage Guide](./usage-guide/index.md) for instructions on running the PR-Agent commands via different interfaces, including _CLI_, _online usage_, or by _automatically triggering_ them when a new PR is opened.
+
+- See the [Tools Guide](./tools/index.md) for a detailed description of the different tools (tools are run via the commands).
+
+
+## Features table
+PR-Agent offers extensive pull request functionalities across various git providers.
+
+| | | GitHub | Gitlab | Bitbucket | Azure DevOps |
+|-------|---------------------------------------------------------------------------------------------------------------------|:------:|:------:|:---------:|:------------:|
+| TOOLS | Review | ✔️ | ✔️ | ✔️ | ✔️ |
+| | ⮑ Incremental | ✔️ | | | |
+| | ⮑ [SOC2 Compliance](./tools/review.md#soc2-ticket-compliance-💎){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Ask | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Describe | ✔️ | ✔️ | ✔️ | ✔️ |
+| | ⮑ [Inline file summary](./tools/describe.md#inline-file-summary-💎){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Improve | ✔️ | ✔️ | ✔️ | ✔️ |
+| | ⮑ Extended | ✔️ | ✔️ | ✔️ | ✔️ |
+| | [Custom Suggestions](./tools/custom_suggestions.md){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Reflect and Review | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Update CHANGELOG.md | ✔️ | ✔️ | ✔️ | ️ |
+| | Find Similar Issue | ✔️ | | | ️ |
+| | [Add PR Documentation](./tools/documentation.md){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+| | [Generate Custom Labels](./tools/describe.md#handle-custom-labels-from-the-repos-labels-page-💎){:target="_blank"} 💎 | ✔️ | ✔️ | | ✔️ |
+| | [Analyze PR Components](./tools/analyze.md){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+| | | | | | ️ |
+| USAGE | CLI | ✔️ | ✔️ | ✔️ | ✔️ |
+| | App / webhook | ✔️ | ✔️ | | ✔️ |
+| | Tagging bot | ✔️ | | | ✔️ |
+| | Actions | ✔️ | | | ️ |
+| | | | | |
+| CORE | PR compression | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Repo language prioritization | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Adaptive and token-aware file patch fitting | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Multiple models support | ✔️ | ✔️ | ✔️ | ✔️ |
+| | Incremental PR review | ✔️ | | | |
+| | [Static code analysis](./tools/analyze.md/){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+| | [Multiple configuration options](./usage-guide/configuration_options.md){:target="_blank"} 💎 | ✔️ | ✔️ | ✔️ | ✔️ |
+
+💎 marks a feature available only in [PR-Agent Pro](https://www.codium.ai/pricing/){:target="_blank"}
+
+
+## Example results
+
+
+
+
+
+
+
+
+
+
+
+
+
)
+
+[//]: # (
)
+
+[//]: # (
)
+
+[//]: # (
)
+
+[//]: # (
)
+
+[//]: # (
)
+
+[//]: # (
-___
+
-___
+
-Notes
+
+**Notes**
+
- Language that are currently supported: Python, Java, C++, JavaScript, TypeScript.
\ No newline at end of file
diff --git a/docs/ASK.md b/docs/docs/tools/ask.md
similarity index 93%
rename from docs/ASK.md
rename to docs/docs/tools/ask.md
index d87938a1..e6e02160 100644
--- a/docs/ASK.md
+++ b/docs/docs/tools/ask.md
@@ -1,4 +1,4 @@
-# ASK Tool
+## Overview
The `ask` tool answers questions about the PR, based on the PR code changes. Make sure to be specific and clear in your questions.
It can be invoked manually by commenting on any PR:
@@ -6,13 +6,13 @@ It can be invoked manually by commenting on any PR:
/ask "..."
```
For example:
-___
+
-___
+
-___
## Ask lines
+
You can run `/ask` on specific lines of code in the PR from the PR's diff view. The tool will answer questions based on the code changes in the selected lines.
- Click on the '+' sign next to the line number to select the line.
- To select multiple lines, click on the '+' sign of the first line and then hold and drag to select the rest of the lines.
@@ -20,5 +20,4 @@ You can run `/ask` on specific lines of code in the PR from the PR's diff view.
-
-Note that the tool does not have "memory" of previous questions, and answers each question independently.
\ No newline at end of file
+Note that the tool does not have "memory" of previous questions, and answers each question independently.
diff --git a/docs/CI_FEEDBACK.md b/docs/docs/tools/ci_feedback.md
similarity index 97%
rename from docs/CI_FEEDBACK.md
rename to docs/docs/tools/ci_feedback.md
index ee92a64f..2949f138 100644
--- a/docs/CI_FEEDBACK.md
+++ b/docs/docs/tools/ci_feedback.md
@@ -1,7 +1,8 @@
-# CI Feedback Tool
+## Overview
The CI feedback tool (`/checks)` automatically triggers when a PR has a failed check.
The tool analyzes the failed checks and provides several feedbacks:
+
- Failed stage
- Failed test name
- Failure summary
@@ -10,7 +11,6 @@ The tool analyzes the failed checks and provides several feedbacks:
-
→
@@ -24,7 +24,7 @@ In addition to being automatically triggered, the tool can also be invoked manua
```
where `{repo_name}` is the name of the repository, `{run_number}` is the run number of the failed check, and `{job_number}` is the job number of the failed check.
-### Configuration options
+## Configuration options
- `enable_auto_checks_feedback` - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
- `excluded_checks_list` - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
- `persistent_comment` - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
diff --git a/docs/GENERATE_CUSTOM_LABELS.md b/docs/docs/tools/custom_labels.md
similarity index 86%
rename from docs/GENERATE_CUSTOM_LABELS.md
rename to docs/docs/tools/custom_labels.md
index 61837ff1..d8dbb1a1 100644
--- a/docs/GENERATE_CUSTOM_LABELS.md
+++ b/docs/docs/tools/custom_labels.md
@@ -1,4 +1,4 @@
-# Generate Custom Labels 💎
+## Overview
The `generate_labels` tool scans the PR code changes, and given a list of labels and their descriptions, it automatically suggests labels that match the PR code changes.
It can be invoked manually by commenting on any PR:
@@ -12,6 +12,7 @@ If we wish to add detect changes to SQL queries in a given PR, we can add the fo
When running the `generate_labels` tool on a PR that includes changes in SQL queries, it will automatically suggest the custom label:
+
Note that in addition to the dedicated tool `generate_labels`, the custom labels will also be used by the `describe` tool.
@@ -20,13 +21,14 @@ Note that in addition to the dedicated tool `generate_labels`, the custom labels
There are 3 ways to enable custom labels:
#### 1. CLI (local configuration file)
-When working from CLI, you need to apply the [configuration changes](#configuration-changes) to the [custom_labels file](./../pr_agent/settings/custom_labels.toml):
+When working from CLI, you need to apply the [configuration changes](#configuration-options) to the [custom_labels file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/custom_labels.toml):
#### 2. Repo configuration file
-To enable custom labels, you need to apply the [configuration changes](#configuration-changes) to the local `.pr_agent.toml` file in you repository.
+To enable custom labels, you need to apply the [configuration changes](#configuration-options) to the local `.pr_agent.toml` file in you repository.
-#### 3. Handle custom labels from the Repo's labels page
+#### 3. Handle custom labels from the Repo's labels page 💎
> This feature is available only in PR-Agent Pro
+
* GitHub : `https://github.com/{owner}/{repo}/labels`, or click on the "Labels" tab in the issues or PRs page.
* GitLab : `https://gitlab.com/{owner}/{repo}/-/labels`, or click on "Manage" -> "Labels" on the left menu.
@@ -38,9 +40,9 @@ The description should be comprehensive and detailed, indicating when to add the
c. Now the custom labels will be included in the `generate_labels` tool.
-*This feature is supported in GitHub and GitLab.
+> This feature is supported in GitHub and GitLab.
-#### Configuration changes
+## Configuration options
- Change `enable_custom_labels` to True: This will turn off the default labels and enable the custom labels provided in the custom_labels.toml file.
- Add the custom labels. It should be formatted as follows:
@@ -53,5 +55,4 @@ description = "Description of when AI should suggest this label"
[custom_labels."Custom Label 2"]
description = "Description of when AI should suggest this label 2"
-```
-
+```
\ No newline at end of file
diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/docs/tools/custom_suggestions.md
similarity index 78%
rename from docs/CUSTOM_SUGGESTIONS.md
rename to docs/docs/tools/custom_suggestions.md
index 1be9dfb4..0b19ecef 100644
--- a/docs/CUSTOM_SUGGESTIONS.md
+++ b/docs/docs/tools/custom_suggestions.md
@@ -1,16 +1,8 @@
-# Custom Suggestions Tool 💎
-
-## Table of Contents
-- [Overview](#overview)
-- [Example usage](#example-usage)
-- [Configuration options](#configuration-options)
-
-
## Overview
The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code.
It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestions that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration.
-The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on a PR.
+The tool can be triggered [automatically](../usage-guide/automations_and_usage.md#github-app-automatic-tools-when-a-new-pr-is-opened) every time a new PR is opened, or can be invoked manually by commenting on a PR.
When commenting, use the following template:
@@ -18,7 +10,7 @@ When commenting, use the following template:
/custom_suggestions --pr_custom_suggestions.prompt="The suggestions should focus only on the following:\n-...\n-...\n-..."
```
-With a [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-app), use the following template:
+With a [configuration file](../usage-guide/automations_and_usage.md#github-app), use the following template:
```
[pr_custom_suggestions]
@@ -50,11 +42,11 @@ The suggestions should focus only on the following:
The instructions above are just an example. We want to emphasize that the prompt should be specific and clear, and be tailored to the needs of your project.
Results obtained with the prompt above:
-___
+
-___
+
-___
+
## Configuration options
@@ -62,4 +54,4 @@ ___
`num_code_suggestions`: number of code suggestions provided by the 'custom_suggestions' tool. Default is 4.
-`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true.
+`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true.
\ No newline at end of file
diff --git a/docs/DESCRIBE.md b/docs/docs/tools/describe.md
similarity index 85%
rename from docs/DESCRIBE.md
rename to docs/docs/tools/describe.md
index 2490180e..bb676f86 100644
--- a/docs/DESCRIBE.md
+++ b/docs/docs/tools/describe.md
@@ -1,35 +1,26 @@
-# Describe Tool
-## Table of Contents
-- [Overview](#overview)
- - [Configuration options](#configuration-options)
- - [Inline file summary 💎](#inline-file-summary-)
- - [Handle custom labels from the Repo's labels page :gem:](#handle-custom-labels-from-the-repos-labels-page-gem)
- - [Markers template](#markers-template)
-- [Usage Tips](#usage-tips)
- - [Automation](#automation)
- - [Custom labels](#custom-labels)
-
## Overview
The `describe` tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels.
-The tool can be triggered automatically every time a new PR is [opened](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools), or it can be invoked manually by commenting on any PR:
+The tool can be triggered automatically every time a new PR is [opened](../usage-guide/automations_and_usage.md#github-app-automatic-tools-when-a-new-pr-is-opened), or it can be invoked manually by commenting on any PR:
```
/describe
```
For example:
-___
+
-___
+
-___
+
+
-### Configuration options
-To edit [configurations](./../pr_agent/settings/configuration.toml#L46) related to the describe tool (`pr_description` section), use the following template:
+## Configuration options
+To edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L46) related to the describe tool (`pr_description` section), use the following template:
```
/describe --pr_description.some_config1=... --pr_description.some_config2=...
```
-**Possible configurations:**
+### Possible configurations:
+
- `publish_labels`: if set to true, the tool will publish the labels to the PR. Default is true.
- `publish_description_as_comment`: if set to true, the tool will publish the description as a comment to the PR. If false, it will overwrite the origianl description. Default is false.
@@ -40,7 +31,7 @@ To edit [configurations](./../pr_agent/settings/configuration.toml#L46) related
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
-- To enable `custom labels`, apply the configuration changes described [here](./GENERATE_CUSTOM_LABELS.md#configuration-changes)
+- To enable `custom labels`, apply the configuration changes described [here](./custom_labels.md#configuration-options)
- `enable_pr_type`: if set to false, it will not show the `PR type` as a text value in the description content. Default is true.
@@ -68,10 +59,10 @@ If you prefer to have the file summaries appear in the "Files changed" tab on ev
- `false` (`default`): File changes walkthrough will be added only to the "Conversation" tab.
-Note that this feature is currently available only for GitHub.
+**Note** that this feature is currently available only for GitHub.
-### Handle custom labels from the Repo's labels page :gem:
+### Handle custom labels from the Repo's labels page 💎
> This feature is available only in PR-Agent Pro
You can control the custom labels that will be suggested by the `describe` tool, from the repo's labels page:
@@ -88,6 +79,7 @@ The description should be comprehensive and detailed, indicating when to add the
### Markers template
+
To enable markers, set `pr_description.use_description_markers=true`.
Markers enable to easily integrate user's content and auto-generated content, with a template-like mechanism.
@@ -107,22 +99,19 @@ pr_agent:walkthrough
The marker `pr_agent:type` will be replaced with the PR type, `pr_agent:summary` will be replaced with the PR summary, and `pr_agent:walkthrough` will be replaced with the PR walkthrough.
-
-==>
-
+→
-**Configuration params:**
+### Configuration params:
- `use_description_markers`: if set to true, the tool will use markers template. It replaces every marker of the form `pr_agent:marker_name` with the relevant content. Default is false.
- `include_generated_by_header`: if set to true, the tool will add a dedicated header: 'Generated by PR Agent at ...' to any automatic content. Default is true.
## Usage Tips
-1) [Automation](#automation)
-2) [Custom labels](#custom-labels)
+
### Automation
-- When you first install the app, the [default mode](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) for the describe tool is:
+- When you first install the app, the [default mode](../usage-guide/automations_and_usage.md#github-app) for the describe tool is:
```
pr_commands = ["/describe --pr_description.add_original_user_description=true"
"--pr_description.keep_original_user_title=true", ...]
@@ -148,9 +137,10 @@ the tool will replace every marker of the form `pr_agent:marker_name` in the PR
Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.
### Custom labels
+
The default labels of the describe tool are quite generic, since they are meant to be used in any repo: [`Bug fix`, `Tests`, `Enhancement`, `Documentation`, `Other`].
-If you specify [custom labels](#handle-custom-labels-from-the-repos-labels-page-gem) in the repo's labels page, you can get tailored labels for your use cases.
+If you specify [custom labels](#handle-custom-labels-from-the-repos-labels-page) in the repo's labels page, you can get tailored labels for your use cases.
Examples for custom labels:
- `Main topic:performance` - pr_agent:The main topic of this PR is performance
- `New endpoint` - pr_agent:A new endpoint was added in this PR
@@ -160,4 +150,4 @@ Examples for custom labels:
The list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
-
-___
+
-___
+
-### Configuration options
+## Configuration options
- `docs_style`: The exact style of the documentation (for python docstring). you can choose between: `google`, `numpy`, `sphinx`, `restructuredtext`, `plain`. Default is `sphinx`.
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
-Notes
+**Notes**
+
- Language that are currently fully supported: Python, Java, C++, JavaScript, TypeScript.
- For languages that are not fully supported, the tool will suggest documentation only for new components in the PR.
-- A previous version of the tool, that offered support only for new components, was deprecated.
-
+- A previous version of the tool, that offered support only for new components, was deprecated.
\ No newline at end of file
diff --git a/docs/IMPROVE.md b/docs/docs/tools/improve.md
similarity index 74%
rename from docs/IMPROVE.md
rename to docs/docs/tools/improve.md
index 315f4ba0..b4f16d17 100644
--- a/docs/IMPROVE.md
+++ b/docs/docs/tools/improve.md
@@ -1,16 +1,6 @@
-# Improve Tool
-
-## Table of Contents
-- [Overview](#overview)
- - [Configuration options](#configuration-options)
-- [Usage Tips](#usage-tips)
- - [Extra instructions](#extra-instructions)
- - [PR footprint - regular vs summarize mode](#pr-footprint---regular-vs-summarize-mode)
- - [A note on code suggestions quality](#a-note-on-code-suggestions-quality)
-
## Overview
The `improve` tool scans the PR code changes, and automatically generates suggestions for improving the PR code.
-The tool can be triggered automatically every time a new PR is [opened](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools), or it can be invoked manually by commenting on any PR:
+The tool can be triggered automatically every time a new PR is [opened](../usage-guide/automations_and_usage.md#github-app-automatic-tools-when-a-new-pr-is-opened), or it can be invoked manually by commenting on any PR:
```
/improve
```
@@ -18,15 +8,14 @@ The tool can be triggered automatically every time a new PR is [opened](https://
### Summarized vs committable code suggestions
The code suggestions can be presented as a single comment (via `pr_code_suggestions.summarize=true`):
-___
+
-___
+
Or as a separate commitable code comment for each suggestion:
-___
+
----
Note that a single comment has a significantly smaller PR footprint. We recommend this mode for most cases.
Also note that collapsible are not supported in _Bitbucket_. Hence, the suggestions are presented there as code comments.
@@ -49,18 +38,21 @@ Hence, the total number of suggestions is proportional to the number of chunks,
### Configuration options
-To edit [configurations](./../pr_agent/settings/configuration.toml#L66) related to the improve tool (`pr_code_suggestions` section), use the following template:
+To edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L66) related to the improve tool (`pr_code_suggestions` section), use the following template:
```
/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
```
-#### General options
+### General options
+
- `num_code_suggestions`: number of code suggestions provided by the 'improve' tool. Default is 4.
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
- `rank_suggestions`: if set to true, the tool will rank the suggestions, based on importance. Default is false.
- `summarize`: if set to true, the tool will display the suggestions in a single comment. Default is false.
- `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true.
-#### params for '/improve --extended' mode
+
+### params for '/improve --extended' mode
+
- `auto_extended_mode`: enable extended mode automatically (no need for the `--extended` option). Default is true.
- `num_code_suggestions_per_chunk`: number of code suggestions provided by the 'improve' tool, per chunk. Default is 8.
- `rank_extended_suggestions`: if set to true, the tool will rank the suggestions, based on importance. Default is true.
@@ -71,6 +63,7 @@ To edit [configurations](./../pr_agent/settings/configuration.toml#L66) related
## Usage Tips
### Extra instructions
+
Extra instructions are very important for the `imrpove` tool, since they enable you to guide the model to suggestions that are more relevant to the specific needs of the project.
Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Specify relevant aspects that you want the model to focus on.
@@ -91,7 +84,6 @@ Use triple quotes to write multi-line instructions. Use bullet points to make th
### A note on code suggestions quality
- While the current AI for code is getting better and better (GPT-4), it's not flawless. Not all the suggestions will be perfect, and a user should not accept all of them automatically.
-- Suggestions are not meant to be [simplistic](./../pr_agent/settings/pr_code_suggestions_prompts.toml#L34). Instead, they aim to give deep feedback and raise questions, ideas and thoughts to the user, who can then use his judgment, experience, and understanding of the code base.
+- Suggestions are not meant to be [simplistic](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/pr_code_suggestions_prompts.toml#L34). Instead, they aim to give deep feedback and raise questions, ideas and thoughts to the user, who can then use his judgment, experience, and understanding of the code base.
- Recommended to use the `exra_instructions` field to guide the model to suggestions that are more relevant to the specific needs of the project.
-- Consider also trying the [Custom Suggestions Tool](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) 💎, that will **only** propose suggestions that follow specific guidelines defined by user.
-
+- Consider also trying the [Custom Suggestions Tool](./custom_suggestions.md) 💎, that will **only** propose suggestions that follow specific guidelines defined by user.
\ No newline at end of file
diff --git a/docs/docs/tools/index.md b/docs/docs/tools/index.md
new file mode 100644
index 00000000..bcd9ed9d
--- /dev/null
+++ b/docs/docs/tools/index.md
@@ -0,0 +1,20 @@
+# Tools
+
+Here is a list of PR-Agent tools, each with a dedicated page that explains how to use it:
+
+| Tool | Description |
+|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
+| **[PR Description (`/describe`](./describe.md))** | Automatically generating PR description - title, type, summary, code walkthrough and labels |
+| **[PR Review (`/review`](./review.md))** | Adjustable feedback about the PR, possible issues, security concerns, review effort and more |
+| **[Code Suggestions (`/improve`](./improve.md))** | Code suggestions for improving the PR |
+| **[Question Answering (`/ask ...`](./ask.md))** | Answering free-text questions about the PR, or on specific code lines |
+| **[Update Changelog (`/update_changelog`](./update_changelog.md))** | Automatically updating the CHANGELOG.md file with the PR changes |
+| **[Find Similar Issue (`/similar_issue`](./similar_issues.md))** | Automatically retrieves and presents similar issues |
+| **💎 [Add Documentation (`/add_docs`](./documentation.md))** | Generates documentation to methods/functions/classes that changed in the PR |
+| **💎 [Generate Custom Labels (`/generate_labels`](./custom_labels.md))** | Generates custom labels for the PR, based on specific guidelines defined by the user |
+| **💎 [Analyze (`/analyze`](./analyze.md))** | Identify code components that changed in the PR, and enables to interactively generate tests, docs, and code suggestions for each component |
+| **💎 [Custom Suggestions (`/custom_suggestions`](./custom_suggestions.md))** | Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user |
+| **💎 [Generate Tests (`/test component_name`](./test.md))** | Automatically generates unit tests for a selected component, based on the PR code changes |
+| **💎 [CI Feedback (`/checks ci_job`](./ci_feedback.md))** | Automatically generates feedback and analysis for a failed CI job |
+
+Note that the tools marked with 💎 are available only for PR-Agent Pro users.
\ No newline at end of file
diff --git a/docs/docs/tools/similar_code.md b/docs/docs/tools/similar_code.md
new file mode 100644
index 00000000..262e39c9
--- /dev/null
+++ b/docs/docs/tools/similar_code.md
@@ -0,0 +1,43 @@
+## Overview
+The similar code tool retrieves the most similar code components from inside the organization's codebase, or from open-source code.
+
+For example:
+
+`Global Search` for a method called `chat_completion`:
+
+
+
+PR-Agent will examine the code component and will extract the most relevant keywords to search for similar code:
+
+- `extracted keywords`: the keywords that were extracted from the code by PR-Agent. the link will open a search page with the extracted keywords, to allow the user to modify the search if needed.
+- `search context`: the context in which the search will be performed, organization's codebase or open-source code (Global).
+- `similar code`: the most similar code components found. the link will open the code component in the relevant file.
+- `relevant repositories`: the open-source repositories in which that are relevant to the searched code component and it's keywords.
+
+Search result link example:
+
+
+
+`Organization Search`:
+
+
+
+
+## How to use
+It can be invoked automatically from the analyze table, can be accessed by:
+```
+/analyze
+```
+Choose the components you want to find similar code for, and click on the `similar` checkbox.
+
+
+If you are looking to search for similar code in the organization's codebase, you can click on the `Organization` checkbox, and it will invoke a new search command just for the organization's codebase.
+
+
+
+
+## Configuration options
+
+- `search_from_org`: if set to true, the tool will search for similar code in the organization's codebase. Default is false.
+- `number_of_keywords`: number of keywords to use for the search. Default is 5.
+- `number_of_results`: the maximum number of results to present. Default is 5.
diff --git a/docs/SIMILAR_ISSUE.md b/docs/docs/tools/similar_issues.md
similarity index 93%
rename from docs/SIMILAR_ISSUE.md
rename to docs/docs/tools/similar_issues.md
index 2fcd393b..3d492c0a 100644
--- a/docs/SIMILAR_ISSUE.md
+++ b/docs/docs/tools/similar_issues.md
@@ -1,4 +1,4 @@
-# Similar Issue Tool
+## Overview
The similar issue tool retrieves the most similar issues to the current issue.
It can be invoked manually by commenting on any PR:
```
@@ -7,7 +7,9 @@ It can be invoked manually by commenting on any PR:
For example:
+
+
Note that to perform retrieval, the `similar_issue` tool indexes all the repo previous issues (once).
@@ -29,11 +31,11 @@ environment = "..."
These parameters can be obtained by registering to [Pinecone](https://app.pinecone.io/?sessionType=signup/).
-### How to use:
+## How to use:
- To invoke the 'similar issue' tool from **CLI**, run:
`python3 cli.py --issue_url=... similar_issue`
- To invoke the 'similar' issue tool via online usage, [comment](https://github.com/Codium-ai/pr-agent/issues/178#issuecomment-1716934893) on a PR:
`/similar_issue`
-- You can also enable the 'similar issue' tool to run automatically when a new issue is opened, by adding it to the [pr_commands list in the github_app section](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L66)
+- You can also enable the 'similar issue' tool to run automatically when a new issue is opened, by adding it to the [pr_commands list in the github_app section](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L66)
\ No newline at end of file
diff --git a/docs/TEST.md b/docs/docs/tools/test.md
similarity index 87%
rename from docs/TEST.md
rename to docs/docs/tools/test.md
index 4f88c359..a45f6faf 100644
--- a/docs/TEST.md
+++ b/docs/docs/tools/test.md
@@ -1,26 +1,26 @@
-# Test Tool 💎
+## Overview
By combining LLM abilities with static code analysis, the `test` tool generate tests for a selected component, based on the PR code changes.
It can be invoked manually by commenting on any PR:
```
/test component_name
```
where 'component_name' is the name of a specific component in the PR.
-To get a list of the components that changed in the PR, use the [`analyze`](https://github.com/Codium-ai/pr-agent/blob/main/docs/Analyze.md) tool.
+To get a list of the components that changed in the PR, use the [`analyze`](./analyze.md) tool.
An example [result](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429):
-___
+
-___
+
-Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript.
+**Notes**
+- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript.
-
-### Configuration options
+## Configuration options
- `num_tests`: number of tests to generate. Default is 3.
- `testing_framework`: the testing framework to use. If not set, for Python it will use `pytest`, for Java it will use `JUnit`, for C++ it will use `Catch2`, and for JavaScript and TypeScript it will use `jest`.
- `avoid_mocks`: if set to true, the tool will try to avoid using mocks in the generated tests. Note that even if this option is set to true, the tool might still use mocks if it cannot generate a test without them. Default is true.
diff --git a/docs/UPDATE_CHANGELOG.md b/docs/docs/tools/update_changelog.md
similarity index 78%
rename from docs/UPDATE_CHANGELOG.md
rename to docs/docs/tools/update_changelog.md
index dee448f2..4c423a3e 100644
--- a/docs/UPDATE_CHANGELOG.md
+++ b/docs/docs/tools/update_changelog.md
@@ -1,5 +1,4 @@
-# Update Changelog Tool
-
+## Overview
The `update_changelog` tool automatically updates the CHANGELOG.md file with the PR changes.
It can be invoked manually by commenting on any PR:
```
@@ -8,12 +7,13 @@ It can be invoked manually by commenting on any PR:
For example:
+
-### Configuration options
+## Configuration options
-Under the section 'pr_update_changelog', the [configuration file](./../pr_agent/settings/configuration.toml#L50) contains options to customize the 'update changelog' tool:
+Under the section 'pr_update_changelog', the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'update changelog' tool:
- `push_changelog_changes`: whether to push the changes to CHANGELOG.md, or just print them. Default is false (print only).
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...
\ No newline at end of file
diff --git a/docs/docs/usage-guide/additional_configurations.md b/docs/docs/usage-guide/additional_configurations.md
new file mode 100644
index 00000000..4a6224bd
--- /dev/null
+++ b/docs/docs/usage-guide/additional_configurations.md
@@ -0,0 +1,218 @@
+## Ignoring files from analysis
+
+In some cases, you may want to exclude specific files or directories from the analysis performed by CodiumAI PR-Agent. This can be useful, for example, when you have files that are generated automatically or files that shouldn't be reviewed, like vendored code.
+
+To ignore files or directories, edit the **[ignore.toml](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/ignore.toml)** configuration file. This setting also exposes the following environment variables:
+
+ - `IGNORE.GLOB`
+ - `IGNORE.REGEX`
+
+For example, to ignore python files in a PR with online usage, comment on a PR:
+`/review --ignore.glob=['*.py']`
+
+To ignore python files in all PRs, set in a configuration file:
+```
+[ignore]
+glob = ['*.py']
+```
+
+## Extra instructions
+
+All PR-Agent tools have a parameter called `extra_instructions`, that enables to add free-text extra instructions. Example usage:
+```
+/update_changelog --pr_update_changelog.extra_instructions="Make sure to update also the version ..."
+```
+
+## Working with large PRs
+
+The default mode of CodiumAI is to have a single call per tool, using GPT-4, which has a token limit of 8000 tokens.
+This mode provide a very good speed-quality-cost tradeoff, and can handle most PRs successfully.
+When the PR is above the token limit, it employs a [PR Compression strategy](../core-abilities/index.md).
+
+However, for very large PRs, or in case you want to emphasize quality over speed and cost, there are 2 possible solutions:
+1) [Use a model](https://codium-ai.github.io/Docs-PR-Agent/usage-guide/#changing-a-model) with larger context, like GPT-32K, or claude-100K. This solution will be applicable for all the tools.
+2) For the `/improve` tool, there is an ['extended' mode](https://codium-ai.github.io/Docs-PR-Agent/tools/#improve) (`/improve --extended`),
+which divides the PR to chunks, and process each chunk separately. With this mode, regardless of the model, no compression will be done (but for large PRs, multiple model calls may occur)
+
+
+## Changing a model
+
+See [here](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/algo/__init__.py) for the list of available models.
+To use a different model than the default (GPT-4), you need to edit [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L2).
+For models and environments not from OPENAI, you might need to provide additional keys and other parameters. See below for instructions.
+
+### Azure
+
+To use Azure, set in your `.secrets.toml` (working from CLI), or in the GitHub `Settings > Secrets and variables` (working from GitHub App or GitHub Action):
+```
+[openai]
+key = "" # your azure api key
+api_type = "azure"
+api_version = '2023-05-15' # Check Azure documentation for the current API version
+api_base = "" # The base URL for your Azure OpenAI resource. e.g. "https://
+
+Click [here](https://codium.ai/images/pr_agent/wiki_configuration_pr_agent.mp4) to see a short instructional video. We recommend surrounding the configuration content with triple-quotes, to allow better presentation when displayed in the wiki as markdown.
+An example content:
+
+```
+[pr_description] # /describe #
+keep_original_user_title=false
+```
+
+PR-Agent will know to remove the triple-quotes when reading the configuration content.
+
+## Local configuration file
+
+By uploading a local `.pr_agent.toml` file to the root of the repo's main branch, you can edit and customize any configuration parameter. Note that you need to upload `.pr_agent.toml` prior to creating a PR, in order for the configuration to take effect.
+
+For example, if you set in `.pr_agent.toml`:
+
+```
+[pr_reviewer]
+extra_instructions="""\
+- instruction a
+- instruction b
+...
+"""
+```
+
+Then you can give a list of extra instructions to the `review` tool.
+
+
+## Global configuration file 💎
+
+If you create a repo called `pr-agent-settings` in your **organization**, it's configuration file `.pr_agent.toml` will be used as a global configuration file for any other repo that belongs to the same organization.
+Parameters from a local `.pr_agent.toml` file, in a specific repo, will override the global configuration parameters.
+
+For example, in the GitHub organization `Codium-ai`:
+- The repo [`https://github.com/Codium-ai/pr-agent-settings`](https://github.com/Codium-ai/pr-agent-settings/blob/main/.pr_agent.toml) contains a `.pr_agent.toml` file that serves as a global configuration file for all the repos in the GitHub organization `Codium-ai`.
+- The repo [`https://github.com/Codium-ai/pr-agent`](https://github.com/Codium-ai/pr-agent/blob/main/.pr_agent.toml) inherits the global configuration file from `pr-agent-settings`.
\ No newline at end of file
diff --git a/docs/docs/usage-guide/index.md b/docs/docs/usage-guide/index.md
new file mode 100644
index 00000000..e784d1b0
--- /dev/null
+++ b/docs/docs/usage-guide/index.md
@@ -0,0 +1,20 @@
+# Usage guide
+
+- [Introduction](./introduction.md)
+- [Configuration Options](./configuration_options.md)
+- [Managing Mail Notifications](./mail_notifications.md)
+- [Usage and Automation](./automations_and_usage.md)
+ - [Local Repo (CLI)](./automations_and_usage.md#local-repo-cli)
+ - [Online Usage](./automations_and_usage.md#online-usage)
+ - [GitHub App](./automations_and_usage.md#github-app)
+ - [GitHub Action](./automations_and_usage.md#github-action)
+ - [GitLab Webhook](./automations_and_usage.md#gitlab-webhook)
+ - [BitBucket App](./automations_and_usage.md#bitbucket-app)
+ - [Azure DevOps Provider](./automations_and_usage.md#azure-devops-provider)
+- [Additional Configurations Walkthrough](./additional_configurations.md)
+ - [Ignoring files from analysis](./additional_configurations.md#ignoring-files-from-analysis)
+ - [Extra instructions](./additional_configurations.md#extra-instructions)
+ - [Working with large PRs](./additional_configurations.md#working-with-large-prs)
+ - [Changing a model](./additional_configurations.md#changing-a-model)
+ - [Patch Extra Lines](./additional_configurations.md#patch-extra-lines)
+ - [Editing the prompts](./additional_configurations.md#editing-the-prompts)
\ No newline at end of file
diff --git a/docs/docs/usage-guide/introduction.md b/docs/docs/usage-guide/introduction.md
new file mode 100644
index 00000000..c851edbe
--- /dev/null
+++ b/docs/docs/usage-guide/introduction.md
@@ -0,0 +1,18 @@
+
+After [installation](https://codium-ai.github.io/Docs-PR-Agent/installation/), there are three basic ways to invoke CodiumAI PR-Agent:
+
+1. Locally running a CLI command
+2. Online usage - by [commenting](https://github.com/Codium-ai/pr-agent/pull/229#issuecomment-1695021901) on a PR
+3. Enabling PR-Agent tools to run automatically when a new PR is opened
+
+
+Specifically, CLI commands can be issued by invoking a pre-built [docker image](https://codium-ai.github.io/Docs-PR-Agent/installation/#run-from-source), or by invoking a [locally cloned repo](https://codium-ai.github.io/Docs-PR-Agent/installation/#locally).
+For online usage, you will need to setup either a [GitHub App](https://codium-ai.github.io/Docs-PR-Agent/installation/#run-as-a-github-app), or a [GitHub Action](https://codium-ai.github.io/Docs-PR-Agent/installation/#run-as-a-github-action).
+GitHub App and GitHub Action also enable to run PR-Agent specific tool automatically when a new PR is opened.
+
+
+**git provider**: The [git_provider](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L4) field in the configuration file determines the GIT provider that will be used by PR-Agent. Currently, the following providers are supported:
+`
+"github", "gitlab", "bitbucket", "azure", "codecommit", "local", "gerrit"
+`
+
diff --git a/docs/docs/usage-guide/mail_notifications.md b/docs/docs/usage-guide/mail_notifications.md
new file mode 100644
index 00000000..1e5b2e8a
--- /dev/null
+++ b/docs/docs/usage-guide/mail_notifications.md
@@ -0,0 +1,9 @@
+
+Unfortunately, it is not possible in GitHub to disable mail notifications from a specific user.
+If you are subscribed to notifications for a repo with PR-Agent, we recommend turning off notifications for PR comments, to avoid lengthy emails:
+
+
+
+As an alternative, you can filter in your mail provider the notifications specifically from the PR-Agent bot, [see how](https://www.quora.com/How-can-you-filter-emails-for-specific-people-in-Gmail#:~:text=On%20the%20Filters%20and%20Blocked,the%20body%20of%20the%20email).
+
+
\ No newline at end of file
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
new file mode 100644
index 00000000..b71bf125
--- /dev/null
+++ b/docs/mkdocs.yml
@@ -0,0 +1,121 @@
+site_name: PR-Agent
+
+nav:
+ - Overview: 'index.md'
+ - Installation:
+ - 'installation/index.md'
+ - Locally: 'installation/locally.md'
+ - GitHub: 'installation/github.md'
+ - GitLab: 'installation/gitlab.md'
+ - BitBucket: 'installation/bitbucket.md'
+ - Azure DevOps: 'installation/azure.md'
+ - Usage Guide:
+ - 'usage-guide/index.md'
+ - Introduction: 'usage-guide/introduction.md'
+ - Configuration Options: 'usage-guide/configuration_options.md'
+ - Managing email notifications: 'usage-guide/mail_notifications.md'
+ - Usage and Automation: 'usage-guide/automations_and_usage.md'
+ - Additional Configurations: 'usage-guide/additional_configurations.md'
+ - Tools:
+ - 'tools/index.md'
+ - Describe: 'tools/describe.md'
+ - Review: 'tools/review.md'
+ - Improve: 'tools/improve.md'
+ - Ask: 'tools/ask.md'
+ - Update Changelog: 'tools/update_changelog.md'
+ - Similar Issues: 'tools/similar_issues.md'
+ - 💎 Analyze: 'tools/analyze.md'
+ - 💎 Test: 'tools/test.md'
+ - 💎 Documentation: 'tools/documentation.md'
+ - 💎 Custom Labels: 'tools/custom_labels.md'
+ - 💎 Custom Suggestions: 'tools/custom_suggestions.md'
+ - 💎 CI Feedback: 'tools/ci_feedback.md'
+ - 💎 Similar Code: 'tools/similar_code.md'
+ - Core Abilities: 'core-abilities/index.md'
+
+theme:
+ logo: assets/logo.png
+ favicon: assets/favicon.ico
+ name: material
+ features:
+ - navigation.tabs
+ - navigation.expand
+ - navigation.path
+ - navigation.top
+ - navigation.tracking
+ - navigation.indexes
+ - search.suggest
+ - search.highlight
+ - content.tabs.link
+ - content.code.annotation
+ - content.code.copy
+ - toc.integrate
+ language: en
+ custom_dir: overrides
+
+ palette:
+ - media: "(prefers-color-scheme)"
+ toggle:
+ icon: material/brightness-auto
+ name: Switch to light mode
+ - media: "(prefers-color-scheme: light)"
+ scheme: default
+ toggle:
+ icon: material/toggle-switch-off-outline
+ name: Switch to dark mode
+ primary: custom
+ accent: custom
+ - media: "(prefers-color-scheme: dark)"
+ scheme: slate
+ toggle:
+ icon: material/toggle-switch
+ name: Switch to light mode
+ primary: custom
+ accent: custom
+
+plugins:
+ - social
+ - search
+
+extra:
+ generator: false
+ social:
+ - icon: fontawesome/brands/github
+ link: https://github.com/Codium-ai
+ - icon: fontawesome/brands/discord
+ link: https://discord.com/invite/SgSxuQ65GF
+ - icon: fontawesome/brands/youtube
+ link: https://www.youtube.com/@Codium-AI
+ - icon: fontawesome/brands/linkedin
+ link: https://www.linkedin.com/company/codiumai
+ - icon: fontawesome/brands/twitter
+ link: https://twitter.com/CodiumAI
+ - icon: fontawesome/brands/instagram
+ link: https://www.instagram.com/codiumai/
+
+extra_css:
+ - css/custom.css
+
+markdown_extensions:
+ - pymdownx.highlight:
+ anchor_linenums: true
+ - pymdownx.inlinehilite
+ - pymdownx.snippets
+ - admonition
+ - pymdownx.arithmatex:
+ generic: true
+ - footnotes
+ - pymdownx.details
+ - pymdownx.superfences
+ - pymdownx.mark
+ - attr_list
+ - pymdownx.emoji:
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
+ emoji_generator: !!python/name:materialx.emoji.to_svg
+ - toc:
+ title: On this page
+ toc_depth: 3
+ permalink: true
+
+copyright: |
+ © 2024 CodiumAI
diff --git a/docs/overrides/partials/footer.html b/docs/overrides/partials/footer.html
new file mode 100644
index 00000000..96ba7e86
--- /dev/null
+++ b/docs/overrides/partials/footer.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+