Tell your assistant to add, generate, check, copy or remove a key in .env, JSON, YAML or TOML. When a value is needed, nfi opens a browser prompt and you paste it there. The AI only ever learns the key name.
$ npm install -g nfi-tools
All the AI saw of that last line was STRIPE_SECRET_KEY and a confirmation, with nothing after the equals sign.
| Ln | Party | Entry |
|---|---|---|
| 01 | you | "Add my Stripe secret key to .env." |
| 02 | assistant | nfi set .env STRIPE_SECRET_KEY |
| 03 | nfi |
STRIPE_SECRET_KEY
••••••••••••••••••••pasted
Save to .env
|
| 04 | nfi | Wrote 1 secret to .env |
| 05 | assistant | "Done. STRIPE_SECRET_KEY is set." |
The prompt is served from a temporary localhost server with a one-time token. The value goes from that page to the file and nowhere else: not stdout, not stderr, not the tool result, not the context window.
nfi set .env STRIPE_SECRET_KEY
nfi set .env STRIPE_SECRET_KEY DATABASE_URL
nfi set config.json database.password
One form covers several keys, and dot notation reaches into JSON, YAML and TOML.
nfi generate SESSION_SECRET .env
nfi generate APP_KEY .env --template uuid
nfi generate TOKEN .env --template base64:32
Random secrets the AI never needs to see either, hex by default and 64 characters long.
nfi has API_KEY .env
nfi keys config.json --depth 1
nfi diff .env .env.example
Names, presence and gaps, but values never print.
nfi copy DATABASE_URL .env config.json --path database.url
nfi remove API_KEY .env
Move a value between files without it passing through anything that logs.
.env handling keeps your comments, blank lines, export prefixes and inline comments where they were.
For clients without shell access, such as Claude Desktop or Cursor, register nfi once and the assistant gets the same operations as tools. The browser prompt still opens on your side; if it can't, you get a link to click instead.
store_secretcheck_secretlist_keysdiff_keysgenerate_secretremove_secretcopy_secretdescribe_capabilities# auto-detects the client $ nfi mcp install # or be explicit $ nfi mcp install --client cursor # no install $ npx nfi-tools set .env STRIPE_SECRET_KEY
The browser prompt comes first, then a clickable URL if it can't open (remote session, MCP without a display), and finally a masked prompt on /dev/tty if there's no browser at all, which is the one input the assistant can't feed.
Localhost page with password fields, so you can paste straight from your password manager.
Same page, delivered as a link when it can't be opened for you.
Direct /dev/tty read with masked input, and if there's no TTY either nfi errors instead of reading stdin.
/dev/tty directly, never stdin..gitignore.