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
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
- 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
- Open your web browser and navigate to http://localhost:8000/codesearch
- Select a directory to analyze through the web interface
- 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:
- Make your changes to the source code
- Update dependencies in
requirements.txtif needed - Rebuild the executable using the commands in the "Running as an Executable" section
Version Control
- The
.venvdirectory (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:
- Uninstall existing packages:
pip uninstall dir-assistant codesearch-ai -y
- Remove the configuration and models:
rm -rf ~/.local/share/codesearch_ai
rm -rf ~/.local/share/dir-assistant # If you had dir-assistant installed
- Clean any previous builds:
rm -rf build dist *.egg-info
- Reinstall from source:
pip install -e .
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1939e8058383e8b2577ff398f864bde32527195380dc1b54f0131654747cc199
|
|
| MD5 |
5def694f4103f87d8b82236ec6f713f4
|
|
| BLAKE2b-256 |
cd8af62b8814a46b8ec2451280b0e45cb9c8ee6bc41412f49ed7d99a28c35623
|