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 (get one here)
Installation Methods
Global Installation (Recommended)
Install the CLI globally to use it from any directory:
Local Installation
For project-specific installations:
When installed locally, use npx mxbai
or add scripts to your package.json
:
Verify Installation
After installation, verify the CLI is working:
Upgrading the CLI
Global Upgrade
To upgrade a globally installed CLI to the latest version:
Local Upgrade
For project-specific installations:
Authentication
To use the CLI, you need a Mixedbread API key. The CLI checks for authentication in this order:
- Command line flag:
--api-key mxb_xxxxx
- Environment variable:
export MXBAI_API_KEY=mxb_xxxxx
- Configuration file:
mxbai config set api_key mxb_xxxxx
Quick Setup
The easiest way to get started is with an environment variable:
For persistent configuration across sessions, use the config file:
Learn more about configuration options in the Configuration Guide.
Shell Completion
The CLI supports intelligent tab completion for commands, subcommands, and vector store names.
Installation
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
Dynamic Vector Store Name Completion
The CLI provides intelligent tab completion for vector store names in commands:
How it works:
- Vector store names are cached locally for instant completion (no API latency)
- Cache updates automatically when you create, update, delete, or list vector stores
- Supports multiple API keys - completions show stores for your current default key
- Manual refresh available:
mxbai completion refresh
Cache management:
- Caches up to 50 most recent vector store names per API key
- Cache location follows your config directory:
- Linux/Unix:
~/.config/mixedbread/completion-cache.json
- macOS:
~/Library/Application Support/mixedbread/completion-cache.json
- Windows:
%APPDATA%\mixedbread\completion-cache.json
- Linux/Unix:
Managing Completion
Last updated: August 27, 2025