This repository contains all the commands and tools that Simple Agent Core uses to perform various operations. These modular commands enable the AI agent to interact with files, web resources, GitHub repositories, and system operations in a structured and extensible way.
Simple-Agent-Tools serves as the command library for Simple Agent Core, providing a comprehensive set of tools organized into logical categories. Each command is implemented as a separate module with its own schema definition, making the system highly modular and easy to extend.
Commands for file and directory management:
read_file- Read contents of a filewrite_file- Write content to a fileappend_file- Append content to an existing fileedit_file- Edit specific parts of a fileadvanced_edit_file- Advanced file editing with multiple operationsdelete_file- Delete a filefile_exists- Check if a file existscreate_directory- Create a new directorylist_directory- List contents of a directorysave_json- Save data as JSON fileload_json- Load data from JSON filescreenshot- Take a screenshot and save itanalyze_image_with_gpt4- Analyze images using GPT-4 Vision
Commands for web interaction and data retrieval:
web_search- Search the web for informationweb_scrape- Scrape content from web pagesraw_web_read- Read raw content from web URLsfetch_json_api- Fetch data from JSON APIsextract_links- Extract links from web pages
Commands for GitHub repository management and interaction:
git_clone- Clone a GitHub repositorygithub_fork_clone- Fork and clone a repositorygithub_create_repo- Create a new GitHub repositorygithub_create_branch- Create a new branchgithub_read_files- Read files from a GitHub repositorygithub_add_files- Add files to a repositorygithub_create_issue- Create a new issuegithub_create_pr- Create a pull requestgithub_approve_pr- Approve a pull requestgithub_merge_pr- Merge a pull requestgithub_close_pr- Close a pull requestgithub_reopen_pr- Reopen a pull requestgithub_comment- Add comments to issues/PRsrepo_reader- Read repository informationpr_reader- Read pull request detailsissue_reader- Read issue details
Commands for data processing and analysis:
text_analysis- Analyze and process text data
Commands for system-level operations:
screenshot- Take system screenshots
Each command follows a consistent structure:
commands/
├── category_name/
│ ├── command_name/
│ │ └── __init__.py # Contains the command function and schema
│ └── ...
└── ...
Each command module (__init__.py) contains:
- Function Implementation - The actual command logic
- Schema Definition - JSON schema defining parameters and description
- Registration - Automatic registration with the command system
Example command structure:
from commands import register_command
def my_command(param1: str, param2: int = 5) -> dict:
"""Command implementation"""
# Command logic here
return {"result": "success"}
MY_COMMAND_SCHEMA = {
"type": "function",
"function": {
"name": "my_command",
"description": "Description of what this command does",
"parameters": {
"type": "object",
"properties": {
"param1": {"type": "string", "description": "Parameter description"},
"param2": {"type": "integer", "description": "Optional parameter", "default": 5}
},
"required": ["param1"]
}
}
}
register_command("my_command", my_command, MY_COMMAND_SCHEMA)These commands are automatically discovered and loaded by Simple Agent Core through the command registration system. The agent can then use any of these commands through function calling, making it capable of:
- Managing files and directories
- Searching and scraping the web
- Interacting with GitHub repositories
- Processing and analyzing data
- Taking screenshots and analyzing images
When adding new commands to this repository:
- Choose the Right Category - Place your command in the appropriate category directory, or create a new category if needed
- Follow the Structure - Each command should be in its own subdirectory with an
__init__.pyfile - Include Proper Schema - Define a complete JSON schema for your command
- Register the Command - Use the
register_commandfunction to make it available - Document Your Command - Include clear descriptions and parameter documentation
- Documentation: All updates should include necessary documentation updates, especially if they affect existing protocol structures.
- Code Reviews: All new code contributions require code review approval from at least one senior developer.
- Testing: Ensure your commands work correctly with Simple Agent Core before submitting.
To link commits to specific GitHub issues, use #number in your commit message, where number corresponds to the issue ID.
Example:
Fixes #123– Links the commit to issue #123, marking it as fixed.Closes #456– Links the commit to issue #456, closing it upon merge.
Use these keywords in commit messages for consistency:
- Resolve: Use when a commit fixes an issue
- Fix: For bug fixes
- Close: When the commit closes an issue entirely
- Refactor: For code improvements without changing functionality
- Add: For new features or commands
- Remove: For deleting commands or code
- Be Descriptive: Clearly state what the commit accomplishes
- Use Imperative Mood: Start with a verb, as if giving a command
- Reference Issues: Use the issue number where applicable
- Separate Concepts: Make separate commits for different types of changes
- Keep It Short: Limit subject lines to 50 characters when possible
Add #203 - New web_scrape command for content extractionFix #215 - Correct parameter validation in github_create_prRefactor file_ops commands for better error handlingRemove deprecated raw_file_read command
- Simple Agent Core - The main AI agent framework that uses these commands
This project is licensed under the same terms as Simple Agent Core. See the LICENSE file for details.