luckyshot-0.3.0 is not a library.
A powerful CLI tool that enhances code understanding by using RAG (Retrieval Augmented Generation) to find relevant files in your codebase.
Features
- File scanning with customizable chunk sizes and overlap
- Semantic search using OpenAI embeddings
- Support for piped input and file suggestions
- Intelligent context expansion
Installation
Usage
Scanning Files
Generate embeddings for your codebase using the scan command:
# Basic scan of all Rust files
# Basic scan of all Rust and Markdown files
# Scan with chunking enabled
# Include file metadata in embeddings
# Scan with all options
The scan command:
- Finds files matching your pattern (respecting .gitignore)
- Generates embeddings using OpenAI's API
- Saves results to
.luckyshot.file.vectors.v1
Finding Relevant Files
To find files related to a topic or question:
# Basic file suggestion
# Using piped input
|
# Filter results by similarity score (matches >= specified value, range 0.0 to 1.0)
# Show detailed information including similarity scores
# Show file contents of matches
# Limit number of results
# Combine options
# Chain commands Unix-style
| \
| \
This will:
- Convert your query into an embedding
- Use BM25-style ranking to find similar files
- Display relevant files with similarity scores
Expanding Context
To expand a query with additional context:
Environment Setup
You'll need an OpenAI API key. Either:
Or create a .env file:
OPENAI_API_KEY=your-api-key
License
MIT