npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dotcloak

v0.1.0

Published

Encrypt your .env so AI coding tools can't read it

Readme

dotcloak

Encrypt your .env so AI coding tools can only read ciphertext.

dotcloak is a Node.js CLI that encrypts .env files with age and only injects plaintext secrets into the child process you launch with dotcloak run.

Quick Start

dotcloak demo

npm install -g dotcloak

cat > .env <<'EOF'
API_KEY=super-secret
DATABASE_URL=postgres://localhost/app
EOF

dotcloak init
dotcloak status
dotcloak run -- node -e "console.log(process.env.API_KEY)"

What happens:

  1. dotcloak init creates .env.cloak, .dotcloak/key.age, and .dotcloak/config.toml.
  2. dotcloak appends .dotcloak/key.age to .gitignore, .claudeignore, and .cursorignore.
  3. The original .env is deleted unless you pass --keep.
  4. dotcloak run decrypts secrets in memory and passes them to the command you run.

For one-off usage without global install:

npx dotcloak init
npx dotcloak run -- npm start

Static CLI Flow

.env
  -> dotcloak init
  -> .env.cloak + .dotcloak/key.age
  -> dotcloak run -- <command>
  -> child process receives process.env

Command Reference

dotcloak init

Encrypt a plaintext .env file and initialize dotcloak in the current project.

dotcloak init
dotcloak init --keep
dotcloak init --file .env.local

dotcloak run -- <command>

Run a command with decrypted secrets injected into the child process environment.

dotcloak run -- npm start
dotcloak run -- node -e "console.log(process.env.API_KEY)"
dotcloak run --file .env.production.cloak -- npm run worker

dotcloak set

Add or update a secret in the encrypted store.

dotcloak set API_KEY=rotated-secret
dotcloak set DATABASE_URL

The second form prompts for a hidden value.

dotcloak unset

Remove a secret from the encrypted store.

dotcloak unset API_KEY

dotcloak list

List secrets from the encrypted store.

dotcloak list
dotcloak list --show

Values are masked by default. --show prints plaintext values and should only be used in a trusted terminal.

dotcloak edit

Edit decrypted secrets in your $EDITOR or $VISUAL, then re-encrypt on save.

EDITOR=nvim dotcloak edit
VISUAL="code --wait" dotcloak edit

dotcloak status

Show whether dotcloak is initialized and whether plaintext .env still exists.

dotcloak status

dotcloak key export

Print the current age secret key so you can back it up or transfer it securely.

dotcloak key export > dotcloak-backup.age

dotcloak key import

Import an exported age secret key into the current project.

dotcloak key import ./dotcloak-backup.age

Security Model

What dotcloak protects

  • Plaintext .env does not need to stay on disk after dotcloak init.
  • AI coding tools scanning the filesystem only see encrypted .env.cloak.
  • Your app keeps using process.env with no application code changes.

What dotcloak does not protect

  • It does not protect secrets from a process you launch yourself with dotcloak run.
  • It does not replace OS isolation, secret rotation, or host hardening.
  • It does not protect against anyone who can already inspect your process memory or environment.

Linux note

dotcloak run injects secrets into the child process environment. That protects .env from filesystem-based AI scans, but it does not harden Linux against same-user inspection of /proc/<pid>/environ or other OS-level process introspection. Treat dotcloak as filesystem protection, not a sandbox boundary.

Why use this for AI tools?

Ignore files are advisory. dotcloak changes the artifact on disk instead: the file an AI tool can read is ciphertext, not plaintext. That is the narrow problem this tool is designed to solve.

Development

License

MIT