Check for hardcoded secrets in a Git repository using LLMs
- Clone the repository:
git clone https://github.com/cristibtz/SecretFinder.git cd SecretFinder - Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install the required packages:
pip install -r requirements.txt pip install -e . - Set up your OpenAI API key in a
.envfile:OPENAI_API_KEY=your_openai_api_key_here
Run the tool with a Git repository URL or a local path:
secret-finder --repo /home/alex/my-repo
# or
secret-finder --repo https://github.com/cristibtz/SecretFinder.git
# or
secret-finder --repo git@github.com:cristibtz/SecretFinder.git
# or
secret-finder --repo ./ --n 20 --output file.json