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.
Copy and 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 enter node -v. If you see something like v20.x.x, it means success.)
Execute the following commands in your terminal to clone the project locally:
# 1. Clone the repository
https://github.com/Code-MonkeyZhang/Mini-Agent-TS.git
# 2. Navigate to the project directory
cd Mini-Agent/Mini-Agent-TS(If Git is not installed on your computer, Windows users can run winget install Git.Git, Mac users run brew install git)
Execute the following two commands sequentially in your terminal to register the mini-agent-ts command in your system:
# 1. Install dependencies
npm install
# 2. Build and link to system commands
npm run build && npm linkYou need to provide the AI with your credentials.
- Navigate to the
configdirectory under the project folder. - Make a copy of
config-example.yamland rename it toconfig.yaml:cp config/config-example.yaml config/config.yaml
- Open
config.yamlwith a text editor or 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 your network environment)
api_base: "https://api.minimax.io/anthropic" # For overseas users
# api_base: "https://api.minimaxi.com" # For users in China
# Model and provider
model: "MiniMax-M2"
provider: "anthropic"Everything is ready! Now you can directly enter commands anywhere in your terminal to launch it.
Starts in the current directory by default:
mini-agent-tsYou can make the Agent work in a specific directory, so all files it creates will be saved there without cluttering your current folder:
# Windows
mini-agent-ts --workspace D:\MyProjects\TestAgent
# Mac / Linux
mini-agent-ts -w ./my-workspaceYou'll see the welcome screen 🤖 Mini Agent. Now you can give it instructions as if chatting with a person, for example:
"Please create a file named hello.txt in the current directory containing a poem about programmers."
If you want to participate in development or debug the code, you can use the following commands:
| Command | Purpose |
|---|---|
npm run build |
Build Project: Compiles TypeScript source code into JavaScript (output to dist/). |
npm run dev |
Run in Dev Mode: Uses tsx to directly execute source code without manual compilation, ideal for debugging with instant updates. |
npm run start |
Run in Production Mode: Executes compiled code (requires running build first). |
npm test |
Run Tests: Executes Vitest unit tests. |