minimax-cli
v0.0.2
Published
An open-source AI agent that brings the power of MiniMax directly into your terminal.
Maintainers
Readme
MiniMax CLI
A conversational AI CLI tool powered by MiniMax with intelligent text editor capabilities and tool usage.
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-cliOr with npm (fallback):
npm install -g minimax-cliLocal Development
git clone <repository>
cd minimax-cli
bun install
bun run build
bun linkSetup
Get your MiniMax API key
Set up your API key (choose one method):
Method 1: Environment Variable
export MINIMAX_API_KEY=your_api_key_hereMethod 2: .env File
cp .env.example .env
# Edit .env and add your API keyMethod 3: Command Line Flag
minimax --api-key your_api_key_hereMethod 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:
minimaxOr specify a working directory:
minimax -d /path/to/projectHeadless 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 executionThis 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