basecamp/kamal · error · RuntimeError

Bitwarden CLI is not installed

Error message

Bitwarden CLI is not installed

What it means

check_dependencies! in the Bitwarden adapter runs `bw --version` and checks the exit status; if the bw executable is missing from PATH, Kamal raises RuntimeError "Bitwarden CLI is not installed". Like the other vault adapters, this one shells out to the vendor CLI rather than using an API client.

Source

Thrown at lib/kamal/secrets/adapters/bitwarden.rb:74

          item, field = secret.split("/")
          items[item] ||= []
          items[item] << field
        end
      end
    end

    def signedin?(account)
      run_command("status")["status"] != "unauthenticated"
    end

    def run_command(command, session: nil, raw: false)
      full_command = [ *("BW_SESSION=#{session.shellescape}" if session), "bw", command ].join(" ")
      result = `#{full_command}`.strip
      raw ? result : JSON.parse(result)
    end

    def check_dependencies!
      raise RuntimeError, "Bitwarden CLI is not installed" unless cli_installed?
    end

    def cli_installed?
      `bw --version 2> /dev/null`
      $?.success?
    end
end

View on GitHub (pinned to eee0083b38)

Solutions

  1. Install the Bitwarden CLI: npm install -g @bitwarden/cli or brew install bitwarden-cli
  2. Verify in the same shell/environment: bw --version
  3. Add the install step to your CI image/pipeline before any kamal secrets fetch -a bitwarden

Example fix

# before
kamal secrets fetch -a bitwarden --account me@example.com RAILS_MASTER_KEY
# => RuntimeError: Bitwarden CLI is not installed

# fix (terminal)
npm install -g @bitwarden/cli
bw --version
kamal secrets fetch -a bitwarden --account me@example.com RAILS_MASTER_KEY
Defensive patterns

Strategy: validation

Validate before calling

abort "Bitwarden CLI missing — npm install -g @bitwarden/cli" unless system("bw --version > /dev/null 2>&1")

Type guard

def bw_installed?
  system("bw --version > /dev/null 2>&1")
end

Prevention

When it happens

Trigger: kamal secrets fetch -a bitwarden on a machine without the Bitwarden CLI; broken PATH so `bw` does not resolve; minimal CI/Docker image with no @bitwarden/cli installed; unlinked brew install.

Common situations: Fresh workstations; slim CI containers; installing the desktop app (which bundles no CLI) and assuming bw is available; node-based installs failing silently.

Related errors


AI-assisted analysis of basecamp/kamal@eee0083b38 (2026-08-21). Data as JSON: /api/errors/f8f5fae3e21cc711. Report an issue: GitHub.