AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Direnv

skill-cogni-ai-ou-cogni-ai-agent-skills-direnv · by Cogni-AI-OU

How to maintain credentials and authenticate using direnv without exposing secrets to the output.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-cogni-ai-ou-cogni-ai-agent-skills-direnv

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-cogni-ai-ou-cogni-ai-agent-skills-direnv)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Direnv? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Skill: direnv

Guidance for using direnv to securely maintain credentials and load environment variables without exposing them in agent outputs.

Core Process

  1. Setup Environment: Copy .env.example to .env if .env does not exist and needs configuration.
  2. Authorize Directory: Run direnv allow to approve the environment variables.
  3. 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 allow with eval "$(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 ~/.bashrc or ~/.profile instead).
  • When running commands in isolated, ephemeral Docker containers where environment variables are passed via --env-file.

Common Pitfalls

  • Forgetting to Eval: Running direnv allow but forgetting to run eval "$(direnv export bash)", meaning the variables never actually load into the agent's current shell session.
  • Committing Secrets: Adding sensitive keys to .env but failing to ensure .env is listed in the project's .gitignore.
  • Assuming Global State: Expecting direnv variables 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 source or cat .env files.
  • Do not run direnv allow without immediately running eval "$(direnv export bash)" within the same execution context.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.