env-setup

Configure encrypted environment variables with dotenvx, direnv, and Git worktrees.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/kazuph/dotfiles --skill env-setup-kazuph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-setup
Source: https://github.com/kazuph/dotfiles/tree/main/plugins/dotenvx-direnv-worktree/skills/dotenvx-direnv-setup
Command: npx skills add https://github.com/kazuph/dotfiles --skill env-setup-kazuph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the setup of secure and efficient environment variable management, especially crucial for development workflows involving multiple branches or worktrees. It ensures that sensitive information is encrypted at rest and only decrypted in memory when needed.

Core Features & Use Cases

  • Encrypted Environment Variables: Utilizes dotenvx to encrypt .env files, ensuring sensitive data like API keys and database credentials are never exposed on disk.
  • Automatic Loading: Integrates with direnv to automatically load environment variables based on the directory, simplifying setup for different projects and worktrees.
  • Git Worktree Compatibility: Designed to work seamlessly with Git worktrees, allowing each worktree to have its own isolated and securely managed environment variables.
  • Use Case: When starting a new feature in a separate Git worktree, this Skill ensures that all necessary API keys and configurations are securely loaded and available without manual intervention or risk of exposure.

Quick Start

Set up secure environment variable management by encrypting your .env file and configuring direnv.

Frequently Asked Questions about env-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I encrypt environment variables in a Git worktree?

Git worktree environment variable isolation is achieved by combining dotenvx for encrypted `.env` files with direnv for automatic loading, ensuring each worktree maintains its own securely managed configuration without manual intervention.

What is the best way to automatically load environment variables per directory?

The best way to automatically load environment variables per directory is using direnv, which hooks into your shell to load variables based on the current directory, simplifying setup for different projects and worktrees.

How does dotenvx keep environment variables secure at rest?

Dotenvx keeps environment variables secure at rest by encrypting `.env` files on disk, so sensitive information like API keys and database credentials are never exposed and only decrypted in memory during process execution.

Can I use encrypted .env files across multiple Git worktrees?

Yes, encrypted `.env` files work across multiple Git worktrees by integrating dotenvx encryption with direnv automatic loading, allowing each worktree to have its own isolated and securely managed environment variables.

Do I need direnv to manage environment variables with dotenvx?

While dotenvx handles encryption, you need direnv to achieve automatic environment variable loading per directory, which is essential for seamless integration with Git worktrees during parallel development workflows.