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).

Install from PyPI

pip install envbot

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.


Author

Built by Ravindra S -- ravindraogg.netlify.app

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.1.tar.gz (17.0 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.1-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: envbot-1.0.1.tar.gz
  • Upload date:
  • Size: 17.0 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.1.tar.gz
Algorithm Hash digest
SHA256 2553ff6743599bd106d97a4a5b24ed8bb49954a68d56c71d18bc5aac6efca435
MD5 d6b081edd5c4af59e5b188cef313ba84
BLAKE2b-256 d0b6f1e4eaf1ce2b05f9e1d55739fc52bd2f6c5254db54ad0e10fff1fff7ce27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: envbot-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9b00c013c492412b05b7e7b66ce1352ade90464c26069d1e9f93fcf74d6563e
MD5 1c2bc67ceeaa05e7996affdd1c891a8d
BLAKE2b-256 c8a5c2532afab193410b10ddc58a111a01254639c1a1d58fb504dccf7d39e14a

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