direnv
Skill4 starsChanged 6 months agoMITView on GitHub
How to maintain credentials and authenticate using direnv without exposing secrets to the output.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- brpaz/agent-skillstheir own version, first seen May 17, 2026
- moabualruz/fulcrumtheir own version, first seen Apr 28, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- moabualruz/fulcrum★ 4same name
- brpaz/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-codespaceSkill
- gh-issueSkill
- gh-modelsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Authorize Directory: Run direnv allow <path-to-env-dir> to approve the environment variables.
- Very specific: line 16
Export Variables: Run eval "$(direnv export bash)" to inject the variables into the current session.
- Distinctive: line 20
Security Focus: Never print, echo, or expose API keys and secrets in the terminal output.
- Very specific: line 21
Session Persistence: Always follow direnv allow with eval "$(direnv export bash)" to ensure the agent's shell session properly loads the …
- Distinctive: line 25
When you need to automatically load environment variables upon entering a specific project directory.
- Very specific: line 27
When an agent needs to execute commands that depend on project-specific credentials stored in .env.
- Very specific: line 33
When running commands in isolated, ephemeral Docker containers where environment variables are passed via --env-file.
- Very specific: line 63
Do not manually source or cat .env files.
- Very specific: line 64
Do not run direnv allow without immediately running eval "$(direnv export bash)" within the same execution context.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: direnv
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->Guidance for using direnv to securely maintain credentials and load environment variables without exposing them in agent outputs.
Core Process
- Setup Environment: Copy
.env.exampleto.envif.envdoes not exist and needs configuration. - Authorize Directory: Run
direnv allow <path-to-env-dir>to approve the environment variables. - Export Variables: Run
eval "$(direnv export bash)"to inject the variables into the current session.
Core Principles
- Security Focus: Never print, echo, or expose API keys and secrets in the terminal output.
- Session Persistence: Always follow
direnv allowwitheval "$(direnv export bash)"to ensure the agent's shell session properly loads the variables, as standard direnv shell hooks may not be active.
When to Use
- When you need to automatically load environment variables upon entering a specific project directory.
- To safely manage API keys and secrets in local development without committing them to version control.
- When an agent needs to execute commands that depend on project-specific credentials stored in
.env.
When Not to Use
- In production CI/CD pipelines where secrets are securely injected by the runner environment (like GitHub Actions secrets).
- For managing global, system-wide environment variables (use
~/.bashrcor~/.profileinstead). - When running commands in isolated, ephemeral Docker containers where environment variables are passed via
--env-file.
Common Pitfalls
- Forgetting to Eval: Running
direnv allowbut forgetting to runeval "$(direnv export bash)", meaning the variables never actually load into the agent's current shell session. - Committing Secrets: Adding sensitive keys to
.envbut failing to ensure.envis listed in the project's.gitignore. - Assuming Global State: Expecting
direnvvariables to persist if the agent changes directories (cd ..), which naturally unloads them.
Commands / Usage Patterns
To authenticate when API keys are missing (e.g., loading from ../../):
direnv allow ../../
eval "$(direnv export bash)"Full Workflow Example
Example usage for maintaining credentials and running commands from a subdirectory:
cp ../../.env.example ../../.env
# Edit ../../.env and set real values using file editing tools
direnv allow ../../
eval "$(direnv export bash)"What to Avoid
- Do not manually
sourceorcat.envfiles. - Do not run
direnv allowwithout immediately runningeval "$(direnv export bash)"within the same execution context.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

