Skip to main content

Chat with your current directory's files using a local or API LLM.

Project description

CodeSearch AI

CodeSearch AI is a powerful tool that allows you to search and interact with your codebase through a web interface.

Installation

  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Unix/macOS
# or
.venv\Scripts\activate  # On Windows
  1. Install the required dependencies:
pip install -r requirements.txt

Running the Web Server Locally

There are two ways to run CodeSearch AI:

1. Running Directly from Source

python codesearch_ai/main.py

This will start the web server at http://localhost:8000/codesearch and automatically open it in your default browser.

2. Running as an Executable

First, build the executable:

# Clean any previous builds
rm -rf build dist
# Build the executable
pyinstaller --clean codesearch_ai.spec

Then run the executable:

./dist/codesearch_ai

The web interface will be available at http://localhost:8000/codesearch

Usage

  1. Open your web browser and navigate to http://localhost:8000/codesearch
  2. Select a directory to analyze through the web interface
  3. Start searching and interacting with your codebase

Command Line Interface

When running with command-line arguments, CodeSearch AI provides additional functionality:

# Show help
./dist/codesearch_ai --help

# Start with specific directories
./dist/codesearch_ai start -d /path/to/dir1 /path/to/dir2

# Ignore specific paths
./dist/codesearch_ai start -i "node_modules/*" "*.pyc"

Development

To modify and rebuild the executable:

  1. Make your changes to the source code
  2. Update dependencies in requirements.txt if needed
  3. Rebuild the executable using the commands in the "Running as an Executable" section

Version Control

  • The .venv directory (virtual environment) is excluded from version control via .gitignore
  • Also excluded are Python cache files, build artifacts, and IDE-specific files
  • When cloning the repository, you'll need to create a new virtual environment and install dependencies as described in the Installation section

Complete Reinstallation

If you need to completely clear and reinstall CodeSearch AI, follow these steps:

  1. Uninstall existing packages:
pip uninstall dir-assistant codesearch-ai -y
  1. Remove the configuration and models:
rm -rf ~/.local/share/codesearch_ai
rm -rf ~/.local/share/dir-assistant  # If you had dir-assistant installed
  1. Clean any previous builds:
rm -rf build dist *.egg-info
  1. Reinstall from source:
pip install -e .
  1. Download the required models:
codesearch-ai models download-llm
codesearch-ai models download-embed

Acknowledgments

CodeSearch AI is built upon the foundations of the excellent work done in the dir-assistant project by Chase Adams. We deeply appreciate the contributions made by Chase Adams, as they provided invaluable insights and inspiration for the development of this tool.

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

codesearch-ai-0.0.1.tar.gz (20.5 kB view details)

Uploaded Source

File details

Details for the file codesearch-ai-0.0.1.tar.gz.

File metadata

  • Download URL: codesearch-ai-0.0.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for codesearch-ai-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1939e8058383e8b2577ff398f864bde32527195380dc1b54f0131654747cc199
MD5 5def694f4103f87d8b82236ec6f713f4
BLAKE2b-256 cd8af62b8814a46b8ec2451280b0e45cb9c8ee6bc41412f49ed7d99a28c35623

See more details on using hashes here.

Supported by

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