In the development or maintenance of DeepSeek Harness (DSH), environment variable (.env) management is often a hidden pain point: variables may be referenced in code but forgotten to be defined in configuration files, or defined but never used, which can lead to deployment failures or resource waste. The dsh-env-manager plugin provides automated validation and configuration template generation.
This is a locally run Node.js tool with no network dependencies, maintained by user uckkk and categorized under admin-security. Its core problem is: how to quickly validate consistency between code references and configuration files, and generate a standardized .env.example file.
Installation and Activation¶
To install the plugin, run the following command in the terminal:
dsh plugin add dsh-env-manager
After successful installation, configure dsh.profile.bundles in the project’s package.json by adding "dsh-env-manager" to ensure the plugin is loaded correctly at startup.
Core Features¶
The plugin mainly includes two tools that manage this by comparing scanned code with configuration files.
1. Reference Detection and Comparison¶
Scans the project code, identifies common environment variable reference patterns (such as process.env.X, process.env["X"], import.meta.env.X, os.getenv("X"), etc.), compares them with the contents of the .env file, and returns a list of “missing” and “unused” variables.
2. Generate a Redacted Example¶
Based on the existing .env file, generates a .env.example file. The file retains all key names while replacing specific values with masking symbols (such as ***), making it easier for teams to share configuration templates without exposing sensitive information.
3. Intelligent Scan Scope¶
The scanning process automatically skips the node_modules and .git directories, as well as binary and image files, parsing only source code.
Typical Usage¶
In a DSH session, call the above features by specifying the working directory:
- Check for missing or unused environment variables in the project:
env_check(root="/workspace")
- Generate a redacted
.env.examplefrom the existing.env:
env_example(root="/workspace")
Notes¶
The plugin is implemented purely in Node.js, does not make any network requests, and does not depend on external services. However, because it runs third-party code directly in the context of the current DSH process, it is recommended that you review the source code before installation to ensure security.
For more technical details or updates, please visit the GitHub repository.