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

@opsyhq/cloak

v0.1.3

Published

One-time secret sharing for humans & agents

Readme


Humans and agents need to exchange secrets — API keys, database passwords, tokens — without exposing them in chat logs, terminal history, or Slack threads. The exchange goes both ways: a human sends an agent a database password, an agent sends a human a generated API key.

Cloak creates encrypted, self-destructing secret links. Share the link. It works once. Then the secret is permanently destroyed.

https://cloak.opsy.sh/s/W9ZEykcG#8g9I3UUBjH3x4kdL
                       ^^^^^^^^ ^^^^^^^^^^^^^^^^
                       ID        key (never sent to server)

Two modes, choose your trust level:

  • Browser — zero-knowledge. Client encrypts/decrypts; the server only stores an encrypted blob it can't read.
  • API / CLI / Agent — server-assisted over TLS. Plaintext is sent to the server for encryption but is never stored. Use this when you can't run a browser.

For AI Agents

When an agent receives a Cloak URL:

  1. Parse the URL — ID is the path after /s/, key is the fragment after #
  2. Call the APIcurl -s -H "X-Cloak-Key: KEY" "https://cloak.opsy.sh/api/secrets/ID"
  3. Never display the secret — pipe it to a file, env var, or command. Never echo it in conversation.

Agents can also create secrets and send links to humans — the flow is bidirectional.

The reveal page embeds agent instructions in a hidden DOM element and supports Accept: application/json for structured retrieval instructions.

Published to ClawHub as cloak. Install it:

clawhub install cloak

The plugin/ directory registers cloak_create and cloak_get as native agent tools.

The cli/openclaw-resolver.ts acts as an exec secret provider — secrets get injected into agent environments without appearing in conversation.

{
  "source": "exec",
  "provider": "cloak",
  "command": "cloak-resolver",
  "passEnv": ["CLOAK_URL"]
}

Quickstart

1. Browser

Open cloak.opsy.sh. Paste your secret. Get a link. Share it.

2. curl

# Create
curl -s -X POST https://cloak.opsy.sh/api/secrets \
  -H "Content-Type: application/json" \
  -d "{\"secret\":\"$MY_SECRET\"}"
# → {"id":"W9ZEykcG","key":"8g9I3UUBjH3x4kdL","url":"https://cloak.opsy.sh/s/W9ZEykcG#..."}

# Retrieve — straight to env var, never printed
export MY_SECRET=$(curl -s -H "X-Cloak-Key: 8g9I3UUBjH3x4kdL" \
  "https://cloak.opsy.sh/api/secrets/W9ZEykcG" | jq -r .secret)

3. CLI

# Create (reads from stdin)
echo "$SECRET" | npx @opsyhq/cloak create
echo "$SECRET" | npx @opsyhq/cloak create --ttl 1h

# Retrieve
npx @opsyhq/cloak get "https://cloak.opsy.sh/s/W9ZEykcG#8g9I3UUBjH3x4kdL"

# Retrieve as export statement
npx @opsyhq/cloak get "https://cloak.opsy.sh/s/W9ZEykcG#8g9I3UUBjH3x4kdL" --env
# → export SECRET='the-value'

How It Works

The browser generates a random ID and passphrase, derives an AES-256 key via HKDF, encrypts the secret client-side, and sends only the encrypted blob to the server. The passphrase stays in the URL fragment, which browsers never transmit.

On reveal, the browser fetches the encrypted blob (without sending the key), derives the key locally, and decrypts. The server never sees the plaintext or the encryption key.

The curl/agent flow is server-assisted — plaintext is sent over TLS and encrypted on the server. It's never stored in plaintext.

API

POST /api/secrets

Create a secret.

curl -s -X POST https://cloak.opsy.sh/api/secrets \
  -H "Content-Type: application/json" \
  -d '{"secret":"sk-abc123", "expiresIn": 3600}'

| Field | Type | Default | Description | |-------|------|---------|-------------| | secret | string | required | The secret (max 10,000 chars) | | expiresIn | number | 86400 | TTL in seconds (min 60, max 604800) |

Response:

{
  "id": "W9ZEykcG",
  "key": "8g9I3UUBjH3x4kdL",
  "url": "https://cloak.opsy.sh/s/W9ZEykcG#8g9I3UUBjH3x4kdL",
  "expiresAt": 1710000000
}

GET /api/secrets/:id

Retrieve and destroy a secret.

curl -s -H "X-Cloak-Key: 8g9I3UUBjH3x4kdL" \
  "https://cloak.opsy.sh/api/secrets/W9ZEykcG"
# → {"secret":"sk-abc123"}

The secret is deleted after successful decryption. A wrong key returns 403 without destroying the secret. Returns 404 if not found, expired, or already read.

DELETE /api/secrets/:id

Destroy a secret without reading it. Requires the key.

curl -s -X DELETE -H "X-Cloak-Key: 8g9I3UUBjH3x4kdL" \
  "https://cloak.opsy.sh/api/secrets/W9ZEykcG"
# → {"ok":true}

Security

  • AES-256-GCM with HKDF-SHA256 key derivation (96-bit passphrase entropy)
  • Zero-knowledge browser flow — server never sees plaintext or key
  • Safe retrieval — wrong key returns 403 without destroying the secret; browser flow uses atomic DELETE ... RETURNING
  • Authenticated delete — verifies the encryption key before deleting
  • CORS restricted — API only accepts requests from the app's origin
  • No crawlingrobots.txt, X-Robots-Tag headers, noindex meta tags
  • Auto-expiry — hourly cleanup via Cloudflare Cron Triggers

Self-Hosting

git clone https://github.com/opsyhq/cloak
cd cloak
bun install

# Create D1 database
bunx wrangler d1 create cloak-db
# Copy database_id into wrangler.toml

# Apply schema
bun run db:init

# Dev
bun run dev

# Deploy
bun run deploy

Set your custom domain in wrangler.toml:

[vars]
BASE_URL = "https://secrets.yourdomain.com"