Loading repository data…
Loading repository data…
firebotQL / repository
CompAInion is a free Chrome extension integrating OpenAI's ChatGPT into your browser, enabling contextual AI conversations with a unique text-selection injection feature.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Welcome to CompAInion - is a free chrome extension assistant as a sidebar available in all browsing tabs. The main motivation for me why I built it is because I wanted a tool that could integrate ChatGPT into my day-to-day browsing without context switching. Basically, it's a Chrome Extension that adds a chat interface to your browser, which you can use to talk with ChatGPT. The area where you chat opens as a sidebar, so it doesn't interrupt your browsing.
One cool feature is that you can select any text on a webpage, and 'Use' it to be injected directly into your text chat area. It saves you from having to copy and paste so you can continue your chat using that selected text.
To build the extension, I used a mix of tech, including React and TailwindCSS for the front end, and Next.js and Vercel AI SDK for the backend. The backend is deployed to Vercel, and using Edge Functions - which was the only way I found how to get around a 10-second timeout Vercel limitation.
There are some alternatives out there like Monica, Sider.ai, and GPTPlus . But they're not completely free. In contrast:
I hope you find CompAInion helpful in your day-to-day browsing. It's still a work in progress, and I'm looking forward to making it even better!
NOTE: The project is in its early stages and there are several bugs that need attention. You'll find a list of known issues and future enhancements at the end of this README.
To make use of this extension, first, ensure you have a ChatGPT API Key. If you don't have one, follow the provided link to acquire it.
:warning:Currently experiencing issues with the 'Deploy to Vercel' button on GitHub. Please manually clone and deploy the project until resolved.
Now that you've got your API key you can deploy your own instance of the backend service by clicking on the "Deploy to Vercel" button shown below. Make sure to set the following environment variables:
PASSWORD: Protects the endpoint, and is sent as an Authorization Header from the Chrome extension.OPENAI_API_KEY: Your unique ChatGPT API Key.Or if you prefer to deploy it manually, here are the steps you will need to follow:
After the deployment, your 'Servel URL' will be in such format:
Please replace 'YOUR_PROJECT_NAME' with the name you have entered or that was automatically generated as shown in the previous screenshot. Save above url so we can use it later on to setup chrome extension.
This process involves two key steps:
Prerequisite: Before running the below commands you will need to have Node.js installed on your machine version above 18. And also package manager yarn installed.
Navigate to your project's root directory and execute the following command to install the necessary dependencies and build the Chrome extension:
yarn install && yarn build:chrome
This action will create a dist folder, essentially it's where a fully build Chrome Extension will reside after running the above commands.
Open Chrome and navigate to chrome://extensions/. Enable 'Developer mode' from the top right corner.
Click the 'Load unpacked' button and navigate to the dist folder in your project directory, which was created in the previous step. Click 'Select' and your Chrome Extension should now be installed and ready for use.
After you get it installed you will see the CompAInion logo in your extensions bar, click on it and you will see a popup window asking you to enter your server URL and password. Enter the URL of your deployed backend service and the password you set in the environment variables. Click 'Save' and you should be good to go!
You will also see CompAInion icon on the left bottom side to open the chat area/sidebar. Click on it and you will see a chat area/sidebar. You can start chatting with the AI by typing in the chat area.
You can also select any text on any webpage and click on the button that appears to the right of the selected text. This will inject the selected text into your chat area/sidebar. You can then continue your chat using that selected text.
backend: The deployable Next.js service hosted on Vercel, making use of Edge Functions to handle large response timeouts.chrome-extension/core: Houses the core files for the Chrome extension, including the manifest.json configuration.chrome-extension/content: A React app utilizing Tailwind and ShadeCN for chat functionalities and a context menu for text selection on loaded pages.chrome-extension/popup: Provides a popup for configuring your server URL and authorization password. These should originate from the deployed 'backend' instance.Here are some tasks/todos on my radar (in priority order):
Your contributions are invaluable to me! I welcome bug reports, feature requests, and pull requests to help to improve CompAInion. I appreciate your collaboration!