CodeQuery is a Chrome extension that allows developers to seamlessly leverage AI for insights on code directly within GitHub repositories. Built with a locally served backend using Next.js and a Plasmo-powered frontend, it enhances productivity and understanding of complex code by providing AI-driven features in an intuitive interface.
- GitHub Access Token: You need to have a GitHub access token to access repositories if required.
- Environment Files: You need to create environment files for both backend and frontend using the provided
.env.examplefiles:- Backend
.envsetup- Copy the file from
backend/.env.exampletobackend/.env. - Add your GitHub access token and API access key to the
.envfile.
- Copy the file from
- Backend
cp backend/.env.example backend/.env- Frontend
.envsetup- Copy the file from
extension/.env.exampletoextension/.env.
- Copy the file from
cp extension/.env.example extension/.envThis project requires two main components to run independently in different terminals: the backend service (Next.js) and the frontend extension (Plasmo).
- Backend: Make sure to navigate to the
backenddirectory and install the dependencies usingnpm.
cd backend
npm install- Frontend: Make sure to navigate to the
extensiondirectory and install the dependencies usingpnpm.
cd extension
pnpm installBackend: Start the Next.js server for backend processing.
npm run devFrontend: Start the Plasmo extension service.
To run the application in development mode, where you can make changes and see them in real-time:
pnpm devIf you want to deploy the application for regular use, you can build both the backend and frontend.
Once both components are running, open your Chrome browser and load the development build:
pnpm build- Go to chrome://extensions.
- Enable Developer mode
- Click Load unpacked and select the appropriate
extension/build/chrome-mv3-devorextension/build/chrome-mv3-proddirectory from the frontend.
- ** Origin Trials Key**: The current version of this extension includes an Origin Trials access key in the manifest to leverage the Prompt API for Chrome Extensions. This key may expire in the future, and users will need to add a new key to continue using these features. You can obtain a new key from Chrome Origin Trials.

