Skip to content

Conversation

@GreenHacker420
Copy link
Contributor

Summary

Add the ability to import environment variables from existing .env and JSON files, complementing the existing export feature.

Features Added

  • Import from .env files: Parse standard .env format with support for quoted values
  • Import from JSON files: Parse JSON objects into environment variables
  • Comment preservation: Comments above variables in .env files are imported as descriptions
  • Duplicate handling: Choose to skip or overwrite existing variables
  • File upload: Drag-and-drop or browse to upload files
  • Auto-format detection: Automatically detect format based on file extension
  • Detailed feedback: Shows count of imported, updated, and skipped variables

Technical Implementation

  • Added envvars:import IPC handler in backend
  • Created ImportEnvModal component with intuitive UI
  • Integrated import button in ProjectView
  • All imports are tracked in audit logs
  • Maintains encryption for all imported values

Use Cases

  • Migrate existing projects to ENV Storage Manager
  • Bulk import configuration from other tools
  • Share environment configurations across teams
  • Quick setup for new projects

Testing

  • Tested with .env format (with and without quotes)
  • Tested with JSON format
  • Tested duplicate key handling (skip/overwrite modes)
  • Tested comment preservation from .env files
  • Verified encryption of imported values
  • Confirmed audit log entries

Screenshots

The Import button is now available in the project view, allowing users to:

  1. Upload or paste .env or JSON content
  2. Choose format (.env or JSON)
  3. Toggle overwrite mode for existing keys
  4. See detailed import results

Related

  • Complements existing export functionality
  • Follows the same format standards as export

- Add import handler supporting .env and JSON formats
- Parse .env files with comment preservation as descriptions
- Support overwrite mode for existing variables
- Add ImportEnvModal component with file upload
- Integrate import button in ProjectView
- Track import operations in audit logs
- Handle duplicate keys with skip/overwrite options
});

if (result.success) {
const { imported, updated, skipped, total, errors } = result.data;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable total.
@curiouscoder-cmd curiouscoder-cmd merged commit cdcc0bf into curiouscoder-cmd:main Oct 11, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants