KeyBar app icon KeyBar for Mac

Your API keys,
out of sight

Keep your keys for Claude, Cloudflare, GitHub and the rest in your Mac's Keychain. Claude Code uses them by name to run commands, and never sees the values.

For Mac · macOS 14 or later · Works with Claude Code, Cursor, Codex and more · Installs with Homebrew · Open source

KeyBar's menu bar panel listing keys such as ANTHROPIC_API_KEY and CLOUDFLARE_API_TOKEN, each with show and copy buttons

What it does

Paste it once,
never again

No more keys in .env files, shell history or chat transcripts. Store each one once, and Claude Code finds it when it needs it.

01

Store it once

Click the key in your menu bar and paste. KeyBar recognises keys from dozens of services and fills in the name for you, like ANTHROPIC_API_KEY or GITHUB_TOKEN. Got a .env file? Import it and pick which lines to bring in.

The Add a key form with a name and a hidden value

02

Claude uses it, never sees it

Click Connect Claude Code and KeyBar adds its MCP server to Claude Code for all your projects. Ask Claude to deploy your site or call an API, and it runs the command with your key set as an environment variable. Any copy of the key in the output, as written, base64, URL-encoded or reversed, comes back as [REDACTED].

list_secrets: the names of your keys and what they're for. Never the values.
run_with_secrets: runs a command with the keys it names, then hides them in what it prints.
request_secret: asks you for a key it needs, with what it's for. You paste it into KeyBar, not the chat.
send_secret: puts a key into a GitHub repo or a Cloudflare Worker for a deploy, after your Touch ID.
The Claude Code screen in KeyBar's window, with Connect Claude Code and a note to add to CLAUDE.md

03

Touch ID first

Showing or copying a key asks for Touch ID, or your Mac's password. Before Claude Code uses a key, KeyBar asks too, and the prompt shows the exact command it wants to run. One yes covers the same keys in the same project for 15 minutes, or choose every time.

The panel with CLOUDFLARE_API_TOKEN's value shown after Touch ID

04

Every use, logged

See which key was used, by you or by Claude Code, the program it ran, the folder, the exit code and whether anything was hidden. Refusals are logged with the reason. Values never are.

The Activity screen listing runs by Claude Code with exit codes and hidden copies, a refused use, and keys shown and copied by you

05

Your rules

Lock a key to the project folders that need it, and commands anywhere else are refused. Give it an expiry date and KeyBar reminds you two weeks before. A command with a key's actual value pasted into it is refused too, so values stay out of the chat. Not using a key for now? Archive it, and Claude can't see it until you restore it.

Editing STRIPE_SECRET_KEY: name, group, note, a new value, an expiry date, the project folder it's limited to, and Send and Test buttons

06

All in one place

The window gathers every key by service or by your own groups, in your own order, with search across names, services, groups and notes. Tags show which keys expire soon and where each one was sent.

KeyBar's window in dark mode, with a banner saying GITHUB_TOKEN expires in 9 days, and keys grouped by Anthropic, GitHub, OpenAI and a Shop group

07

Send it where it's needed

A deploy needs the key too? Tick your GitHub repos, or name a Cloudflare Worker or Pages project, and KeyBar puts it into their secrets after one Touch ID. The value goes straight to gh or wrangler, never on screen. Made a new key? Send again puts it everywhere the old one went.

Sending GITHUB_TOKEN: GitHub Actions, Cloudflare Worker and Cloudflare Pages tabs, a list of repositories to tick, and the name to use there

08

Claude asks, you paste

When Claude needs a key you haven't stored, it asks KeyBar instead of the chat. Add key opens with the name filled in and Claude's reason above it, like where to make the key. You paste it in, and Claude only hears that it's ready.

Claude Code asks for a key: Add key with CLOUDFLARE_API_TOKEN filled in, and Claude's reason, to deploy the contact-form Worker

09

Find the leaks

Leak check looks for your stored keys in AI chat logs, shell history and git history, the places keys end up after a paste, and says who could have seen each copy. Hide a copy with one click, or rotate the key. It all runs on your Mac.

Leak check: OPENAI_API_KEY found in a Claude Code transcript and zsh history, STRIPE_SECRET_KEY in a commit, each with Hide, Show and Rotate

10

Rotate in one go

Open the service's keys page, paste the new key and test it. One Touch ID saves it and sends it to every repo and Worker the old one went to. Then KeyBar reminds you to revoke the old key.

Rotating GITHUB_TOKEN in four steps: open GitHub's keys page, paste and test the new key, save and send it to two repos, revoke the old one

11

No keys in commits

Turn on the commit guard and every commit in every repo is checked for your keys first, whether you or Claude made it. Your repos' own hooks still run. A .keybar file in a project lists the keys it needs, and there Claude sees only those.

Dev tools: a switch to stop commits that contain a key, a sample .keybar project key list, and the AI proxy

12

Keys it never holds

For Anthropic, OpenAI and Groq keys, turn on KeyBar's proxy. Commands get a placeholder and a local address their SDK calls instead, and KeyBar adds the key on the way out. The command never has the key, so it can't leak it.

Editing ANTHROPIC_API_KEY: a Touch ID rule of As in Settings, Every time or Don't ask, a switch for Through KeyBar's proxy, and Rotate, Send and Test buttons

And the little things

Thoughtful touches

Small details that make it easy to live with every day.

Clipboard care

A copied key is wiped after 20 seconds, or 1 or 2 minutes, and clipboard managers are asked to skip it.

468 services

CLOUDFLARE_API_TOKEN shows as Cloudflare's API token, STRIPE_PUBLISHABLE_KEY as Stripe's publishable key. All built in, so nothing goes online to look it up.

A heads-up dot

A coral dot on the menu bar key tells you when Claude Code isn't connected. You can turn it off.

Starts when needed

If KeyBar isn't running when Claude Code needs a key, it starts quietly in the background.

Updates itself

Check for updates in Settings. KeyBar quits, updates through Homebrew and reopens.

Quick copy, ⌥⌘K

Press ⌥⌘K in any app, type a few letters of a key's name and press Return. It's copied after Touch ID.

Expiry reminders

A notification two weeks before a key expires, and on the day, so a deploy never breaks on a dead token.

Test a key

Click Test and KeyBar asks the key's own service if it still works. GitHub and Cloudflare tokens fill in their expiry date too.

File keys

A Google service account's .json or Apple's .p8 goes in like any key. Commands get the path to a private copy, deleted when they finish.

All your Macs

Turn on iCloud Keychain sync and every Mac you sign in to has the same keys, groups and notes, encrypted end to end by Apple.

Tidies up

Keys no command has used for 90 days get a nudge to archive them, out of Claude's reach until they're needed again.

Other AI apps

Connect Claude Desktop, Cursor, Windsurf, VS Code, Codex CLI and Gemini CLI from the same screen as Claude Code. The log names the app.

Touch ID per key

Ask every time for a live payments key, never for a harmless one, and Settings decides the rest.

Your commands too

keybar run -- npm run dev sets a project's keys for your own commands, from its .keybar list or .env, with Touch ID every time.

Native, light and dark

Built in SwiftUI with no Electron. Light and dark mode, and a padlock that's always pleased to see you.

Private by design

Your keys
stay yours

In your Keychain

Each key is its own item in your Mac's login Keychain, or iCloud Keychain if you turn on sync. Values are never written anywhere else, and KeyBar's list holds only names.

Only its own helper

KeyBar hands keys only to its own signed helper, the MCP server Claude Code runs, and only for one command at a time. Anything else that asks is turned away.

No tracking

No analytics, no account and nothing collected. On its own it only goes online to check for updates. Test talks only to the key's own service, and only when you click. It's open source, so you can check.

Know its limits

A command that's given a key really has it, so it could still send it somewhere. KeyBar can't protect keys from programs already running on your Mac as you, and it hasn't been independently audited. Read what Claude wants to run, and use folder limits and Touch ID for the keys that matter.

Download & install

KeyBar is free. It installs with Homebrew, a free and widely used tool for installing Mac apps and keeping them up to date. You only need to set it up once.

  1. Get Homebrew. Download the installer, open it and click through, like any Mac installer. It asks for your Mac password. Already have Homebrew? Skip to step 2.

    Download Homebrew
  2. Open Terminal, an app that comes with every Mac. Press ⌘ Space, type Terminal and press Return. A window with a blinking cursor opens.

  3. Click Copy, paste into Terminal with ⌘ V and press Return. Text scrolls past while Homebrew installs KeyBar. It's done when it stops.

    Install KeyBar
    $ brew tap RossNicholson/tap$ brew trust --cask rossnicholson/tap/keybar$ brew install --cask keybar

    See command not found: brew? Quit Terminal with ⌘ Q, open it again and paste once more.

  4. Open KeyBar from your Applications folder. If your Mac asks whether you're sure you want to open it, click Open. Add your first key, then go to Claude Code and click Connect Claude Code. New Claude Code sessions can use your keys straight away.

What your Mac will ask

Your Mac checks with you before an app can do certain things. Here's what KeyBar asks for, and what to do.

  • Touch ID. When you show or copy a key, and when Claude Code wants to use one. Touch the sensor, or type your Mac password. The prompt says which key and, for Claude, which command.
  • Launch at login. If you turn it on in Settings, macOS shows a notice that a login item was added. That's expected.

On an older Homebrew, an error about brew trust is safe to ignore.

Keep your keys
to yourself

KeyBar is free, open source, and signed and notarized by Apple.

Enjoying it? Buy me a coffee ☕ · Need help? Support

Also from me: ClawdBar, your Claude Code limits in the menu bar, and BrewDock, Homebrew in your menu bar

KeyBar is an independent app and isn't affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.