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.
  • pipx (recommended) or pip (alternative).

Upgrade Note for Existing pip Users

If you previously installed envbot with pip, uninstall it first to avoid conflicts:

pip uninstall envbot

Install with pipx (Recommended)

pipx installs CLI tools in isolated environments and makes them globally available:

pipx install envbot

After installation, verify envbot is on your PATH:

envbot --help

If the command is not found, ensure pipx's binary directory is in your system PATH:

  • Windows: %USERPROFILE%\.local\bin (or pipx ensurepath)
  • macOS / Linux: ~/.local/bin (or pipx ensurepath)

Then restart your terminal.

Install with pip (Alternative)

pip install envbot

Note: On first run, envbot will automatically download the BAAI/bge-small-en-v1.5 embedding model (~30 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
fastembed >= 0.5.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)
numpy >= 1.26.0 Numerical operations

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.1.0.tar.gz (20.5 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.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for envbot-1.1.0.tar.gz
Algorithm Hash digest
SHA256 86658ba6eec04db7e396da797f1f07789660d0e31ea92a836a659222214e41f2
MD5 170d6e03bc6ca9b36bf343b4d05452d0
BLAKE2b-256 49b765380c522b6bf7dc77bb8a1cd26b086520d961f992c68a222a428fc4c9f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: envbot-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5270ffdd786248c4af091bcd8cade91be110d17285069a61053b794b0dcd0f9c
MD5 60b2460c10a351ca5c73d46e46b72037
BLAKE2b-256 6f8f82988a009534ceaa3a9f9e50e0ca21482fd75f9f302d3490411512b0498b

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