Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ANative Lab EvoAgentX CMDToolkit

From Leeroopedia
Knowledge Sources
Domains Tools, System_Administration
Last Updated 2026-10-21 00:00 GMT

Overview

Concrete tool for executing shell commands via subprocess with platform-aware execution.

Description

The CMDToolkit wraps subprocess for executing shell commands. It uses a `CMDBase` class with platform-aware execution (subprocess) and integrates with `FileStorageHandler` for output management. Supports command execution, file operations, and system queries, enabling agents to perform system administration tasks.

Usage

  • System administration: Attach to agents that need to run shell commands.
  • Development workflows: Execute build scripts, run tests, or manage files.
  • File operations: Create, read, and manage files via command-line tools.

Code Reference

Source Location

Signature

class CMDToolkit(Toolkit):
    def __init__(self, ...):
        # Tools: execute_command, read_file, write_file, list_files
        ...

Import

from evoagentx.tools.cmd_toolkit import CMDToolkit

I/O Contract

Inputs

Name Type Required Description
command str Yes Shell command to execute
cwd str No Working directory

Outputs

Name Type Description
execute returns str stdout output of the command
error str stderr output if command fails

Usage Examples

Agent with Command Execution

from evoagentx.tools.cmd_toolkit import CMDToolkit
from evoagentx.agents.customize_agent import CustomizeAgent
from evoagentx.models.model_configs import OpenAILLMConfig

agent = CustomizeAgent(
    name="SysAdminAgent",
    description="Execute system commands",
    prompt="Run the following command and report the output: {command}",
    llm_config=OpenAILLMConfig(model="gpt-4o-mini", openai_key="sk-..."),
    inputs=[{"name": "command", "type": "str", "description": "Command to run"}],
    outputs=[{"name": "output", "type": "str", "description": "Command output"}],
    parse_mode="title",
    tools=[CMDToolkit()],
)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment