envshield 2.0.0__tar.gz → 2.1.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.
Files changed (46) hide show
  1. envshield-2.1.0/PKG-INFO +225 -0
  2. envshield-2.1.0/README.md +168 -0
  3. envshield-2.1.0/envshield/__init__.py +1 -0
  4. {envshield-2.0.0 → envshield-2.1.0}/envshield/cli.py +7 -3
  5. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/setup_manager.py +12 -11
  6. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/core/test_setup_manager.py +3 -3
  7. envshield-2.1.0/envshield.egg-info/PKG-INFO +225 -0
  8. {envshield-2.0.0 → envshield-2.1.0}/pyproject.toml +2 -2
  9. envshield-2.0.0/PKG-INFO +0 -283
  10. envshield-2.0.0/README.md +0 -226
  11. envshield-2.0.0/envshield/__init__.py +0 -1
  12. envshield-2.0.0/envshield.egg-info/PKG-INFO +0 -283
  13. {envshield-2.0.0 → envshield-2.1.0}/LICENSE.md +0 -0
  14. {envshield-2.0.0 → envshield-2.1.0}/envshield/__main__.py +0 -0
  15. {envshield-2.0.0 → envshield-2.1.0}/envshield/config/__init.py +0 -0
  16. {envshield-2.0.0 → envshield-2.1.0}/envshield/config/manager.py +0 -0
  17. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/__init__.py +0 -0
  18. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/doctor.py +0 -0
  19. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/exceptions.py +0 -0
  20. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/file_updater.py +0 -0
  21. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/inspector.py +0 -0
  22. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/scanner.py +0 -0
  23. {envshield-2.0.0 → envshield-2.1.0}/envshield/core/schema_manager.py +0 -0
  24. {envshield-2.0.0 → envshield-2.1.0}/envshield/parsers/__init__.py +0 -0
  25. {envshield-2.0.0 → envshield-2.1.0}/envshield/parsers/_base.py +0 -0
  26. {envshield-2.0.0 → envshield-2.1.0}/envshield/parsers/_dotenv.py +0 -0
  27. {envshield-2.0.0 → envshield-2.1.0}/envshield/parsers/_python.py +0 -0
  28. {envshield-2.0.0 → envshield-2.1.0}/envshield/parsers/factory.py +0 -0
  29. {envshield-2.0.0 → envshield-2.1.0}/envshield/state.py +0 -0
  30. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/__init__.py +0 -0
  31. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/core/__init__.py +0 -0
  32. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/core/test_doctor.py +0 -0
  33. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/core/test_scanner_compliance.py +0 -0
  34. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/core/test_schema_manager.py +0 -0
  35. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/parsers/__init__.py +0 -0
  36. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/parsers/python_parser.py +0 -0
  37. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/parsers/test_dotenv_parser.py +0 -0
  38. {envshield-2.0.0 → envshield-2.1.0}/envshield/tests/test_cli.py +0 -0
  39. {envshield-2.0.0 → envshield-2.1.0}/envshield/utils/__init__.py +0 -0
  40. {envshield-2.0.0 → envshield-2.1.0}/envshield/utils/git_utils.py +0 -0
  41. {envshield-2.0.0 → envshield-2.1.0}/envshield.egg-info/SOURCES.txt +0 -0
  42. {envshield-2.0.0 → envshield-2.1.0}/envshield.egg-info/dependency_links.txt +0 -0
  43. {envshield-2.0.0 → envshield-2.1.0}/envshield.egg-info/entry_points.txt +0 -0
  44. {envshield-2.0.0 → envshield-2.1.0}/envshield.egg-info/requires.txt +0 -0
  45. {envshield-2.0.0 → envshield-2.1.0}/envshield.egg-info/top_level.txt +0 -0
  46. {envshield-2.0.0 → envshield-2.1.0}/setup.cfg +0 -0
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.4
2
+ Name: envshield
3
+ Version: 2.1.0
4
+ Summary: EnvShield: A CLI for secure local environment management and secret prevention.
5
+ Author-email: Rabbil Yasar Sajal <rabbilyasar@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) [2025] [Rabbil Yasar Sajal]
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Keywords: environment,security,secrets,cli,devops
28
+ Classifier: Development Status :: 4 - Beta
29
+ Classifier: Environment :: Console
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Natural Language :: English
33
+ Classifier: Operating System :: OS Independent
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3.8
36
+ Classifier: Programming Language :: Python :: 3.9
37
+ Classifier: Programming Language :: Python :: 3.10
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Topic :: Security
41
+ Classifier: Topic :: Software Development :: Build Tools
42
+ Classifier: Topic :: Utilities
43
+ Requires-Python: >=3.10
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE.md
46
+ Requires-Dist: PyYAML<7.0,>=6.0
47
+ Requires-Dist: rich<15.0,>=13.0
48
+ Requires-Dist: questionary<3.0,>=2.0
49
+ Requires-Dist: typer[all]<1.0,>=0.9
50
+ Requires-Dist: toml<1.0,>=0.10
51
+ Provides-Extra: dev
52
+ Requires-Dist: ruff; extra == "dev"
53
+ Requires-Dist: pytest; extra == "dev"
54
+ Requires-Dist: pytest-mock; extra == "dev"
55
+ Requires-Dist: bump2version; extra == "dev"
56
+ Dynamic: license-file
57
+
58
+
59
+ # EnvShield 🛡️ – Environment Variable Management & Secret Scanner CLI
60
+
61
+
62
+ [![CI](https://github.com/rabbilyasar/envshield/actions/workflows/ci.yml/badge.svg)](https://github.com/rabbilyasar/envshield/actions/workflows/ci.yml)
63
+ [![PyPI version](https://badge.fury.io/py/envshield.svg)](https://pypi.org/project/envshield/)
64
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
65
+ [![Downloads](https://static.pepy.tech/personalized-badge/envshield?period=month&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/envshield)
66
+ [![Website](https://img.shields.io/badge/Website-envshield.dev-blue?logo=google-chrome&logoColor=white)](https://www.envshield.dev)
67
+ ![Stars](https://img.shields.io/github/stars/rabbilyasar/envshield?style=social)
68
+
69
+ **EnvShield is an open-source CLI for environment variable management, configuration as code, and proactive secret scanning—your caffeine-proof way to avoid the “oops, I just leaked prod keys” nightmare.**
70
+
71
+ [📚 Full Documentation](https://docs.envshield.dev/)
72
+
73
+
74
+ ### Table of Contents
75
+
76
+ 1. [Why Secure Environment Management Matters](#why-secure-environment-management-matters)
77
+ 2. [Key Features of the EnvShield CLI](#key-features-of-the-envshield-cli)
78
+ 3. [Installation](#installation)
79
+
80
+ 4. [The EnvShield Philosophy: Schema-First Configuration](#the-envshield-philosophy-schema-first-configuration)
81
+ 5. [CLI Commands](#cli-commands)
82
+
83
+ 6. [Competitor Comparison: Choosing the Right Tool](#competitor-comparison-choosing-the-right-tool)
84
+
85
+ 7. [The Brains of the Operation: The Core Files](#the-brains-of-the-operation-the-core-files)
86
+
87
+ 8. [Future Roadmap: Teams & Enterprise](#future-roadmap-teams--enterprise)
88
+
89
+ 9. [Community & Support](#community--support)
90
+ 10. [TL;DR](#tldr)
91
+
92
+ ## Why Secure Environment Management Matters
93
+
94
+ Managing `.env` files by copy-pasting them around like a hot potato is fun… until a secret lands in a public repo.
95
+ EnvShield solves the “dotenv dumpster fire” by giving you **schema-first configuration**, automatic documentation, and built-in **secret scanning**—all wrapped in a workflow lazy enough for a 3 a.m. commit.
96
+
97
+
98
+ ## Key Features of the EnvShield CLI
99
+
100
+ ![Demo of EnvShield scanning secrets](.gif/scan.gif)
101
+
102
+ - **Environment Variable Governance** – One `env.schema.toml` file becomes your single source of truth.
103
+
104
+ - **Open-Source Secret Scanner** – Detects API keys, private keys, and other credentials _before_ you push.
105
+
106
+ - **Local Development Workflow** – Automatic `.env.example` syncing and onboarding that even future-you will thank you for.
107
+
108
+ - **Git Pre-commit Hook** – Blocks secret leaks faster than you can say `git push --force`.
109
+
110
+ - **Configuration as Code** – Your environment config is version-controlled and documented like real code.
111
+
112
+ _(Translation: EnvShield is that overprotective friend who checks the door lock five times so you can sleep.)_
113
+
114
+ ## Installation
115
+ Requires **Python 3.10+**.
116
+ ```bash
117
+ pip install envshield
118
+ envshield --help
119
+ ```
120
+ Done. Your project is now 72 % less combustible.
121
+
122
+ ## The EnvShield Philosophy: Schema-First Configuration
123
+
124
+ EnvShield's power comes from a simple idea: your configuration should be treated like code. It introduces a single source of truth, the `env.schema.toml` file.
125
+
126
+ This file is a **"configuration contract"** that explicitly defines every environment variable your project needs. By defining your variables here, you get:
127
+
128
+ - **Automated Documentation**: Your `.env.example` is always perfectly in sync with your schema.
129
+ - **Ironclad Validation**: Catch typos and missing variables before you even run your app.
130
+ - **Proactive Security**: A built-in scanner and Git hook **prevent secrets from ever being committed**.
131
+
132
+ ## CLI Commands
133
+
134
+ | Command | Purpose | Demo |
135
+ |---|---|---|
136
+ | `envshield init` | Auto-detects framework, creates env.schema.toml, installs the Git hook. | ![Demo of EnvShield init](.gif/init.gif) |
137
+ | `envshield scan` | Scans files or staged commits for secrets. | ![Demo of EnvShield scan](.gif/scan.gif) |
138
+ | `envshield install-hook` | Manually install or update the Git pre-commit hook. | For when you skipped step one because YOLO. |
139
+ | `envshield check <file>` | Validates a local .env file against the schema. | ![Demo of EnvShield check](.gif/check.gif) |
140
+ | `envshield schema sync` | Regenerates .env.example from the schema. | ![Demo of EnvShield sync](.gif/sync.gif) |
141
+ | `envshield setup` | Interactive onboarding to create a local env. | ![Demo of EnvShield setup](.gif/setup.gif) |
142
+ | `envshield doctor` | Runs a full health check (and can auto-fix). | ![Demo of EnvShield check](.gif/check.gif) |
143
+
144
+
145
+ ## Competitor Comparison: Choosing the Right Tool
146
+
147
+ A scanner is a smoke detector. A cloud vault is an off-site bank. **EnvShield is the fireproof, self-organizing house you should have been living in all along.** It provides the complete local workflow that developers need to prevent secret leaks in the first place.
148
+
149
+ | **Developer Pain Point** | **EnvShield** 🛡️ | **TruffleHog / Gitleaks** | **Doppler / Infisical** | **`direnv`** |
150
+ | :------------------------------------ | :----------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :-------------------------------- |
151
+ | **Preventing Secret Commits** | ✅ **Built-in**. `init` sets up an automated pre-commit hook. | ✅ **Core feature**. Specialized tools for just finding secrets. | ❌ **Indirectly**. Doesn't actively scan commits. | ❌ **Not addressed.** |
152
+ | **Streamlining Developer Onboarding** | ✅ **Automated**. The `setup` command interactively creates a local `.env` file from the project's template. | ❌ **Not addressed.** | ✅ **Strong**. Provides a central place to get secrets, but doesn't manage local files. | ❌ **Not addressed.** |
153
+ | **Preventing Configuration Drift** | ✅ **Solved**. The schema is the source of truth. `schema sync` and `check` enforce consistency. | ❌ **Not addressed.** | ✅ **Solved**. The cloud is the single source of truth. | ❌ **Not addressed.** |
154
+ | **Primary Focus** | **Complete Local Workflow**. Manages files, documents schemas, validates setups, and scans for leaks. | **Secret Detection Engine.** | **Cloud-Based Secret** Vault. | **Shell Environment Automation.** |
155
+
156
+ Think of scanners as smoke detectors and cloud vaults as off-site banks.
157
+ **EnvShield is the fire-proof, self-organizing house you should have been living in all along.**
158
+
159
+ ## The Brains of the Operation: The Core Files
160
+
161
+ `envshield` is managed by two simple files you commit to your repository.
162
+
163
+ - `env.schema.toml`: The source of truth. This is where you define every variable your project needs.
164
+
165
+ ```
166
+ # env.schema.toml
167
+
168
+ [DATABASE_URL]
169
+ description = "The full connection string for the PostgreSQL database."
170
+ secret = true # Marks this as sensitive
171
+
172
+ [LOG_LEVEL]
173
+ description = "Controls the application's log verbosity."
174
+ secret = false
175
+ defaultValue = "info" # Provides a fallback
176
+ ```
177
+
178
+ - `envshield.yml`: The workflow config. In Phase 1, it's very simple and mainly points to your schema and defines scanner exclusions.
179
+
180
+ ## Future Roadmap: Teams & Enterprise✨
181
+
182
+ Phase 1 is the free, powerful "Local Guardian." But the journey doesn't end there. Upcoming paid tiers will turn `envshield` into a complete collaboration and automation platform.
183
+
184
+ ### Phase 2: The Team Collaborator (Paid Tier)
185
+
186
+ - `envshield use <profile>`: Instantly switch your entire project's configuration between different environments (e.g., `local`, `staging`).
187
+
188
+ - `envshield onboard <profile>`: A supercharged `setup` that can also run scripts like` docker compose up` and database migrations for a true one-command setup.
189
+
190
+ - `envshield share`: Securely share a secret with a teammate via an encrypted, one-time-use link.
191
+
192
+ - `envshield docs`: Generate beautiful Markdown or HTML documentation from your schema.
193
+
194
+ ### Phase 3: The Enterprise-Grade System (Paid Tier)
195
+
196
+ - `envshield login`, `pull`, `push`: Full integration with a centralized, cloud-based secret vault.
197
+
198
+ - `envshield export`: Securely inject secrets into your CI/CD pipelines for automated deployments.
199
+
200
+ - **Audit Logs & RBAC**: A complete, compliant, and auditable history of all secret access and team permissions, managed through a web dashboard.
201
+
202
+ ## **Community & Support**
203
+
204
+ Got questions? Have a brilliant idea? Come hang out with us!
205
+
206
+ - 🤔 **Ask a question on GitHub Discussions:**[Discussions](https://github.com/rabbilyasar/envshield/discussions/)
207
+
208
+ Or, Follow us on our socials:
209
+
210
+ ## 🌍 Community & Links
211
+
212
+ - 🌐 Website: [envshield.dev](https://www.envshield.dev)
213
+ - 🐙 GitHub: [rabbilyasar/envshield](https://github.com/rabbilyasar/envshield)
214
+ - 🐍 PyPI: [EnvShield on PyPI](https://pypi.org/project/envshield/)
215
+ - 🤔 GitHub Discussions: [GitHub Discussions](https://github.com/rabbilyasar/envshield/discussions)
216
+ - 💬 Join our Discord:[@discord](https://discord.gg/dSEbvPW57N)
217
+
218
+ ## **Contributing (Don't Be Shy)**
219
+
220
+ Spotted a bug? Think our jokes are terrible? We want to hear it all. Check out `CONTRIBUTING.md` to get started.
221
+
222
+ ### TL;DR
223
+
224
+ **EnvShield = environment variable management + secret scanning + configuration as code + just enough sarcasm to keep you awake.**
225
+ Stop leaking secrets. Start shipping securely.
@@ -0,0 +1,168 @@
1
+
2
+ # EnvShield 🛡️ – Environment Variable Management & Secret Scanner CLI
3
+
4
+
5
+ [![CI](https://github.com/rabbilyasar/envshield/actions/workflows/ci.yml/badge.svg)](https://github.com/rabbilyasar/envshield/actions/workflows/ci.yml)
6
+ [![PyPI version](https://badge.fury.io/py/envshield.svg)](https://pypi.org/project/envshield/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![Downloads](https://static.pepy.tech/personalized-badge/envshield?period=month&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/envshield)
9
+ [![Website](https://img.shields.io/badge/Website-envshield.dev-blue?logo=google-chrome&logoColor=white)](https://www.envshield.dev)
10
+ ![Stars](https://img.shields.io/github/stars/rabbilyasar/envshield?style=social)
11
+
12
+ **EnvShield is an open-source CLI for environment variable management, configuration as code, and proactive secret scanning—your caffeine-proof way to avoid the “oops, I just leaked prod keys” nightmare.**
13
+
14
+ [📚 Full Documentation](https://docs.envshield.dev/)
15
+
16
+
17
+ ### Table of Contents
18
+
19
+ 1. [Why Secure Environment Management Matters](#why-secure-environment-management-matters)
20
+ 2. [Key Features of the EnvShield CLI](#key-features-of-the-envshield-cli)
21
+ 3. [Installation](#installation)
22
+
23
+ 4. [The EnvShield Philosophy: Schema-First Configuration](#the-envshield-philosophy-schema-first-configuration)
24
+ 5. [CLI Commands](#cli-commands)
25
+
26
+ 6. [Competitor Comparison: Choosing the Right Tool](#competitor-comparison-choosing-the-right-tool)
27
+
28
+ 7. [The Brains of the Operation: The Core Files](#the-brains-of-the-operation-the-core-files)
29
+
30
+ 8. [Future Roadmap: Teams & Enterprise](#future-roadmap-teams--enterprise)
31
+
32
+ 9. [Community & Support](#community--support)
33
+ 10. [TL;DR](#tldr)
34
+
35
+ ## Why Secure Environment Management Matters
36
+
37
+ Managing `.env` files by copy-pasting them around like a hot potato is fun… until a secret lands in a public repo.
38
+ EnvShield solves the “dotenv dumpster fire” by giving you **schema-first configuration**, automatic documentation, and built-in **secret scanning**—all wrapped in a workflow lazy enough for a 3 a.m. commit.
39
+
40
+
41
+ ## Key Features of the EnvShield CLI
42
+
43
+ ![Demo of EnvShield scanning secrets](.gif/scan.gif)
44
+
45
+ - **Environment Variable Governance** – One `env.schema.toml` file becomes your single source of truth.
46
+
47
+ - **Open-Source Secret Scanner** – Detects API keys, private keys, and other credentials _before_ you push.
48
+
49
+ - **Local Development Workflow** – Automatic `.env.example` syncing and onboarding that even future-you will thank you for.
50
+
51
+ - **Git Pre-commit Hook** – Blocks secret leaks faster than you can say `git push --force`.
52
+
53
+ - **Configuration as Code** – Your environment config is version-controlled and documented like real code.
54
+
55
+ _(Translation: EnvShield is that overprotective friend who checks the door lock five times so you can sleep.)_
56
+
57
+ ## Installation
58
+ Requires **Python 3.10+**.
59
+ ```bash
60
+ pip install envshield
61
+ envshield --help
62
+ ```
63
+ Done. Your project is now 72 % less combustible.
64
+
65
+ ## The EnvShield Philosophy: Schema-First Configuration
66
+
67
+ EnvShield's power comes from a simple idea: your configuration should be treated like code. It introduces a single source of truth, the `env.schema.toml` file.
68
+
69
+ This file is a **"configuration contract"** that explicitly defines every environment variable your project needs. By defining your variables here, you get:
70
+
71
+ - **Automated Documentation**: Your `.env.example` is always perfectly in sync with your schema.
72
+ - **Ironclad Validation**: Catch typos and missing variables before you even run your app.
73
+ - **Proactive Security**: A built-in scanner and Git hook **prevent secrets from ever being committed**.
74
+
75
+ ## CLI Commands
76
+
77
+ | Command | Purpose | Demo |
78
+ |---|---|---|
79
+ | `envshield init` | Auto-detects framework, creates env.schema.toml, installs the Git hook. | ![Demo of EnvShield init](.gif/init.gif) |
80
+ | `envshield scan` | Scans files or staged commits for secrets. | ![Demo of EnvShield scan](.gif/scan.gif) |
81
+ | `envshield install-hook` | Manually install or update the Git pre-commit hook. | For when you skipped step one because YOLO. |
82
+ | `envshield check <file>` | Validates a local .env file against the schema. | ![Demo of EnvShield check](.gif/check.gif) |
83
+ | `envshield schema sync` | Regenerates .env.example from the schema. | ![Demo of EnvShield sync](.gif/sync.gif) |
84
+ | `envshield setup` | Interactive onboarding to create a local env. | ![Demo of EnvShield setup](.gif/setup.gif) |
85
+ | `envshield doctor` | Runs a full health check (and can auto-fix). | ![Demo of EnvShield check](.gif/check.gif) |
86
+
87
+
88
+ ## Competitor Comparison: Choosing the Right Tool
89
+
90
+ A scanner is a smoke detector. A cloud vault is an off-site bank. **EnvShield is the fireproof, self-organizing house you should have been living in all along.** It provides the complete local workflow that developers need to prevent secret leaks in the first place.
91
+
92
+ | **Developer Pain Point** | **EnvShield** 🛡️ | **TruffleHog / Gitleaks** | **Doppler / Infisical** | **`direnv`** |
93
+ | :------------------------------------ | :----------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | :-------------------------------- |
94
+ | **Preventing Secret Commits** | ✅ **Built-in**. `init` sets up an automated pre-commit hook. | ✅ **Core feature**. Specialized tools for just finding secrets. | ❌ **Indirectly**. Doesn't actively scan commits. | ❌ **Not addressed.** |
95
+ | **Streamlining Developer Onboarding** | ✅ **Automated**. The `setup` command interactively creates a local `.env` file from the project's template. | ❌ **Not addressed.** | ✅ **Strong**. Provides a central place to get secrets, but doesn't manage local files. | ❌ **Not addressed.** |
96
+ | **Preventing Configuration Drift** | ✅ **Solved**. The schema is the source of truth. `schema sync` and `check` enforce consistency. | ❌ **Not addressed.** | ✅ **Solved**. The cloud is the single source of truth. | ❌ **Not addressed.** |
97
+ | **Primary Focus** | **Complete Local Workflow**. Manages files, documents schemas, validates setups, and scans for leaks. | **Secret Detection Engine.** | **Cloud-Based Secret** Vault. | **Shell Environment Automation.** |
98
+
99
+ Think of scanners as smoke detectors and cloud vaults as off-site banks.
100
+ **EnvShield is the fire-proof, self-organizing house you should have been living in all along.**
101
+
102
+ ## The Brains of the Operation: The Core Files
103
+
104
+ `envshield` is managed by two simple files you commit to your repository.
105
+
106
+ - `env.schema.toml`: The source of truth. This is where you define every variable your project needs.
107
+
108
+ ```
109
+ # env.schema.toml
110
+
111
+ [DATABASE_URL]
112
+ description = "The full connection string for the PostgreSQL database."
113
+ secret = true # Marks this as sensitive
114
+
115
+ [LOG_LEVEL]
116
+ description = "Controls the application's log verbosity."
117
+ secret = false
118
+ defaultValue = "info" # Provides a fallback
119
+ ```
120
+
121
+ - `envshield.yml`: The workflow config. In Phase 1, it's very simple and mainly points to your schema and defines scanner exclusions.
122
+
123
+ ## Future Roadmap: Teams & Enterprise✨
124
+
125
+ Phase 1 is the free, powerful "Local Guardian." But the journey doesn't end there. Upcoming paid tiers will turn `envshield` into a complete collaboration and automation platform.
126
+
127
+ ### Phase 2: The Team Collaborator (Paid Tier)
128
+
129
+ - `envshield use <profile>`: Instantly switch your entire project's configuration between different environments (e.g., `local`, `staging`).
130
+
131
+ - `envshield onboard <profile>`: A supercharged `setup` that can also run scripts like` docker compose up` and database migrations for a true one-command setup.
132
+
133
+ - `envshield share`: Securely share a secret with a teammate via an encrypted, one-time-use link.
134
+
135
+ - `envshield docs`: Generate beautiful Markdown or HTML documentation from your schema.
136
+
137
+ ### Phase 3: The Enterprise-Grade System (Paid Tier)
138
+
139
+ - `envshield login`, `pull`, `push`: Full integration with a centralized, cloud-based secret vault.
140
+
141
+ - `envshield export`: Securely inject secrets into your CI/CD pipelines for automated deployments.
142
+
143
+ - **Audit Logs & RBAC**: A complete, compliant, and auditable history of all secret access and team permissions, managed through a web dashboard.
144
+
145
+ ## **Community & Support**
146
+
147
+ Got questions? Have a brilliant idea? Come hang out with us!
148
+
149
+ - 🤔 **Ask a question on GitHub Discussions:**[Discussions](https://github.com/rabbilyasar/envshield/discussions/)
150
+
151
+ Or, Follow us on our socials:
152
+
153
+ ## 🌍 Community & Links
154
+
155
+ - 🌐 Website: [envshield.dev](https://www.envshield.dev)
156
+ - 🐙 GitHub: [rabbilyasar/envshield](https://github.com/rabbilyasar/envshield)
157
+ - 🐍 PyPI: [EnvShield on PyPI](https://pypi.org/project/envshield/)
158
+ - 🤔 GitHub Discussions: [GitHub Discussions](https://github.com/rabbilyasar/envshield/discussions)
159
+ - 💬 Join our Discord:[@discord](https://discord.gg/dSEbvPW57N)
160
+
161
+ ## **Contributing (Don't Be Shy)**
162
+
163
+ Spotted a bug? Think our jokes are terrible? We want to hear it all. Check out `CONTRIBUTING.md` to get started.
164
+
165
+ ### TL;DR
166
+
167
+ **EnvShield = environment variable management + secret scanning + configuration as code + just enough sarcasm to keep you awake.**
168
+ Stop leaking secrets. Start shipping securely.
@@ -0,0 +1 @@
1
+ __version__ = "2.1.0"
@@ -141,10 +141,14 @@ def doctor_command(
141
141
 
142
142
 
143
143
  @app.command()
144
- def setup():
145
- """Interactively creates a local .env file from .env.example."""
144
+ def setup(
145
+ output_file: str = typer.Argument(
146
+ ".env", help="The name of the local environment file to create."
147
+ ),
148
+ ):
149
+ """Interactively creates a local environment file from .env.example."""
146
150
  try:
147
- setup_manager.run_setup()
151
+ setup_manager.run_setup(output_file)
148
152
  except EnvShieldException as e:
149
153
  console.print(f"[bold red]Error:[/bold red] {e}")
150
154
  raise typer.Exit(code=1)
@@ -9,13 +9,12 @@ from typing import Dict, List
9
9
  import questionary
10
10
  from rich.console import Console
11
11
  from rich.panel import Panel
12
+ from rich.prompt import Prompt
12
13
 
13
14
  from .exceptions import EnvShieldException
14
- from rich.prompt import Prompt
15
15
 
16
16
  console = Console()
17
17
  EXAMPLE_FILE = ".env.example"
18
- OUTPUT_FILE = ".env"
19
18
 
20
19
 
21
20
  def _is_secret_key(key: str) -> bool:
@@ -26,13 +25,16 @@ def _is_secret_key(key: str) -> bool:
26
25
  )
27
26
 
28
27
 
29
- def run_setup():
28
+ def run_setup(output_file: str = ".env"):
30
29
  """
31
- Guides a user through creating their local .env file from .env.example.
30
+ Guides a user through creating their local env file from .env.example.
31
+
32
+ Args:
33
+ output_file: The name of the file to create (e.g., '.env' or '.env.local').
32
34
  """
33
35
  console.print(
34
36
  Panel(
35
- f"[bold cyan]Welcome to EnvShield Setup[/bold cyan]\n\nThis wizard will help you create your local [magenta]{OUTPUT_FILE}[/magenta] file.",
37
+ f"[bold cyan]Welcome to EnvShield Setup[/bold cyan]\n\nThis wizard will help you create your local [magenta]{output_file}[/magenta] file.",
36
38
  title="✨ Local Setup ✨",
37
39
  border_style="green",
38
40
  )
@@ -44,9 +46,9 @@ def run_setup():
44
46
  f"'{EXAMPLE_FILE}' not found. Please run 'envshield schema sync' first to generate it."
45
47
  )
46
48
 
47
- if os.path.exists(OUTPUT_FILE):
49
+ if os.path.exists(output_file):
48
50
  overwrite = questionary.confirm(
49
- f"A '{OUTPUT_FILE}' file already exists. Do you want to overwrite it?",
51
+ f"A '{output_file}' file already exists. Do you want to overwrite it?",
50
52
  default=False,
51
53
  ).ask()
52
54
  if not overwrite:
@@ -93,12 +95,11 @@ def run_setup():
93
95
 
94
96
  # Step 4: Write the new .env file
95
97
  try:
96
- with open(OUTPUT_FILE, "w") as f:
98
+ with open(output_file, "w") as f:
97
99
  f.write(
98
100
  f"# Auto-generated by 'envshield setup' on {datetime.datetime.now().strftime('%Y-%m-%d')}\n\n"
99
101
  )
100
102
  for key, value in final_vars.items():
101
- # More robustly quote values that contain special characters or spaces.
102
103
  if (
103
104
  re.search(r"[#\s=]", value)
104
105
  and not (value.startswith("'") and value.endswith("'"))
@@ -108,7 +109,7 @@ def run_setup():
108
109
  else:
109
110
  f.write(f"{key}={value}\n")
110
111
  console.print(
111
- f"\n[bold green]✓ Successfully created your [magenta]{OUTPUT_FILE}[/magenta] file![/bold green]"
112
+ f"\n[bold green]✓ Successfully created your [magenta]{output_file}[/magenta] file![/bold green]"
112
113
  )
113
114
  except IOError as e:
114
- raise EnvShieldException(f"Could not write to '{OUTPUT_FILE}': {e}")
115
+ raise EnvShieldException(f"Could not write to '{output_file}': {e}")
@@ -33,7 +33,7 @@ def test_setup_command_happy_path(mocker, tmp_path):
33
33
  assert result.exit_code == 0
34
34
  assert "Successfully created" in result.stdout
35
35
 
36
- with open(setup_manager.OUTPUT_FILE, "r") as f:
36
+ with open(".env", "r") as f:
37
37
  content = f.read()
38
38
  assert "LOG_LEVEL=info" in content
39
39
  assert (
@@ -56,7 +56,7 @@ def test_setup_command_overwrite_declined(mocker, tmp_path):
56
56
  with runner.isolated_filesystem(temp_dir=tmp_path):
57
57
  with open(setup_manager.EXAMPLE_FILE, "w") as f:
58
58
  f.write("KEY=VALUE\n")
59
- with open(setup_manager.OUTPUT_FILE, "w") as f:
59
+ with open(".env", "w") as f:
60
60
  f.write("OLD_KEY=OLD_VALUE")
61
61
 
62
62
  mocker.patch(
@@ -69,6 +69,6 @@ def test_setup_command_overwrite_declined(mocker, tmp_path):
69
69
  assert result.exit_code == 0
70
70
  assert "Setup cancelled" in result.stdout
71
71
 
72
- with open(setup_manager.OUTPUT_FILE, "r") as f:
72
+ with open(".env", "r") as f:
73
73
  content = f.read()
74
74
  assert content == "OLD_KEY=OLD_VALUE"