envbot 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- envbot-1.0.0/LICENSE +21 -0
- envbot-1.0.0/PKG-INFO +304 -0
- envbot-1.0.0/README.md +268 -0
- envbot-1.0.0/cli.py +481 -0
- envbot-1.0.0/envbot.egg-info/PKG-INFO +304 -0
- envbot-1.0.0/envbot.egg-info/SOURCES.txt +14 -0
- envbot-1.0.0/envbot.egg-info/dependency_links.txt +1 -0
- envbot-1.0.0/envbot.egg-info/entry_points.txt +2 -0
- envbot-1.0.0/envbot.egg-info/requires.txt +6 -0
- envbot-1.0.0/envbot.egg-info/top_level.txt +5 -0
- envbot-1.0.0/indexer.py +187 -0
- envbot-1.0.0/parser.py +77 -0
- envbot-1.0.0/scanner.py +140 -0
- envbot-1.0.0/search.py +119 -0
- envbot-1.0.0/setup.cfg +4 -0
- envbot-1.0.0/setup.py +41 -0
envbot-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ravi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
envbot-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: envbot
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Local AI-powered environment variable search assistant
|
|
5
|
+
Home-page: https://github.com/ravindraogg/envbot
|
|
6
|
+
Author: Ravi
|
|
7
|
+
Keywords: env environment variables search ai faiss semantic dotenv cli
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
+
Classifier: Topic :: Utilities
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: sentence-transformers>=2.7.0
|
|
21
|
+
Requires-Dist: faiss-cpu>=1.8.0
|
|
22
|
+
Requires-Dist: typer>=0.12.0
|
|
23
|
+
Requires-Dist: rich>=13.7.0
|
|
24
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
25
|
+
Requires-Dist: numpy>=2.1.0
|
|
26
|
+
Dynamic: author
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: keywords
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
36
|
+
|
|
37
|
+
# envbot
|
|
38
|
+
|
|
39
|
+
**Local AI-powered environment variable search assistant.**
|
|
40
|
+
|
|
41
|
+
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.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
envbot "mongodb connection string"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Search Results
|
|
49
|
+
+--------------------------------------------------------------------------+
|
|
50
|
+
| # | Variable | Value | Source |
|
|
51
|
+
|-----+-----------------+------------------------------+-------------------|
|
|
52
|
+
| 1 | MONGO_URI | mongodb+srv://user:pass@c... | D:\App\.env |
|
|
53
|
+
| 2 | DATABASE_URL | mongodb://localhost:27017/... | D:\Api\.env |
|
|
54
|
+
| 3 | DB_CONNECTION | mongodb://admin@cluster0... | D:\Svc\.env |
|
|
55
|
+
+--------------------------------------------------------------------------+
|
|
56
|
+
3 result(s) found
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Features
|
|
62
|
+
|
|
63
|
+
- **AI-Powered Semantic Search** -- Understands what you mean, not just exact matches. Search for `"stripe payment key"` and it finds `STRIPE_SECRET_KEY`.
|
|
64
|
+
- **Multi-Drive / Multi-Directory Scanning** -- Scan one or more drives (Windows) or directories (macOS/Linux) in a single index.
|
|
65
|
+
- **Cross-Platform** -- Works on Windows, macOS, and Linux.
|
|
66
|
+
- **Interactive Configuration Wizard** -- No config files to edit manually. The CLI guides you through setup.
|
|
67
|
+
- **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`.
|
|
68
|
+
- **Beautiful CLI** -- Rich terminal UI with progress bars, spinners, tables, and color-coded output.
|
|
69
|
+
- **Fast** -- FAISS vector search returns results in milliseconds after the initial model load.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Installation
|
|
74
|
+
|
|
75
|
+
### Prerequisites
|
|
76
|
+
|
|
77
|
+
- **Python 3.11+** is required.
|
|
78
|
+
- **pip** (comes with Python).
|
|
79
|
+
|
|
80
|
+
### Option 1: Install from PyPI
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install envbot
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Option 2: Install from GitHub
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install git+https://github.com/your-username/envbot.git
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Option 3: Install from Source
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/your-username/envbot.git
|
|
96
|
+
cd envbot
|
|
97
|
+
pip install .
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> **Note:** On first run, `envbot` will automatically download the `all-MiniLM-L6-v2` sentence transformer model (~80 MB). This happens only once.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Quick Start
|
|
105
|
+
|
|
106
|
+
### Step 1: Configure & Index
|
|
107
|
+
|
|
108
|
+
Run the reindex command. The interactive wizard will guide you:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
envbot --reindex
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
You will be prompted to:
|
|
115
|
+
|
|
116
|
+
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.
|
|
117
|
+
2. **Set storage path** -- Choose where to store the copied `.env` files and the FAISS index. Defaults to `~/.envbot_data`.
|
|
118
|
+
|
|
119
|
+
The wizard saves your preferences to `~/.envbot_config.json`. On subsequent runs, it will ask if you want to reuse the saved configuration.
|
|
120
|
+
|
|
121
|
+
### Step 2: Search
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
envbot "database"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
That's it! You'll see a table of matching environment variable names.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Usage
|
|
132
|
+
|
|
133
|
+
All options must be placed **before** the search query.
|
|
134
|
+
|
|
135
|
+
### Basic Search
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
envbot "openai api key"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Show Variable Values (`-v`)
|
|
142
|
+
|
|
143
|
+
Read and display the actual value from the `.env` file on-the-fly:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
envbot -v "stripe"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Show Source File Path (`--show-source`)
|
|
150
|
+
|
|
151
|
+
See which `.env` file each variable came from:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
envbot --show-source "database"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Change Number of Results (`-k`)
|
|
158
|
+
|
|
159
|
+
By default, 3 results are returned. Get more:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
envbot -k 10 "api key"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Combine All Flags
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
envbot -v --show-source -k 5 "mongodb"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Rebuild the Index
|
|
172
|
+
|
|
173
|
+
Re-scan all configured drives and rebuild the search database:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
envbot --reindex
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### View Help
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
envbot --help
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## How It Works
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
+------------------+ +------------------+ +------------------+
|
|
191
|
+
| 1. SCAN | --> | 2. PARSE | --> | 3. EMBED |
|
|
192
|
+
| Recursively | | Extract variable | | Generate vector |
|
|
193
|
+
| find .env files | | names (no values)| | embeddings via |
|
|
194
|
+
| across drives | | from all files | | SentenceTransf. |
|
|
195
|
+
+------------------+ +------------------+ +------------------+
|
|
196
|
+
|
|
|
197
|
+
v
|
|
198
|
+
+------------------+ +------------------+ +------------------+
|
|
199
|
+
| 6. DISPLAY | <-- | 5. RANK | <-- | 4. INDEX |
|
|
200
|
+
| Rich table with | | Cosine similar. | | Store vectors |
|
|
201
|
+
| colors & values | | via FAISS | | in FAISS index |
|
|
202
|
+
+------------------+ +------------------+ +------------------+
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Architecture
|
|
206
|
+
|
|
207
|
+
| File | Purpose |
|
|
208
|
+
|---------------|---------------------------------------------------------|
|
|
209
|
+
| `cli.py` | Entry point, argument parsing, Rich UI rendering |
|
|
210
|
+
| `scanner.py` | Recursively walks drives/directories for `.env` files |
|
|
211
|
+
| `parser.py` | Extracts variable names from copied `.env` files |
|
|
212
|
+
| `indexer.py` | Generates embeddings and builds the FAISS vector index |
|
|
213
|
+
| `search.py` | Encodes queries and performs FAISS similarity search |
|
|
214
|
+
|
|
215
|
+
### Security Model
|
|
216
|
+
|
|
217
|
+
- **Values are never stored** in the FAISS index or metadata files.
|
|
218
|
+
- Only variable **names** and **source file paths** are persisted.
|
|
219
|
+
- When you use `-v`, values are read on-the-fly from the local copy at search time.
|
|
220
|
+
- Copied `.env` files are stored in your configured data directory (default: `~/.envbot_data/copied_envs/`).
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Configuration
|
|
225
|
+
|
|
226
|
+
Your configuration is stored at `~/.envbot_config.json`:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"scan_drives": ["D:\\", "E:\\"],
|
|
231
|
+
"data_dir": "C:\\Users\\you\\.envbot_data"
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
| Key | Description |
|
|
236
|
+
|----------------|--------------------------------------------------|
|
|
237
|
+
| `scan_drives` | List of drives (Windows) or directories to scan |
|
|
238
|
+
| `data_dir` | Where the index, metadata, and copies are stored |
|
|
239
|
+
|
|
240
|
+
You can edit this file manually or re-run `envbot --reindex` to use the wizard.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Command Reference
|
|
245
|
+
|
|
246
|
+
| Command | Description |
|
|
247
|
+
|------------------------------------------------|--------------------------------------|
|
|
248
|
+
| `envbot "query"` | Search for matching variables |
|
|
249
|
+
| `envbot -v "query"` | Search and show values |
|
|
250
|
+
| `envbot --show-source "query"` | Search and show source file paths |
|
|
251
|
+
| `envbot -k 10 "query"` | Return up to 10 results |
|
|
252
|
+
| `envbot -v --show-source -k 5 "query"` | All flags combined |
|
|
253
|
+
| `envbot --reindex` | Configure drives and rebuild index |
|
|
254
|
+
| `envbot --help` | Show help message |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Requirements
|
|
259
|
+
|
|
260
|
+
| Package | Version | Purpose |
|
|
261
|
+
|-----------------------|------------|--------------------------------|
|
|
262
|
+
| `sentence-transformers` | >= 2.7.0 | Semantic text embeddings |
|
|
263
|
+
| `faiss-cpu` | >= 1.8.0 | Vector similarity search |
|
|
264
|
+
| `typer` | >= 0.12.0 | CLI framework |
|
|
265
|
+
| `rich` | >= 13.7.0 | Terminal UI (tables, spinners) |
|
|
266
|
+
| `python-dotenv` | >= 1.0.0 | .env file parsing |
|
|
267
|
+
| `numpy` | >= 2.1.0 | Numerical operations |
|
|
268
|
+
| `torch` | >= 2.0.0 | ML backend for transformers |
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Platform Support
|
|
273
|
+
|
|
274
|
+
| Platform | Status | Drive/Path Format |
|
|
275
|
+
|----------------|-------------|---------------------------|
|
|
276
|
+
| Windows 10/11 | Supported | `C:\`, `D:\`, `E:\` |
|
|
277
|
+
| macOS | Supported | `/Users/you/projects` |
|
|
278
|
+
| Linux | Supported | `/home/you/projects` |
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Troubleshooting
|
|
283
|
+
|
|
284
|
+
### "FAISS index not found" error
|
|
285
|
+
|
|
286
|
+
You need to build the index first:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
envbot --reindex
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Slow first search
|
|
293
|
+
|
|
294
|
+
The first search takes a few seconds because the AI model needs to load into memory. Subsequent searches in the same session are instant.
|
|
295
|
+
|
|
296
|
+
### Permission errors on Windows
|
|
297
|
+
|
|
298
|
+
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.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## License
|
|
303
|
+
|
|
304
|
+
MIT License. See [LICENSE](LICENSE) for details.
|
envbot-1.0.0/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# envbot
|
|
2
|
+
|
|
3
|
+
**Local AI-powered environment variable search assistant.**
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
envbot "mongodb connection string"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Search Results
|
|
13
|
+
+--------------------------------------------------------------------------+
|
|
14
|
+
| # | Variable | Value | Source |
|
|
15
|
+
|-----+-----------------+------------------------------+-------------------|
|
|
16
|
+
| 1 | MONGO_URI | mongodb+srv://user:pass@c... | D:\App\.env |
|
|
17
|
+
| 2 | DATABASE_URL | mongodb://localhost:27017/... | D:\Api\.env |
|
|
18
|
+
| 3 | DB_CONNECTION | mongodb://admin@cluster0... | D:\Svc\.env |
|
|
19
|
+
+--------------------------------------------------------------------------+
|
|
20
|
+
3 result(s) found
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **AI-Powered Semantic Search** -- Understands what you mean, not just exact matches. Search for `"stripe payment key"` and it finds `STRIPE_SECRET_KEY`.
|
|
28
|
+
- **Multi-Drive / Multi-Directory Scanning** -- Scan one or more drives (Windows) or directories (macOS/Linux) in a single index.
|
|
29
|
+
- **Cross-Platform** -- Works on Windows, macOS, and Linux.
|
|
30
|
+
- **Interactive Configuration Wizard** -- No config files to edit manually. The CLI guides you through setup.
|
|
31
|
+
- **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`.
|
|
32
|
+
- **Beautiful CLI** -- Rich terminal UI with progress bars, spinners, tables, and color-coded output.
|
|
33
|
+
- **Fast** -- FAISS vector search returns results in milliseconds after the initial model load.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
### Prerequisites
|
|
40
|
+
|
|
41
|
+
- **Python 3.11+** is required.
|
|
42
|
+
- **pip** (comes with Python).
|
|
43
|
+
|
|
44
|
+
### Option 1: Install from PyPI
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install envbot
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Option 2: Install from GitHub
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install git+https://github.com/your-username/envbot.git
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Option 3: Install from Source
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/your-username/envbot.git
|
|
60
|
+
cd envbot
|
|
61
|
+
pip install .
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
> **Note:** On first run, `envbot` will automatically download the `all-MiniLM-L6-v2` sentence transformer model (~80 MB). This happens only once.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### Step 1: Configure & Index
|
|
71
|
+
|
|
72
|
+
Run the reindex command. The interactive wizard will guide you:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
envbot --reindex
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
You will be prompted to:
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
2. **Set storage path** -- Choose where to store the copied `.env` files and the FAISS index. Defaults to `~/.envbot_data`.
|
|
82
|
+
|
|
83
|
+
The wizard saves your preferences to `~/.envbot_config.json`. On subsequent runs, it will ask if you want to reuse the saved configuration.
|
|
84
|
+
|
|
85
|
+
### Step 2: Search
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
envbot "database"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
That's it! You'll see a table of matching environment variable names.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
All options must be placed **before** the search query.
|
|
98
|
+
|
|
99
|
+
### Basic Search
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
envbot "openai api key"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Show Variable Values (`-v`)
|
|
106
|
+
|
|
107
|
+
Read and display the actual value from the `.env` file on-the-fly:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
envbot -v "stripe"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Show Source File Path (`--show-source`)
|
|
114
|
+
|
|
115
|
+
See which `.env` file each variable came from:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
envbot --show-source "database"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Change Number of Results (`-k`)
|
|
122
|
+
|
|
123
|
+
By default, 3 results are returned. Get more:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
envbot -k 10 "api key"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Combine All Flags
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
envbot -v --show-source -k 5 "mongodb"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Rebuild the Index
|
|
136
|
+
|
|
137
|
+
Re-scan all configured drives and rebuild the search database:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
envbot --reindex
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### View Help
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
envbot --help
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## How It Works
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
+------------------+ +------------------+ +------------------+
|
|
155
|
+
| 1. SCAN | --> | 2. PARSE | --> | 3. EMBED |
|
|
156
|
+
| Recursively | | Extract variable | | Generate vector |
|
|
157
|
+
| find .env files | | names (no values)| | embeddings via |
|
|
158
|
+
| across drives | | from all files | | SentenceTransf. |
|
|
159
|
+
+------------------+ +------------------+ +------------------+
|
|
160
|
+
|
|
|
161
|
+
v
|
|
162
|
+
+------------------+ +------------------+ +------------------+
|
|
163
|
+
| 6. DISPLAY | <-- | 5. RANK | <-- | 4. INDEX |
|
|
164
|
+
| Rich table with | | Cosine similar. | | Store vectors |
|
|
165
|
+
| colors & values | | via FAISS | | in FAISS index |
|
|
166
|
+
+------------------+ +------------------+ +------------------+
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Architecture
|
|
170
|
+
|
|
171
|
+
| File | Purpose |
|
|
172
|
+
|---------------|---------------------------------------------------------|
|
|
173
|
+
| `cli.py` | Entry point, argument parsing, Rich UI rendering |
|
|
174
|
+
| `scanner.py` | Recursively walks drives/directories for `.env` files |
|
|
175
|
+
| `parser.py` | Extracts variable names from copied `.env` files |
|
|
176
|
+
| `indexer.py` | Generates embeddings and builds the FAISS vector index |
|
|
177
|
+
| `search.py` | Encodes queries and performs FAISS similarity search |
|
|
178
|
+
|
|
179
|
+
### Security Model
|
|
180
|
+
|
|
181
|
+
- **Values are never stored** in the FAISS index or metadata files.
|
|
182
|
+
- Only variable **names** and **source file paths** are persisted.
|
|
183
|
+
- When you use `-v`, values are read on-the-fly from the local copy at search time.
|
|
184
|
+
- Copied `.env` files are stored in your configured data directory (default: `~/.envbot_data/copied_envs/`).
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Configuration
|
|
189
|
+
|
|
190
|
+
Your configuration is stored at `~/.envbot_config.json`:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"scan_drives": ["D:\\", "E:\\"],
|
|
195
|
+
"data_dir": "C:\\Users\\you\\.envbot_data"
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
| Key | Description |
|
|
200
|
+
|----------------|--------------------------------------------------|
|
|
201
|
+
| `scan_drives` | List of drives (Windows) or directories to scan |
|
|
202
|
+
| `data_dir` | Where the index, metadata, and copies are stored |
|
|
203
|
+
|
|
204
|
+
You can edit this file manually or re-run `envbot --reindex` to use the wizard.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Command Reference
|
|
209
|
+
|
|
210
|
+
| Command | Description |
|
|
211
|
+
|------------------------------------------------|--------------------------------------|
|
|
212
|
+
| `envbot "query"` | Search for matching variables |
|
|
213
|
+
| `envbot -v "query"` | Search and show values |
|
|
214
|
+
| `envbot --show-source "query"` | Search and show source file paths |
|
|
215
|
+
| `envbot -k 10 "query"` | Return up to 10 results |
|
|
216
|
+
| `envbot -v --show-source -k 5 "query"` | All flags combined |
|
|
217
|
+
| `envbot --reindex` | Configure drives and rebuild index |
|
|
218
|
+
| `envbot --help` | Show help message |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Requirements
|
|
223
|
+
|
|
224
|
+
| Package | Version | Purpose |
|
|
225
|
+
|-----------------------|------------|--------------------------------|
|
|
226
|
+
| `sentence-transformers` | >= 2.7.0 | Semantic text embeddings |
|
|
227
|
+
| `faiss-cpu` | >= 1.8.0 | Vector similarity search |
|
|
228
|
+
| `typer` | >= 0.12.0 | CLI framework |
|
|
229
|
+
| `rich` | >= 13.7.0 | Terminal UI (tables, spinners) |
|
|
230
|
+
| `python-dotenv` | >= 1.0.0 | .env file parsing |
|
|
231
|
+
| `numpy` | >= 2.1.0 | Numerical operations |
|
|
232
|
+
| `torch` | >= 2.0.0 | ML backend for transformers |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Platform Support
|
|
237
|
+
|
|
238
|
+
| Platform | Status | Drive/Path Format |
|
|
239
|
+
|----------------|-------------|---------------------------|
|
|
240
|
+
| Windows 10/11 | Supported | `C:\`, `D:\`, `E:\` |
|
|
241
|
+
| macOS | Supported | `/Users/you/projects` |
|
|
242
|
+
| Linux | Supported | `/home/you/projects` |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Troubleshooting
|
|
247
|
+
|
|
248
|
+
### "FAISS index not found" error
|
|
249
|
+
|
|
250
|
+
You need to build the index first:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
envbot --reindex
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Slow first search
|
|
257
|
+
|
|
258
|
+
The first search takes a few seconds because the AI model needs to load into memory. Subsequent searches in the same session are instant.
|
|
259
|
+
|
|
260
|
+
### Permission errors on Windows
|
|
261
|
+
|
|
262
|
+
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.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
MIT License. See [LICENSE](LICENSE) for details.
|