Configure the default LLM model used by minion-code:
# View current default model
mcode model
# Set default model (saved to ~/.minion/minion-code.json)
mcode model gpt-4o
mcode model claude-3-5-sonnet
# Clear default model (use built-in default)
mcode model --clear
Model Priority:
CLI --model argument (highest priority)
Config file ~/.minion/minion-code.json
Built-in default (lowest priority)
ACP Protocol Support
MinionCodeAgent supports the ACP (Agent Communication Protocol) protocol, enabling integration with ACP-compatible clients like Zed editor.
In ACP mode, tool calls will request user permission:
Allow once: Allow this time only
Always allow: Permanently allow this tool (saved to ~/.minion/sessions/)
Reject: Deny execution
Programming Interface
import asyncio
from minion_code import MinionCodeAgent
async def main():
# Create AI code assistant with all tools auto-configured
agent = await MinionCodeAgent.create(
name="My Code Assistant",
llm="gpt-4.1"
)
# Chat with the AI assistant
response = await agent.run_async("List files in current directory")
print(response.answer)
response = await agent.run_async("Read the README.md file")
print(response.answer)
asyncio.run(main())
Custom Configuration
# Custom system prompt and working directory
agent = await MinionCodeAgent.create(
name="Python Expert",
llm="gpt-4.1",
system_prompt="You are a specialized Python developer assistant.",
workdir="/path/to/project",
additional_tools=[MyCustomTool()]
)
View Available Tools
# Print tools summary
agent.print_tools_summary()
# Get tools info
tools_info = agent.get_tools_info()
for tool in tools_info:
print(f"{tool['name']}: {tool['description']}")
Built-in Tools
MinionCodeAgent automatically includes the following tool categories:
# Get conversation history
history = agent.get_conversation_history()
for entry in history:
print(f"User: {entry['user_message']}")
print(f"Agent: {entry['agent_response']}")
# Clear history
agent.clear_conversation_history()
Comparison with Original Implementation
Before (Complex manual configuration)
# Need to manually import and configure all tools
from minion_code.tools import (
FileReadTool, FileWriteTool, BashTool,
GrepTool, GlobTool, LsTool,
PythonInterpreterTool, WebSearchTool,
# ... more tools
)
# Manually create tool instances
custom_tools = [
FileReadTool(),
FileWriteTool(),
BashTool(),
# ... more tool configuration
]
# Manually set system prompt
SYSTEM_PROMPT = "You are a coding agent..."
# Create agent (~50 lines of code)
agent = await CodeAgent.create(
name="Minion Code Assistant",
llm="gpt-4o-mini",
system_prompt=SYSTEM_PROMPT,
tools=custom_tools,
)
Now (Using MinionCodeAgent)
# One line of code completes all setup
agent = await MinionCodeAgent.create(
name="Minion Code Assistant",
llm="gpt-4o-mini"
)
MinionCodeAgent
An enhanced AI code assistant built on the Minion framework, pre-configured with rich development tools, optimized for code development tasks.
Features
Installation
Option 1: Install from source (recommended for development)
In this case,
MINION_ROOTis located at../minionOption 2: Direct installation (recommended for general use)
In this case,
MINION_ROOTis located at the current startup locationOn startup, the actual path of
MINION_ROOTwill be displayed:LLM Configuration
Please refer to https://github.com/femto/minion?tab=readme-ov-file#get-started
Make sure the config file is in
MINION_ROOT/config/config.yamlor~/.minion/config.yamlQuick Start
CLI Usage
Configuration
Configure the default LLM model used by minion-code:
Model Priority:
--modelargument (highest priority)~/.minion/minion-code.jsonACP Protocol Support
MinionCodeAgent supports the ACP (Agent Communication Protocol) protocol, enabling integration with ACP-compatible clients like Zed editor.
Using with Zed Editor
Add the following to Zed’s
settings.json:Permission Management
In ACP mode, tool calls will request user permission:
~/.minion/sessions/)Programming Interface
Custom Configuration
View Available Tools
Built-in Tools
MinionCodeAgent automatically includes the following tool categories:
📁 File and Directory Tools
💻 System and Execution Tools
🌐 Network and Search Tools
🔧 Other Tools
MCP Tool Integration
MinionCodeAgent supports loading additional tools via MCP (Model Context Protocol) configuration files.
MCP Configuration File Format
Create a JSON configuration file (e.g.,
mcp.json):Configuration Options
command: Command to start the MCP serverargs: List of command argumentsenv: Environment variables (optional)disabled: Whether to disable this server (default: false)autoApprove: List of tool names to auto-approve (optional)Using MCP Configuration
Using MCP Tools in Programming Interface
Conversation History Management
Comparison with Original Implementation
Before (Complex manual configuration)
Now (Using MinionCodeAgent)
API Reference
MinionCodeAgent.create()
Parameters:
name: Agent namellm: LLM model to usesystem_prompt: Custom system prompt (optional)workdir: Working directory (optional, defaults to current directory)additional_tools: List of additional tools (optional)**kwargs: Other parameters passed to CodeAgent.create()Instance Methods
run_async(message: str): Run agent asynchronouslyrun(message: str): Run agent synchronouslyget_conversation_history(): Get conversation historyclear_conversation_history(): Clear conversation historyget_tools_info(): Get tools infoprint_tools_summary(): Print tools summaryProperties
agent: Access underlying CodeAgent instancetools: Get available tools listname: Get agent nameSecurity Features
rm -rf,sudo, etc.)Examples
See complete examples in the
examples/directory:simple_code_agent.py: Basic MinionCodeAgent usage examplesimple_tui.py: Simplified TUI implementationadvanced_textual_tui.py: Advanced TUI interface (using Textual library)minion_agent_tui.py: Original complex implementation (for comparison)mcp_config.json: MCP configuration file exampletest_mcp_config.py: MCP configuration loading testdemo_mcp_cli.py: MCP CLI feature demoRun examples:
Documentation
Contributing
Issues and Pull Requests are welcome to improve this project!
License
MIT License