Skip to content

Dakkshin/minimax-cli

Repository files navigation

MiniMax CLI

A conversational AI CLI tool powered by MiniMax with intelligent text editor capabilities and tool usage.

Screenshot 2025-07-21 at 13 35 41

Features

  • 🤖 Conversational AI: Natural language interface powered by MiniMax
  • 📝 Smart File Operations: AI automatically uses tools to view, create, and edit files
  • ⚡ Bash Integration: Execute shell commands through natural conversation
  • 🌍 Global Installation: Install and use anywhere with bun add -g minimax-cli

Licensing

This software uses a dual licensing model:

  • Open Source Use: Licensed under AGPL-3.0 for individual developers, researchers, and non-commercial projects
  • Commercial Use: Requires a commercial license for business use, redistribution, or deployment in commercial products

See LICENSE.md for detailed licensing information.

Installation

Prerequisites

  • Bun 1.0+ (or Node.js 18+ as fallback)
  • MiniMax API key
  • (Optional, Recommended) Morph API key for Fast Apply editing

Global Installation (Recommended)

bun add -g minimax-cli

Or with npm (fallback):

npm install -g minimax-cli

Local Development

git clone <repository>
cd minimax-cli
bun install
bun run build
bun link

Setup

  1. Get your MiniMax API key

  2. Set up your API key (choose one method):

Method 1: Environment Variable

export MINIMAX_API_KEY=your_api_key_here

Method 2: .env File

cp .env.example .env
# Edit .env and add your API key

Method 3: Command Line Flag

minimax --api-key your_api_key_here

Method 4: User Settings File Create ~/.minimax/user-settings.json:

{
  "apiKey": "your_api_key_here"
}

Configuration

MiniMax CLI uses two configuration files:

  • User settings (~/.minimax/user-settings.json): Global preferences like API keys and default models
  • Project settings (.minimax/settings.json): Project-specific settings like which model to use

Example user settings:

{
  "apiKey": "your_api_key_here",
  "defaultModel": "minimax-fast-1"
}

Example project settings:

{
  "model": "minimax-pro"
}

Project settings override user settings when you're in that directory.

Usage

Interactive Mode

Start the conversational AI assistant:

minimax

Or specify a working directory:

minimax -d /path/to/project

Headless Mode

Process a single prompt and exit (useful for scripting and automation):

minimax --prompt "show me the package.json file"
minimax -p "create a new file called example.js with a hello world function"
minimax --prompt "run bun test and show me the results" --directory /path/to/project
minimax --prompt "complex task" --max-tool-rounds 50  # Limit tool usage for faster execution

This mode is particularly useful for:

  • CI/CD pipelines: Automate code analysis and file operations
  • Scripting: Integrate AI assistance into shell scripts
  • Terminal benchmarks: Perfect for tools like Terminal Bench that need non-interactive execution
  • Batch processing: Process multiple prompts programmatically

Model Selection

Choose which AI model to use:

# Use different models
minimax --model minimax-fast-1  # Fast and efficient
minimax --model minimax-pro     # More capable
minimax --model minimax-ultra   # Most powerful

# Set default in user settings
# ~/.minimax/user-settings.json
{
  "defaultModel": "minimax-fast-1"
}

Models can be set via command flag, environment variable, or user settings.

Command Line Options

minimax [options]

Options:
  -V, --version          output the version number
  -d, --directory <dir>  set working directory
  -k, --api-key <key>    MiniMax API key (or set MINIMAX_API_KEY env var)
  -m, --model <model>    AI model to use (e.g., minimax-fast-1, minimax-pro) (or set MINIMAX_MODEL env var)
  -p, --prompt <prompt>  process a single prompt and exit (headless mode)
  -h, --help             display help for command

About

A conversational AI CLI that brings MiniMax's intelligence directly to your terminal. Edit files, run commands, and manage projects through natural language with lightning-fast code editing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors