Skip to main content

gpt-code-search enables you to search your codebase with natural language.

Project description

gpt-code-search

logo

gpt-code-search enables you to search your codebase with natural language using GPT-4.

Features

  • 🧠 GPT-4: code search, retrieval, and answering all done with OpenAI and function calling.
  • 🔐 Privacy-first: code snippets only leave your machine when you ask a question and the LLM requests the relevant code.
  • 🔥 Works instantly: no pre-processing, chunking, or indexing, get started right away.
  • 📦 File-system backed: works with any code on your machine.

Getting Started

Installation

pip install gpt-code-search

Usage

Ask a question about your codebase

gpt-code-search query ""

Select a model

gpt-code-search select-model

Defaults to gpt-3.5-turbo-16k. The selected model is stored in ~/$HOME/.gpt-code-search/config.toml.

Configuration

The tool will prompt you to configure the OPENAI_API_KEY, if you haven't already.

Problem

You want to leverage the power of GPT-4 to search your codebase, but you don't want to manually copy and paste code snippets into a prompt nor send your code to another third-party service.

This tool solves these problems by letting GPT-4 determine the most relevant code snippets within your codebase. This removes the need to copy and paste or send your code to another third-party. Also, it meets you where you already live, in your terminal, not a new UI or window.

Examples of the types of questions you might want to ask:

  • 🐛 Help debugging errors and finding the relevant code and files
  • 📝 Document large files or functionalities formatted as markdown
  • 🛠️ Generate new code based on existing files and conventions
  • 📨 Ask general questions about any part of the code

Privacy

Outside of the LLM, no data is sent or stored.

The only data sent to LLM is the question you ask and the code snippets that is requests related to your question. All code snippets are retrieved from your local machine.

Wolfia Codex

This tool is a simplified version of Wolfia Codex, a cloud tool that enables you to ask any question about open source and private code bases like Langchain, Vercel ai, or gpt-engineer.

If you're looking for a more powerful tool, or avoiding the setup, check out Wolfia Codex, search codebases, share your questions and answers, and more!

Development

The project uses poetry for dependency management and packaging. To get started, install poetry and run the following commands:

# Install dependencies
poetry install

Run the project

# Run the project
poetry run python core/main.py

Install pre-commit hooks

# Install pre-commit hooks
poetry run pre-commit install

Contact

If you need help or have any questions, please reach out to us at support@wolfia.com.

License

Apache 2.0 © Wolfia

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpt_code_search-0.0.3.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

gpt_code_search-0.0.3-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file gpt_code_search-0.0.3.tar.gz.

File metadata

  • Download URL: gpt_code_search-0.0.3.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.2.0

File hashes

Hashes for gpt_code_search-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7be20d087e8bc720d640fc24592007a9db54e7b08d1fd1329baee345cf395eca
MD5 5f79117b72b53ac9bf6045fc30da4f40
BLAKE2b-256 9ca696176c7329e6a13f24da1427361b9b9deaf678231161b217c604dbbf20b9

See more details on using hashes here.

File details

Details for the file gpt_code_search-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: gpt_code_search-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.2.0

File hashes

Hashes for gpt_code_search-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 30791e03b85f2728c83ba1594fd3788b6b2ff45f8170a30ef2d4168d5c3fc98e
MD5 8a01f909cc14f832f1146a586b9aec05
BLAKE2b-256 b9f1b18951042138cf5e6cd99aa78c114f56eef9efd1d7fce591fc4050f5d1d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page