Skip to main content

Local AI-powered environment variable search assistant

Project description

envbot

Local AI-powered environment variable search assistant.

Stop digging through dozens of .env files scattered across your projects. envbot indexes all your environment variables and lets you find them instantly using natural language search -- powered by sentence embeddings and FAISS.

envbot "mongodb connection string"
                                Search Results
+--------------------------------------------------------------------------+
|   # | Variable        | Value                        | Source            |
|-----+-----------------+------------------------------+-------------------|
|   1 | MONGO_URI       | mongodb+srv://user:pass@c... | D:\App\.env       |
|   2 | DATABASE_URL    | mongodb://localhost:27017/... | D:\Api\.env       |
|   3 | DB_CONNECTION   | mongodb://admin@cluster0...  | D:\Svc\.env       |
+--------------------------------------------------------------------------+
                           3 result(s) found

Features

  • AI-Powered Semantic Search -- Understands what you mean, not just exact matches. Search for "stripe payment key" and it finds STRIPE_SECRET_KEY.
  • Multi-Drive / Multi-Directory Scanning -- Scan one or more drives (Windows) or directories (macOS/Linux) in a single index.
  • Cross-Platform -- Works on Windows, macOS, and Linux.
  • Interactive Configuration Wizard -- No config files to edit manually. The CLI guides you through setup.
  • Zero-Leak Security -- Variable values are never stored in the index. They are only read on-the-fly when you explicitly request them with -v.
  • Beautiful CLI -- Rich terminal UI with progress bars, spinners, tables, and color-coded output.
  • Fast -- FAISS vector search returns results in milliseconds after the initial model load.

Installation

Prerequisites

  • Python 3.11+ is required.
  • pip (comes with Python).

Option 1: Install from PyPI

pip install envbot

Option 2: Install from GitHub

pip install git+https://github.com/your-username/envbot.git

Option 3: Install from Source

git clone https://github.com/your-username/envbot.git
cd envbot
pip install .

Note: On first run, envbot will automatically download the all-MiniLM-L6-v2 sentence transformer model (~80 MB). This happens only once.


Quick Start

Step 1: Configure & Index

Run the reindex command. The interactive wizard will guide you:

envbot --reindex

You will be prompted to:

  1. Select drives/directories to scan -- Choose which drives (Windows: C, D, E) or directories (Linux/macOS: /home/user/projects) to scan for .env files.
  2. Set storage path -- Choose where to store the copied .env files and the FAISS index. Defaults to ~/.envbot_data.

The wizard saves your preferences to ~/.envbot_config.json. On subsequent runs, it will ask if you want to reuse the saved configuration.

Step 2: Search

envbot "database"

That's it! You'll see a table of matching environment variable names.


Usage

All options must be placed before the search query.

Basic Search

envbot "openai api key"

Show Variable Values (-v)

Read and display the actual value from the .env file on-the-fly:

envbot -v "stripe"

Show Source File Path (--show-source)

See which .env file each variable came from:

envbot --show-source "database"

Change Number of Results (-k)

By default, 3 results are returned. Get more:

envbot -k 10 "api key"

Combine All Flags

envbot -v --show-source -k 5 "mongodb"

Rebuild the Index

Re-scan all configured drives and rebuild the search database:

envbot --reindex

View Help

envbot --help

How It Works

+------------------+     +------------------+     +------------------+
|  1. SCAN         | --> |  2. PARSE        | --> |  3. EMBED        |
|  Recursively     |     |  Extract variable |     |  Generate vector |
|  find .env files |     |  names (no values)|     |  embeddings via  |
|  across drives   |     |  from all files   |     |  SentenceTransf. |
+------------------+     +------------------+     +------------------+
                                                         |
                                                         v
+------------------+     +------------------+     +------------------+
|  6. DISPLAY      | <-- |  5. RANK         | <-- |  4. INDEX        |
|  Rich table with |     |  Cosine similar. |     |  Store vectors   |
|  colors & values |     |  via FAISS       |     |  in FAISS index  |
+------------------+     +------------------+     +------------------+

Architecture

File Purpose
cli.py Entry point, argument parsing, Rich UI rendering
scanner.py Recursively walks drives/directories for .env files
parser.py Extracts variable names from copied .env files
indexer.py Generates embeddings and builds the FAISS vector index
search.py Encodes queries and performs FAISS similarity search

Security Model

  • Values are never stored in the FAISS index or metadata files.
  • Only variable names and source file paths are persisted.
  • When you use -v, values are read on-the-fly from the local copy at search time.
  • Copied .env files are stored in your configured data directory (default: ~/.envbot_data/copied_envs/).

Configuration

Your configuration is stored at ~/.envbot_config.json:

{
  "scan_drives": ["D:\\", "E:\\"],
  "data_dir": "C:\\Users\\you\\.envbot_data"
}
Key Description
scan_drives List of drives (Windows) or directories to scan
data_dir Where the index, metadata, and copies are stored

You can edit this file manually or re-run envbot --reindex to use the wizard.


Command Reference

Command Description
envbot "query" Search for matching variables
envbot -v "query" Search and show values
envbot --show-source "query" Search and show source file paths
envbot -k 10 "query" Return up to 10 results
envbot -v --show-source -k 5 "query" All flags combined
envbot --reindex Configure drives and rebuild index
envbot --help Show help message

Requirements

Package Version Purpose
sentence-transformers >= 2.7.0 Semantic text embeddings
faiss-cpu >= 1.8.0 Vector similarity search
typer >= 0.12.0 CLI framework
rich >= 13.7.0 Terminal UI (tables, spinners)
python-dotenv >= 1.0.0 .env file parsing
numpy >= 2.1.0 Numerical operations
torch >= 2.0.0 ML backend for transformers

Platform Support

Platform Status Drive/Path Format
Windows 10/11 Supported C:\, D:\, E:\
macOS Supported /Users/you/projects
Linux Supported /home/you/projects

Troubleshooting

"FAISS index not found" error

You need to build the index first:

envbot --reindex

Slow first search

The first search takes a few seconds because the AI model needs to load into memory. Subsequent searches in the same session are instant.

Permission errors on Windows

If you see PermissionError: [WinError 5], make sure the storage path is set to a user-writable directory (the default ~/.envbot_data should work). Re-run envbot --reindex to reconfigure.


License

MIT License. See LICENSE for details.

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

envbot-1.0.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envbot-1.0.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file envbot-1.0.0.tar.gz.

File metadata

  • Download URL: envbot-1.0.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for envbot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7981c18ee2bbbf0d449ce6350f7f5a02a51082b2064024c9120acf3b1e717e62
MD5 ad7511739794623a227b46859b78386f
BLAKE2b-256 8155e7371791fc9b618864d2fc8f1a7e7502cc999f31fbb517c07c1ce5f10a9f

See more details on using hashes here.

File details

Details for the file envbot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: envbot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for envbot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4401c4f0a1ea111693b2efaa423c3f3ec2c5d4439e401e380f2ac50117eb98c1
MD5 7082ff54881bec87ebd0285d3353ec02
BLAKE2b-256 690db7d2503bbb98d6fbeab42c71d929b062ebb97f5e9796be205567d6b4964d

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