Skip to content
Triwarden

Guide · Local API keys

Your API keys,
out of your .env files.

Triwarden keeps API keys in your Vaultwarden or Bitwarden vault and gives them to the tools you set up. Start a tool with tw run or its alias; after you approve, Triwarden starts it with the selected keys as environment variables. Nothing is sent to Triwarden servers.

claude · npmtw runTriwardenYou approvekeys as environment variables
tw run asks Triwarden for the tool's keys. You approve with Touch ID, and the tool starts with those keys as environment variables.

Set up

Four steps from
saved key to running tool.

  1. 01

    Save the key

    In the vault, choose New API Key from the + button or the File menu. Name it, enter the service, paste the key and check the default environment variable, such as ANTHROPIC_API_KEY. It is saved as a standard Secure Note, so other Bitwarden apps can still open and edit it.

    Already have a .env file? Choose Import .env File… and pick the keys to save. Triwarden only reads the file. Once the tool works, delete the plain text copies yourself.

    The Import from .env sheet, choosing which keys from a project's .env file to save to the vaultThe Import from .env sheet, choosing which keys from a project's .env file to save to the vault
  2. 02

    Give it to a tool

    Open the key and choose Provide to Tool…. Pick the tool, such as Claude Code, Codex, Gemini CLI or an npm dev server, and its project folder. Check the variable name the tool reads. Add more keys if it needs them, review the full command, then choose Save Tool.

    Setup guide, step 2: choose the tool that needs this key, with Claude Code, Codex CLI, Gemini CLI, a web app and a Python script as examplesSetup guide, step 2: choose the tool that needs this key, with Claude Code, Codex CLI, Gemini CLI, a web app and a Python script as examples
  3. 03

    Install tw and copy the alias

    Install the tw helper once from Settings › Developer › Install tw. Secrets lists each saved tool with its launch command. Copy Alias gives you a short name such as tw-claude-code; add that line to ~/.zshrc.

    The alias holds the tool's name, never the key.

    Storefront dev server, ready to run: its launch command, its alias, three keys with their environment variables, and the program and folderStorefront dev server, ready to run: its launch command, its alias, three keys with their environment variables, and the program and folder
    ~/.zshrc
    alias tw-claude-code='tw run --profile tool-…'
    
  4. 04

    Run it and approve

    Type the alias. Triwarden shows the tool, command, folder and every key it will receive. Choose Once, 10 minutes or Until lock, then confirm with Touch ID or your Mac password. The tool starts with the keys as environment variables.

    Terminal
    tw-claude-code
    # Triwarden: approve “Claude Code” with Touch ID
    
    Approval card: start Storefront dev server with your keys? It lists three keys, the program, arguments and folder, with Once, 10 minutes and Until lock above Deny and Allow OnceApproval card: start Storefront dev server with your keys? It lists three keys, the program, arguments and folder, with Once, 10 minutes and Until lock above Deny and Allow Once

Everyday use

One vault
for every project.

AI coding tools

Save one tool each for Claude Code, Codex and Gemini CLI, each with the key and variable it expects. Every tool gets only the keys you chose for it.

The Secrets page in Triwarden, listing seven saved tools with their keys and statusThe Secrets page in Triwarden, listing seven saved tools with their keys and status

npm dev servers

A dev server that needs several keys gets them together in one launch. Each key can use the variable name that project reads.

Terminal
tw-storefront-dev-server
# Triwarden: approve “Storefront dev server” with Touch ID

Leaving .env and .zshrc behind

Import the keys and check that the tool starts with tw run. Then remove the plain text lines and open a new terminal. If a key ever reached Git or a log, replace it with the provider; moving it into the vault doesn't change the old copy.

Approvals

Every launch
asks you first.

The approval names the tool and lists the command, folder and every key. Pick how long it lasts:

Once
the default: this launch only
10 minutes
the same tool can start again from the same terminal without asking
Until lock
lasts until the vault locks

Temporary access covers the saved command and the launcher process that asked. A new terminal window asks again.

Active access

See what has access.
End it from the notch.

While a tool has temporary access, a small status sits at the notch with the time left on each approval. Point at it to see the list and end one. Access › Permissions in the sidebar lists the same approvals, and you can end any of them there.

The notch status open over the menu bar: Terminal with 04:04 left for GitHub development, Claude Code with 9:41 left, and Storefront dev server until lock, each with an End buttonThe notch status open over the menu bar: Terminal with 04:04 left for GitHub development, Claude Code with 9:41 left, and Storefront dev server until lock, each with an End button
An SSH signing request shown in the notchAn SSH signing request shown in the notch

SSH signing and tools that use one key can ask for approval in the notch. The option is in Settings and starts on for Macs with a notch. Tools with several keys use the approval window. Touch ID or your password is still required.

Access › Permissions in Triwarden, listing the tools and apps that have temporary access and the time left on eachAccess › Permissions in Triwarden, listing the tools and apps that have temporary access and the time left on each

Fixes

When it
doesn’t work.

The tool doesn't see the key

Start it with its saved tw run command or alias; a tool started another way doesn't get the key. Check that the variable name matches what the tool reads.

It asks again in a new terminal

That is expected. Temporary access belongs to the launcher process that asked, so a new terminal window needs its own approval.

I changed the key in the vault

The next launch uses the new value. Restart programs that are already running to give them the new key.

The launch was cancelled

The request was denied, it timed out, or the vault locked. Run the command again and approve.

Using SSH keys too? Read the SSH agent guide

Ready when you are.

Local API keys are included in free personal use. Work use requires a license.

Download for Mac