
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
rrr
A simple Python package to manage environment variables in your .env
file with command-line interface.
pipx install mydotenv
pip install mydotenv
git clone https://github.com/banddude/mydotenv.git
cd mydotenv
pip install -e .
mydotenv API_KEY
mydotenv NEW_KEY=value
mydotenv "KEY_WITH_SPACES=value with spaces"
mydotenv delete VARIABLE_NAME
mydotenv
You can set a custom command name to use instead of mydotenv
:
mydotenv --set-command dotman
Now you can use either mydotenv
or dotman
to run commands:
dotman NEW_KEY=value
dotman delete NEW_KEY
When you set a new command name, it replaces any previous custom command name.
The new CLI functionality lets you scan your codebase for env.VARIABLE_NAME
references and manage your .env
file based on what it finds:
.env
with newly discovered variables (empty values):mydotenv --replace env [<path>]
mydotenv --add-empty env [<path>]
mydotenv --add env [<path>]
You can rewrite Python files to directly access environment variables without needing to use the env
object:
# Rewrite imports for a specific file or directory
mydotenv --add imports [<path>]
# Rewrite imports for all Python files in the current directory
mydotenv --add imports
This will:
import mydotenv
or from mydotenv import ...
statements.env
file from your projectFor example, if your .env
contains API_KEY=123
, you can simply do:
# This works after running mydotenv --add imports on your file
print(API_KEY) # Prints: 123
No more need for: from mydotenv import env
and print(env.API_KEY)
!
--ignore
: Specify paths to ignore when scanningmydotenv --add env . --ignore tests venv
--env-file
: Specify which .env file to use (default: .env
)mydotenv --replace env . --env-file .env.dev
.env
file.env
file in your current directory.env
files based on discovered variables~/.config/mydotenv/config.env
~/.local/bin
MIT License - feel free to use this package in your projects!
FAQs
A simple package to manage environment variables with command-line interface
We found that mydotenv demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.