Secret Portal
Spin up a temporary, one-time-use web UI for securely entering secret keys and environment variables. No secrets ever touch chat history or terminal logs.
Quick Start
CODEBLOCK0
Options
| Flag | Description |
|---|
| INLINECODE0 | Pre-populate a single key name (user only enters the value) |
| INLINECODE1 |
Path to save secrets to (default:
~/.env) |
|
-i, --instructions | HTML instructions shown above the input field |
|
-l, --link | URL button for where to get/create the key |
|
--link-text | Label for the link button (default: "Open console →") |
|
--tunnel |
cloudflared (recommended),
ngrok, or
none |
|
-p, --port | Port to bind to (default: random) |
|
--timeout | Seconds before auto-shutdown (default: 300) |
Tunneling
Use --tunnel cloudflared — it's free, requires no account, has no interstitial pages, provides HTTPS, and auto-downloads the binary if missing.
ngrok free tier shows an interstitial warning page that blocks mobile and automated use.
Without a tunnel, the port must be open in your firewall/security group. The CLI will warn you if it detects the port is unreachable.
Security
- - One-time use: portal expires after a single submission
- Token auth: URL contains a random 32-byte token
- Secret values are never printed to stdout/stderr (enforced by tests)
- Env file is written with
600 permissions (owner-only) - Secrets never touch chat history or terminal logs
Source
https://github.com/Olafs-World/secret-portal
技能名称:secret-portal
详细描述:
Secret Portal
快速创建一个临时、一次性的Web界面,用于安全输入密钥和环境变量。任何秘密信息都不会进入聊天记录或终端日志。
快速开始
bash
单密钥模式,使用cloudflared隧道(推荐)
uv run --with secret-portal secret-portal \
-k API
KEYNAME \
-f ~/.secrets/target-env-file \
--tunnel cloudflared
带引导说明和密钥控制台链接
uv run --with secret-portal secret-portal \
-k OPENAI
APIKEY \
-f ~/.env \
-i
获取密钥:- 访问 platform.openai.com
- 点击 API Keys
- 创建新密钥
\
-l https://platform.openai.com/api-keys \
--link-text 打开 OpenAI 控制台 → \
--tunnel cloudflared
多密钥模式(不使用 -k 参数,用户自行输入密钥名称和值)
uv run --with secret-portal secret-portal \
-f ~/.secrets/keys.env \
--tunnel cloudflared
选项
| 标志 | 说明 |
|---|
| -k, --key | 预填充单个密钥名称(用户只需输入值) |
| -f, --env-file |
保存密钥的文件路径(默认:~/.env) |
| -i, --instructions | 输入框上方显示的HTML引导说明 |
| -l, --link | 获取/创建密钥的URL按钮 |
| --link-text | 链接按钮的标签(默认:打开控制台 →) |
| --tunnel | cloudflared(推荐)、ngrok 或 none |
| -p, --port | 绑定的端口(默认:随机) |
| --timeout | 自动关闭前的等待秒数(默认:300) |
隧道
使用 --tunnel cloudflared — 免费、无需注册、无插页页面、提供HTTPS,且会自动下载缺失的二进制文件。
ngrok免费版会显示一个插页警告页面,阻止移动端和自动化使用。
不使用隧道时,需在防火墙/安全组中开放端口。CLI检测到端口不可达时会发出警告。
安全性
- - 一次性使用:提交一次后门户即失效
- 令牌认证:URL包含一个随机的32字节令牌
- 密钥值绝不打印到stdout/stderr(通过测试强制执行)
- 环境文件以600权限写入(仅所有者可访问)
- 密钥绝不进入聊天记录或终端日志
来源
https://github.com/Olafs-World/secret-portal