Mixedbread

Installation & Setup

Prerequisites

Before installing the mxbai CLI, ensure you have:

  • Node.js version 20.0 or higher
  • A package manager
  • A Mixedbread API key ()

Installation Methods

Install the CLI globally to use it from any directory:

npm install -g @mixedbread/cli

Local Installation

For project-specific installations:

npm install --save-dev @mixedbread/cli

When installed locally, use npx mxbai or add scripts to your package.json:

{
  "scripts": {
    "mxbai": "mxbai"
  }
}

Verify Installation

After installation, verify the CLI is working:

mxbai --version

Authentication

To use the CLI, you need a Mixedbread API key. The CLI checks for authentication in this order:

  1. Command line flag: --api-key mxb_xxxxx
  2. Environment variable: export MXBAI_API_KEY=mxb_xxxxx
  3. Configuration file: mxbai config set api_key mxb_xxxxx

Quick Setup

The easiest way to get started is with an environment variable:

export MXBAI_API_KEY=mxb_xxxxx

For persistent configuration across sessions, use the config file:

mxbai config set api_key mxb_xxxxx

Learn more about configuration options in the .

Shell Completion

The CLI supports tab completion for commands and subcommands. To set up completion:

# Install completion (auto-detects your shell)
mxbai completion install

# Install completion for a specific shell
mxbai completion install --shell bash
mxbai completion install --shell zsh
mxbai completion install --shell fish
mxbai completion install --shell pwsh

Supported shells: bash, zsh, fish, pwsh (PowerShell)

After installation, restart your shell or reload your shell configuration:

  • bash: source ~/.bashrc or restart terminal
  • zsh: source ~/.zshrc or restart terminal
  • fish: Completion is ready to use (fish auto-loads completions)
  • pwsh: . $PROFILE or restart terminal

To remove completion:

mxbai completion uninstall

Next Steps

Now that you have the CLI installed, proceed to:

Last updated: July 5, 2025