Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cold-things-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mixedbread/cli": major
---

Update `vs` to `store` in all commands
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Repository Overview

Openbread is an open-source toolkit for Mixedbread's vector store platform. This monorepo contains:
- `@mixedbread/cli` - Command-line interface for managing vector stores
Openbread is an open-source toolkit for Mixedbread's store platform. This monorepo contains:
- `@mixedbread/cli` - Command-line interface for managing stores

## Development Commands

Expand Down Expand Up @@ -99,8 +99,8 @@ export MXBAI_API_KEY="your-api-key"
3. Add tests in `packages/cli/tests/commands/`
4. Register command in appropriate index file

### Working with Vector Stores
- CLI provides full CRUD operations for vector stores
### Working with Stores
- CLI provides full CRUD operations for stores
- File upload with processing strategies (high_quality, fast, auto)
- Git-based and hash-based sync capabilities
- Manifest-based bulk uploads via YAML configuration
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
[![npm version](https://badge.fury.io/js/@mixedbread%2Fcli.svg)](https://www.npmjs.com/package/@mixedbread/cli)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Openbread is an open-source monorepo containing tools for interacting with [Mixedbread](https://www.mixedbread.com/)'s vector store platform. Currently, it houses the command-line interface (CLI) that enables seamless vector store management, file processing, and intelligent search capabilities.
Openbread is an open-source monorepo containing tools for interacting with [Mixedbread](https://www.mixedbread.com/)'s store platform. Currently, it houses the command-line interface (CLI) that enables seamless store management, file processing, and intelligent search capabilities.

## Packages

### 🛠️ [@mixedbread/cli](./packages/cli)

A comprehensive command-line interface for managing Mixedbread vector stores.
A comprehensive command-line interface for managing Mixedbread stores.

**Key Features:**
- Vector store management (create, update, delete, list)
- Store management (create, update, delete, list)
- Intelligent file upload with processing strategies
- Advanced sync with git-based and hash-based change detections
- Vector search and Q&A capabilities
Expand All @@ -29,14 +29,14 @@ npm install -g @mixedbread/cli
# Set your API key
export MXBAI_API_KEY=mxb_xxxxx

# Create a vector store
mxbai vs create "My Documents"
# Create a store
mxbai store create "My Documents"

# Upload files with high-quality processing
mxbai vs upload "My Documents" "**/*.md" --strategy high_quality --contextualization
mxbai store upload "My Documents" "**/*.md" --strategy high_quality --contextualization

# Search your content
mxbai vs search "My Documents" "how to get started"
mxbai store search "My Documents" "how to get started"
```

## Prerequisites
Expand All @@ -60,7 +60,7 @@ mxbai vs search "My Documents" "how to get started"
```

4. **Start building:**
- Create vector stores for your documents
- Create stores for your documents
- Upload and process files with different strategies
- Search and interact with your content

Expand Down
122 changes: 61 additions & 61 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @mixedbread/cli

CLI tool for managing Mixedbread vector stores and files.
CLI tool for managing Mixedbread stores and files.

## Installation

Expand All @@ -23,66 +23,66 @@ mxbai completion install
## Check available commands and their options
mxbai --help

# List vector stores
mxbai vs list
# List stores
mxbai store list

# Create a new vector store
mxbai vs create "My Documents"
# Create a new store
mxbai store create "My Documents"

# Upload files
mxbai vs upload "My Documents" "*.md" "docs/**/*.pdf"
mxbai store upload "My Documents" "*.md" "docs/**/*.pdf"

# Upload with high-quality processing and contextualization
mxbai vs upload "My Documents" "**/*.md" --strategy high_quality --contextualization
mxbai store upload "My Documents" "**/*.md" --strategy high_quality --contextualization

# Search content
mxbai vs search "My Documents" "how to get started"
mxbai store search "My Documents" "how to get started"

# Sync files with change detection
mxbai vs sync "My Documents" "docs/**" --from-git HEAD~1
mxbai store sync "My Documents" "docs/**" --from-git HEAD~1

# Sync with processing options
mxbai vs sync "My Documents" "**/*.md" --parallel 8
mxbai store sync "My Documents" "**/*.md" --parallel 8

# Upload with manifest file (JSON or YAML)
mxbai vs upload "My Documents" --manifest upload-manifest.json
mxbai vs upload "My Documents" --manifest upload-manifest.yaml
mxbai store upload "My Documents" --manifest upload-manifest.json
mxbai store upload "My Documents" --manifest upload-manifest.yaml
```

## Commands

### Vector Store Management
### Store Management

- `mxbai vs list` - List all vector stores
- `mxbai store list` - List all stores
- Options: `--filter <name>`, `--limit <n>`
- `mxbai vs create <name>` - Create a new vector store
- `mxbai store create <name>` - Create a new store
- Options: `--description <desc>`, `--expires-after <days>`, `--metadata <json>`
- `mxbai vs get <name-or-id>` - Get vector store details
- `mxbai vs update <name-or-id>` - Update vector store
- `mxbai store get <name-or-id>` - Get store details
- `mxbai store update <name-or-id>` - Update store
- Options: `--name <name>`, `--description <desc>`, `--expires-after <days>`, `--metadata <json>`
- `mxbai vs delete <name-or-id>` - Delete vector store (alias: `rm`)
- `mxbai store delete <name-or-id>` - Delete store (alias: `rm`)
- Options: `--yes/-y` (skip confirmation)

### File Management

- `mxbai vs upload <name-or-id> <patterns...>` - Upload files to vector store
- `mxbai store upload <name-or-id> <patterns...>` - Upload files to store
- Options: `--strategy fast|high_quality`, `--contextualization`, `--metadata <json>`, `--dry-run`, `--parallel <n>` (1-200), `--unique`, `--manifest <file>`
- `mxbai vs files list <name-or-id>` - List files in vector store (alias: `ls`)
- `mxbai store files list <name-or-id>` - List files in store (alias: `ls`)
- Options: `--status <status>` (pending|in_progress|cancelled|completed|failed), `--limit <n>`
- `mxbai vs files get <name-or-id> <file-id>` - Get file details
- `mxbai vs files delete <name-or-id> <file-id>` - Delete file (alias: `rm`)
- `mxbai store files get <name-or-id> <file-id>` - Get file details
- `mxbai store files delete <name-or-id> <file-id>` - Delete file (alias: `rm`)
- Options: `--yes/-y` (skip confirmation)

### Search & Query

- `mxbai vs search <name-or-id> <query>` - Search vector store
- `mxbai store search <name-or-id> <query>` - Search store
- Options: `--top-k <n>`, `--threshold <score>`, `--return-metadata`, `--rerank`, `--file-search`
- `mxbai vs qa <name-or-id> <question>` - Ask questions about content
- `mxbai store qa <name-or-id> <question>` - Ask questions about content
- Options: `--top-k <n>`, `--threshold <score>`, `--return-metadata`

### Advanced Features

- `mxbai vs sync <name-or-id> <patterns...>` - Sync files with intelligent change detection
- `mxbai store sync <name-or-id> <patterns...>` - Sync files with intelligent change detection
- Options: `--strategy <strategy>`, `--contextualization`, `--from-git <ref>`, `--dry-run`, `--yes/-y`, `--force/-f`, `--metadata <json>`, `--parallel <n>` (1-200)

### Configuration
Expand All @@ -97,7 +97,7 @@ mxbai vs upload "My Documents" --manifest upload-manifest.yaml
- `mxbai completion install` - Install shell completion
- Options: `--shell <shell>` (manually specify shell: bash, zsh, fish, pwsh)
- `mxbai completion uninstall` - Uninstall shell completion
- `mxbai completion refresh` - Refresh completion cache for vector store names
- `mxbai completion refresh` - Refresh completion cache for store names

## Features

Expand Down Expand Up @@ -204,22 +204,22 @@ The sync command provides intelligent change detection and robust error handling
**Example Usage:**
```bash
# Sync with git-based detection (fastest)
mxbai vs sync "My Docs" "docs/**" --from-git HEAD~1
mxbai store sync "My Docs" "docs/**" --from-git HEAD~1

# Sync with hash-based detection and custom parallel processing
mxbai vs sync "My Docs" "**/*.md" --parallel 10
mxbai store sync "My Docs" "**/*.md" --parallel 10

# Sync with high-quality processing and contextualization
mxbai vs sync "My Docs" "**/*.md" --strategy high_quality --contextualization
mxbai store sync "My Docs" "**/*.md" --strategy high_quality --contextualization

# Dry run to preview changes
mxbai vs sync "My Docs" "src/**" --dry-run
mxbai store sync "My Docs" "src/**" --dry-run

# Force re-upload all files without confirmation
mxbai vs sync "My Docs" "**/*.pdf" --yes --force
mxbai store sync "My Docs" "**/*.pdf" --yes --force

# Same as above using short flags
mxbai vs sync "My Docs" "**/*.pdf" -y -f
mxbai store sync "My Docs" "**/*.pdf" -y -f
```

### Configuration Management
Expand Down Expand Up @@ -256,13 +256,13 @@ mxbai config keys remove personal
# Remove an API key without confirmation
mxbai config keys remove personal --yes

# Create aliases for frequently used vector stores
# Create aliases for frequently used stores
mxbai config set aliases.docs "My Documentation"
mxbai config set aliases.kb "Knowledge Base"

# Then use aliases instead of full names
mxbai vs upload docs "*.md" # Instead of: mxbai vs upload "My Documentation" "*.md"
mxbai vs search kb "how to get started" # Instead of: mxbai vs search "Knowledge Base" "how to get started"
mxbai store upload docs "*.md" # Instead of: mxbai store upload "My Documentation" "*.md"
mxbai store search kb "how to get started" # Instead of: mxbai store search "Knowledge Base" "how to get started"

# View all configuration
mxbai config get
Expand Down Expand Up @@ -293,11 +293,11 @@ mxbai config keys add mxb_xxxxx work
mxbai config keys add mxb_xxxxx personal

# Use a specific saved API key for a command
mxbai vs upload "My Docs" "*.md" --saved-key work
mxbai vs search "Knowledge Base" "query" --saved-key personal
mxbai store upload "My Docs" "*.md" --saved-key work
mxbai store search "Knowledge Base" "query" --saved-key personal

# Or use an actual API key directly
mxbai vs upload "My Docs" "*.md" --api-key mxb_xxxxx
mxbai store upload "My Docs" "*.md" --api-key mxb_xxxxx

# The last added key becomes default automatically
# Or explicitly set a default
Expand All @@ -306,7 +306,7 @@ mxbai config keys set-default personal

## Shell Completion

The CLI supports intelligent tab completion for commands, subcommands, and **vector store names**.
The CLI supports intelligent tab completion for commands, subcommands, and **store names**.

### Installation

Expand All @@ -332,29 +332,29 @@ After installation, restart your shell or reload your shell configuration:
- **fish**: Completion is ready to use (fish auto-loads completions)
- **pwsh**: `. $PROFILE` or restart terminal

### Dynamic Vector Store Name Completion
### Dynamic Store Name Completion

The CLI provides intelligent tab completion for vector store names in commands:
The CLI provides intelligent tab completion for store names in commands:

```bash
# Tab completion shows your vector store names
mxbai vs get [TAB] # Shows: store1 store2 my-docs ...
mxbai vs delete [TAB] # Shows: store1 store2 my-docs ...
mxbai vs sync [TAB] # Shows: store1 store2 my-docs ...
mxbai vs upload [TAB] # Shows: store1 store2 my-docs ...
# Tab completion shows your store names
mxbai store get [TAB] # Shows: store1 store2 my-docs ...
mxbai store delete [TAB] # Shows: store1 store2 my-docs ...
mxbai store sync [TAB] # Shows: store1 store2 my-docs ...
mxbai store upload [TAB] # Shows: store1 store2 my-docs ...

# Also works with files subcommands
mxbai vs files list [TAB] # Shows: store1 store2 my-docs ...
mxbai store files list [TAB] # Shows: store1 store2 my-docs ...
```

**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
- Store names are cached locally for instant completion (no API latency)
- Cache updates automatically when you create, update, delete, or list 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
- Caches up to 50 most recent 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`
Expand Down Expand Up @@ -416,8 +416,8 @@ This CLI is built on top of the `@mixedbread/sdk` and provides a convenient comm

**Option A: Quick testing** (no tab completion)
```bash
pnpm mxbai vs --help
pnpm mxbai vs list
pnpm mxbai store --help
pnpm mxbai store list
```

**Option B: Full CLI experience with tab completion**
Expand All @@ -429,7 +429,7 @@ This CLI is built on top of the `@mixedbread/sdk` and provides a convenient comm
cd packages/cli && npm link

# Now test with full CLI features
mxbai vs --help
mxbai store --help
mxbai [TAB] # Tab completion works!

# To unlink when done
Expand Down Expand Up @@ -467,20 +467,20 @@ src/
│ │ ├── get.ts # Get config values
│ │ ├── set.ts # Set config values
│ │ └── index.ts
│ └── vector-store/ # Vector store commands
│ └── vector-store/ # Store commands
│ ├── files/ # File management subcommands
│ │ ├── delete.ts
│ │ ├── get.ts
│ │ ├── list.ts
│ │ └── index.ts
│ ├── create.ts # Create vector store
│ ├── delete.ts # Delete vector store
│ ├── get.ts # Get vector store details
│ ├── list.ts # List vector stores
│ ├── create.ts # Create store
│ ├── delete.ts # Delete store
│ ├── get.ts # Get store details
│ ├── list.ts # List stores
│ ├── qa.ts # Q&A functionality
│ ├── search.ts # Search functionality
│ ├── sync.ts # Sync files
│ ├── update.ts # Update vector store
│ ├── update.ts # Update store
│ ├── upload.ts # Upload files
│ └── index.ts
├── utils/ # Shared utilities
Expand All @@ -496,7 +496,7 @@ src/
│ ├── sync-state.ts # Sync state management
│ ├── sync.ts # Sync logic
│ ├── upload.ts # Upload utilities
│ └── vector-store.ts # Vector store helpers
│ └── vector-store.ts # Store helpers
└── index.ts # Package exports

tests/
Expand Down Expand Up @@ -549,7 +549,7 @@ tests/

#### Debugging

- Use `--debug` flag for verbose output: `pnpm mxbai --debug vs list`
- Use `--debug` flag for verbose output: `pnpm mxbai --debug store list`
- Set `MXBAI_DEBUG=true` environment variable for debug output
- Debug output includes command hierarchy options and merged options
- Tests include detailed error messages and mock setups
4 changes: 2 additions & 2 deletions packages/cli/scripts/setup-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ async function main() {
if (isInstalled || install?.toLowerCase() === "y") {
console.log("Get started with the mxbai CLI:");
console.log(" mxbai --help # Show all commands");
console.log(" mxbai vs list # List your vector stores");
console.log(' mxbai vs create "My Docs" # Create a new vector store');
console.log(" mxbai store list # List your stores");
console.log(' mxbai store create "My Docs" # Create a new store');
console.log(" mxbai config get # View configuration");

console.log("\nUseful resources:");
Expand Down
Loading