Skip to content

Commit 09b9ee5

Browse files
committed
Rewrite the Quickstart as a full tutorial. Add a new Quickstart screenshot.
1 parent 221fccd commit 09b9ee5

File tree

2 files changed

+117
-33
lines changed

2 files changed

+117
-33
lines changed

Diff for: docs/getting-started/quickstart.md

+117-33
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,139 @@
11
---
2-
title: Playing with CodeRabbit
2+
title: Quickstart
33
sidebar_label: Quickstart
4-
description: Get started with CodeRabbit in less than 2 minutes
4+
description: Get started with CodeRabbit in less than 15 minutes
55
sidebar_position: 1
66
---
77

8-
# Quickstart Guide
8+
# Quickstart
9+
10+
This tutorial gives you a hands-on demonstration of CodeRabbit, using a real, GitHub-based repository. It guides you through the following tasks:
11+
12+
1. Integrate CodeRabbit into a GitHub-based repository that you own.
13+
1. Observe CodeRabbit perform a code review of a pull request that you initiate.
14+
1. Converse with CodeRabbit about the code review.
15+
1. Prompt CodeRabbit to generate its own improvements to the pull request.
16+
17+
When you complete this tutorial, you'll have seen CodeRabbit's code-review feature in action, and glimpsed a few of its other AI-driven abilities as well.
18+
19+
For a more general overview of CodeRabbit, see [Introduction](/).
920

1021
:::note
11-
Get started with CodeRabbit in three simple steps. No complex configuration needed.
22+
While this tutorial focuses on GitHub, CodeRabbit also works with GitLab, Azure DevOps, and Bitbucket. For more information, see [Supported Git Platforms](/platforms/).
1223
:::
1324

14-
## Steps to Enable CodeRabbit
25+
## Before you begin
1526

16-
### Sign In with GitHub
27+
Create a new, private repository on GitHub. Name the new repository `coderabbit-test`, and let it have otherwise default GitHub settings.
1728

18-
- Visit [coderabbit.ai](https://coderabbit.ai)
19-
- Click "Sign in with GitHub"
20-
- Authorize CodeRabbit
29+
## Integrate CodeRabbit with your GitHub account
2130

22-
![CodeRabbit Login](/img/integrations/login-self-hosted-github.png)
31+
To integrate CodeRabbit with your GitHub account, follow these steps:
2332

24-
### Add Your Repository
33+
1. Visit [the CodeRabbit login page](https://app.coderabbit.ai/login).
34+
1. Click **Login with GitHub**.
35+
1. Click **Authorize coderabbitai**.
2536

26-
- Go to your [Dashboard](https://app.coderabbit.ai/dashboard)
27-
- Click "Add Repositories"
28-
- Select the repositories you want to enable
37+
CodeRabbit takes a moment to set up the integration. After it finishes, the CodeRabbit dashboard appears.
2938

30-
![CodeRabbit Dashboard](/img/getting-started/dashboard-coderabbit.png)
39+
## Add CodeRabbit to your repository
3140

32-
### You're Done 🎉
41+
To add CodeRabbit to your test repository, follow these steps:
3342

34-
- CodeRabbit will automatically start reviewing your Pull Requests
35-
- Default configuration works out of the box
36-
- No additional setup needed
43+
1. On the CodeRabbit dashboard, click **Add Repositories**. A GitHub repository-access dialog appears.
44+
1. Select the **Only select repositories** radio button.
45+
1. From the **Select repositories** menu, select the `coderabbit-test` repository that you created earlier in this Quickstart.
46+
1. Click **Install & Authorize**.
47+
1. If a CodeRabbit **Complete your signup** dialog appears, then fill it out with the requested information before continuing.
3748

38-
## What's Next?
49+
CodeRabbit is now ready to use with your test repository. The next steps demonstrate its core code-review features.
3950

40-
- Watch CodeRabbit
41-
- Here's an example of CodeRabbit in action:
42-
![CodeRabbit PR Review Example](/img/getting-started/pr-examples.png)
43-
- [View live example PR](https://github.com/tyaga001/devtoolsacademy/pull/39)
44-
- [Configure CodeRabbit](/getting-started/configure-coderabbit) (optional)
45-
- [Add custom review instructions](/guides/review-instructions) (optional)
51+
## Let CodeRabbit perform a code review
4652

47-
## Need Help?
53+
The following steps initiate a pull request to add a tiny and somewhat flawed Python library to your repository, triggering analysis and review from CodeRabbit.
4854

49-
- Join our [Discord community](https://discord.gg/coderabbit) for support
50-
- Check out our [FAQ](/faq)
51-
55+
Use your usual Git workflow to perform the following steps in the `coderabbit-test` repository:
5256

53-
:::tip
54-
CodeRabbit starts working immediately. You can customize its behavior later when needed.
55-
:::
57+
1. Create a branch named `add-utils`.
58+
59+
1. In that new `add-utils` branch, create a new file called `simple_utils.py`, with the following content:
60+
61+
```
62+
# simple_utils.py - A tiny utility library
63+
64+
def reverse_string(text):
65+
"""Reverses the characters in a string."""
66+
return text[::-1]
67+
68+
def count_words(sentence):
69+
return len(sentence.split())
70+
71+
def celsius_to_fahrenheit(celsius):
72+
return (celsius * 9/5) + 32
73+
```
74+
75+
1. Commit the added file to the `add-utils` branch. Use any text you want for the commit message.
76+
77+
1. Create a pull request that proposes to merge the `add-utils` branch into the `main` branch. Use any text you want for the pull request message.
78+
79+
After a few moments, CodeRabbit responds to the pull request using the `@coderabbitai` GitHub account. It performs the following actions, all of which are visible on the pull request's page on GitHub:
80+
81+
* If you didn't write a pull request summary, then Code Rabbit adds a new summary to the pull request.
82+
83+
* CodeRabbit posts a comment titled **Walkthrough** containing analysis and commentary about the content of the pull request.
84+
85+
* CodeRabbit attaches a detailed code review to the pull request as another comment.
86+
87+
Part of the review resembles the following screenshot:
88+
89+
![An example code review comment](/img/getting-started/quickstart-comment.png)
90+
91+
This shows that CodeRabbit has noticed some flaws with this Python library, including a lack of docstrings and input validation. The review comment identifies these flaws, and suggests how you might implement them.
92+
93+
## Ask CodeRabbit for more information
94+
95+
After CodeRabbit reviews a pull request, you can converse with it about its review. You can also give CodeRabbit special commands to request it to perform specific functions, such as generating appropriate code changes for you.
96+
97+
1. Post the following as a new GitHub comment attached to the pull request:
98+
99+
```
100+
@coderabbitai Why do all of these functions need docstrings? Isn't it obvious enough what they do?
101+
```
102+
103+
After a few moments, CodeRabbit posts its reply, explaining its motivations for its recommendation. The reply might resemble the following:
104+
105+
> You're right that these functions are quite self-explanatory from their names alone. Docstrings aren't strictly necessary for every function, especially in smaller projects with clear function names.
106+
>
107+
> While docstrings do provide benefits (IDE tooltips, documentation generation, help for future developers), they can sometimes feel redundant for very straightforward functions. It's ultimately a matter of coding style and project requirements.
108+
>
109+
> If you prefer to skip docstrings for obvious utility functions in this project, that's perfectly reasonable. Would you like me to adjust my review approach regarding documentation for this repository?
110+
111+
In this case, CodeRabbit is offering to adjust its future behavior when reviewing changes to this repository. Instead, follow the next step to ask CodeRabbit to implement part of its suggestions.
112+
113+
1. Post the following as another new comment:
114+
115+
```
116+
@coderabbitai generate docstrings
117+
```
118+
119+
After a few moments, CodeRabbit does the following:
120+
121+
* CodeRabbit creates a new branch, based on `add-utils`.
122+
123+
* CodeRabbit commits changes to the branch that adds suggested docstrings to `add-utils`.
124+
125+
* CodeRabbit opens a new pull request between the new branch and `add-utils`.
126+
127+
## Clean up
128+
129+
Continue experimenting with CodeRabbit in your test repository for as long as you like. When you're finished, you can delete the repository.
130+
131+
You are now ready to add CodeRabbit to other repositories that you own, and let it review some real pull requests.
132+
133+
## What's next
134+
135+
- [Integrate CodeRabbit](http://localhost:3000/platforms/) with your repositories on GitHub, GitLab, Azure DevOps, or Bitbucket.
136+
- [Configure CodeRabbit](/getting-started/configure-coderabbit) beyond its default settings.
137+
- [Add custom review instructions](/guides/review-instructions).
138+
- [Get support for CodeRabbit](/getting-started/support).
139+
- [Learn more about how CodeRabbit works](/overview/why-coderabbit).

Diff for: static/img/getting-started/quickstart-comment.png

176 KB
Loading

0 commit comments

Comments
 (0)