A Python library for Code Agent MantaCoder
Project description
MantaCoder
MantaCoder is an intelligent code agent system that self-evolves. Like its namesake, the Manta Ray, it gracefully navigates through code tasks with intelligence and efficiency.
Features
- Self-Evolution: Learns and adapts from interactions
- Intelligent Processing: Smart command classification and execution
- Context Awareness: Maintains session history for better understanding
- Tool System: Extensible framework for custom capabilities
Installation
Install from source
# Clone the repository
git clone https://github.com/yourusername/mantacoder.git
cd mantacoder
# Install
pip install .
Install from pypi
pip3 install mantacoder
Usage
Basic Startup
mantacoder --api-key YOUR_API_KEY --base-url YOUR_BASE_URL --model MODEL_NAME
Tool Commands
MantaCoder provides several powerful tools that can be accessed through natural language commands:
Command Execution
Execute system commands directly:
"Please run ls in the current directory"
-> MantaCoder will use: <execute_command> <command>ls</command> </execute_command>
File Operations
Reading Files:
"Show me the contents of config.json"
-> MantaCoder will use: <read_file> <path>config.json</path> </read_file>
Writing Files:
"Create a new Python script called hello.py"
-> MantaCoder will use:
<write_to_file>
<path>hello.py</path>
<content>
print("Hello, World!")
</content>
</write_to_file>
Updating Files:
"Update the React import to include useState"
-> MantaCoder will use:
<replace_in_file>
<path>component.jsx</path>
<diff>
<<<<<<< SEARCH
import React from 'react';
=======
import React, { useState } from 'react';
>>>>>>> REPLACE
</diff>
</replace_in_file>
Special Commands
History Review
To see the conversation history:
history
This will display all previous messages in the current session, including system messages, user inputs, and assistant responses.
File Context
To add a file to the conversation context:
@path/to/file.txt
This makes the file content available to MantaCoder for reference in subsequent interactions.
Example Interactions
Here are some common ways to interact with MantaCoder:
-
Create a new project:
"Create a new React component for a login form" -
Modify existing code:
"Add input validation to the login form component" -
Fix issues:
"Debug the authentication flow in auth.js" -
Get explanations:
"Explain how the routing system works in this project"
Testing
To run the test suite, use pytest. Ensure that all dependencies are installed (including development dependencies).
# Use pytest to run the tests
pytest tests/
Architecture
mantacoder/
├── mantacoder/
├── core/ # Core agent functionality
├── llm/ # Language model integration
├── session/ # Session management
├── tools/ # Extensible tools
└── prompts/ # System prompts
Examples
The examples/ directory contains practical demonstrations of using MantaCoder for various project types:
examples/
├── snakegame/ # Creating a snakegame web applications with MantaCoder
├── minegame/ # Creating a minesweeper web applications with MantaCoder
These examples serve as both documentation and starting points for your own projects. They demonstrate real-world applications of MantaCoder's features and can be used as templates for similar implementations.
Contributing
We welcome contributions! Please fork the repository and submit a pull request.
License
MIT License
Contact
- GitHub: hengjiUSTC
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mantacoder-0.2.0.1.tar.gz.
File metadata
- Download URL: mantacoder-0.2.0.1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9b94762ad8bdd4ddf74ec2806ab1be4d62326c463c84c94f86be2ae5b4c0dc3
|
|
| MD5 |
18c738445cd95a1a96fafbbd5bc8c995
|
|
| BLAKE2b-256 |
92ba3bd58f6d4a092469a7f4cc1aff1b062c3ed953c414b0d3adc72140d6a86e
|
File details
Details for the file mantacoder-0.2.0.1-py3-none-any.whl.
File metadata
- Download URL: mantacoder-0.2.0.1-py3-none-any.whl
- Upload date:
- Size: 33.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12c14af0d67203e724168728bbc63cdb5cefe6679f19a0f57771547dad37694e
|
|
| MD5 |
8e6fc63cba5c0a4c42e488668fd4af2a
|
|
| BLAKE2b-256 |
6bacee521f3856740c8f04b006d86fee40c8d368f07e8135d5a828d1d8a8bec5
|