This project is a TypeScript implementation of Minimax's open-source Mini-Agent project.
This is an AI agent that runs in your terminal (command line), capable of helping you read/write files and execute system commands.
Run the appropriate command for your system in Terminal/PowerShell:
- Windows (PowerShell):
winget install -e --id OpenJS.NodeJS.LTS
- Mac (requires Homebrew):
brew install node
- Linux (Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs
(After installation, close and reopen your terminal, then type node -v. If you see something like v20.x.x, it's successful.)
Run these commands in your terminal to clone the project locally:
# 1. Clone repository
https://github.com/Code-MonkeyZhang/Mini-Agent-TS.git
# 2. Enter project directory
cd Mini-Agent/Mini-Agent-Tस(If Git isn't installed: Windows users can run winget install Git.Git, Mac users run brew install git)
Run these two commands sequentially to register mini-agent-ts as a system command:
# 1. Install dependencies
npm install
# 2. Build and link to system commands
npm run build && npm linkYou need to provide AI with your credentials.
- Navigate to the
configfolder in the project directory. - Copy
config-example.yamland rename it toconfig.yaml:cp config/config-example.yaml config/config.yaml
- Open
config.yamlwith a text/code editor and modify these key configurations:
# config/config.yaml
# Enter your API Key
api_key: "YOUR_API_KEY_HERE" # Replace with your MiniMax API Key
# API endpoint (choose based on network environment)
api_base: "https://api.minimax.io/anthropic" # Overseas users
# api_base: "https://api.minimaxi.com" # Mainland China users
# Model and provider
model: "MiniMax-M2"
provider: "anthropic"
# Logging (optional)
enableLogging: false # Set to true to enable file logging (logs saved in logs/ folder at project root)Ready to go! You can now launch it from anywhere in your terminal.
Launch in current directory:
mini-agent-tsHave Agent work in a specific directory to keep generated files organized:
# Windows
mini-agent-ts --workspace D:\MyProjects\TestAgent
# Mac / Linux
mini-agent-ts -w ./my-workspaceYou'll see the welcome screen 🤖 Mini Agent. Now give instructions conversationally, e.g.:
"Please create a file named hello.txt in the current directory containing a poem about programmers."
For development/debugging, use these commands:
| Command | Purpose |
|---|---|
npm run build |
Compile project: Transpiles TypeScript to JavaScript (outputs to dist/). |
npm run dev |
Development mode: Runs source directly via tsx with hot-reloading for debugging. |
npm run start |
Production mode: Runs compiled code (requires prior build execution). |
npm test |
Run tests: Executes Vitest unit tests. |