Skip to content
Back to skills

Direnv

BSecurity

direnv automatically loads/unloads environment variables when you cd into a directory. No more source .env — enter the project folder and variables are set.

  • 67 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 10, 2026
developmentpythonbashsqlnodegitapidatabase

Works with

  • api

Security analysis

B88/100
  • criticalSends environment variables or credentials to an external URL

Pro shows the line behind each finding and how to fix it

Scanned November 10, 2026

npx -y skills add ComeOnOliver/skillshub --skill direnv --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Direnv?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Direnv
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-direnv/badge)](https://www.skillsdirectory.com/skills/comeonoliver-direnv)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# direnv

## Overview
direnv automatically loads/unloads environment variables when you cd into a directory. No more source .env — enter the project folder and variables are set.

## Instructions

### Step 1: Install
```bash
brew install direnv
# Add to .bashrc or .zshrc:
eval "$(direnv hook bash)"
```

### Step 2: Configure
```bash
# .envrc — Auto-loaded when entering directory
export DATABASE_URL="postgresql://localhost:5432/myapp"
export API_KEY="sk-dev-key-123"
export NODE_ENV="development"
dotenv .env
PATH_add bin
PATH_add node_modules/.bin
```

```bash
direnv allow    # required first time and after changes
```

### Step 3: Per-Project Layouts
```bash
# .envrc — Use specific versions
use nvm 20
layout python3
```

## Guidelines
- Always add .envrc to .gitignore — it contains secrets.
- Use .envrc.example (committed) as template.
- direnv unloads vars when you leave the directory — no env pollution.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.