CodiumAI is a coding assistant that developers can use to enhance their coding experience using the power of Artificial Intelligence.
It is a trending tool with features such as accurate code suggestions, explanation of the code, automatic test generation, and various language and IDE Support.
For this demo, we are going to use CodiumAI to make a Pull Request.
Installation
For the installation, we will need two things:
- OpenAI API Key
- GitHub Personal Access Token(Classic)
Now, let's get the OpenAI API Key.
Getting OpenAI API Key
First, let's go to the Codium AI GitHub repository and follow the installation instructions.
You can then sign up
This will lead you to the Welcome page.
Click on it.
We will then create an API key. I already created mine as you can see.
Give your secret key a name. In my case, I will name it For CodiumAI. You can give it any name you like.
Make sure to copy it somewhere. We are going to use it.
With CodiumAI, you can use many Git platforms like GitHub, Gitlab and Bitbucket. In comparison to GitHub Copilot, you can only use it with GitHub.
Also, the Codium PR-Agent is available both on Git and IDE not just Git.
In our case, we will use the Git version using GitHub.
We will need to get a GitHub personal access token(classic) since it is one of the two requirements of using Codium.
Getting a GitHub Personal Access Token(Classic)
To get the GitHub Personal Access Token, lets head over to GitHub.
On the upper right corner, click on your profile picture then on Settings.
Select generate new token, then generate new token classic
In the Note field, give your token a descriptive name.
Select the scopes you would like to grant this token.
You can then copy the token somewhere for future reference.
Then create a new repository
It is a public repository. Incase you want to fork it, here is the link to it:
Click on Settings of the repository.
Click on New Repository Secret button.
Click Add Secret
Cloning our repo to our local computer
We will then clone it to our local computer.
We will create a simple index.html to use it for the demo.
Let's see how it looks on the browser. I'm using a VS Code extension called Live Server to view my page.
Now, let's push our changes to GitHub.
Adding GitHub Actions
We are going to use GitHub Actions.
To start lets create a .github/workflows/pr_agent.yml file to add the action.
Created the folder .github in VS Code by clicking the create folder icon.
Now, lets create the file pr_agent.yml inside the folder workflows.
Now lets push the changes to GitHub.
On the main branch, commit and push to GitHub.
The change has been pushed successfully as you can see.
Call the branch new branch and press ENTER.
We now commit and push the new changes to GitHub. Notice we are on our new branch.
Now back to our repository on GitHub.
Creating our first Pull Request
Let's compare and make our Pull Request. Click the button Compare & Pull Request.
Then click the button Create Pull Request
Click the merge button.
Now, lets test how Codium PR Agent works.
Testing how Codium PR Agent works
CodiumAI PR Agent supports many commands which we are going to look at today. For Codium, these include things like:
- Auto Description(/describe). This automatically generates the PR description. The title, type, summary, code walkthrough and labels.
- Auto Review(/review). Adjustable feedback about the PR main theme, type, relevant tests, security issues, score, and various suggestions for the PR content.
- Question Answering(/ask ...). Answering free-text questions about the PR.
- Code Suggestions(/improve). Committable code suggestions for improving the PR.
- Update Changelog(/update_changelog). Automatically updating the CHANGELOG.md file with the PR changes.
- Find Similar Issue(/similar_issue). Automatically retrieves and presents similar issues.
- Add Documentation(/add_docs). Automatically adds documentation to un-documented functions/classes in the PR.
- Generate Custom Labels(/generate_labels). Automatically suggests custom labels based on the PR code changes.
Let us test the Auto Review(/review) command.
Testing the Auto Review command
After merging, under the comment section, write this command @CodiumAI-Agent /review
The review is very descriptive and easy to understand.
It analyses the PR giving you information about the main theme. In our case, it is to enhance website content.
It also gives you a PR Summary, Type of PR, if there are any tests added, estimated effort to review the PR, any security concerns and PR feedback.
When we try the Code suggestions, it shows us how we can improve our code.
You can test all the above commands to see how Codium can work to suit you best.
Happy Coding!
Karl

SOCIAL SHARE CARD GENERATOR