MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / demo_bash_tool

Function demo_bash_tool

examples/01_basic_tools.py:90–115  ·  view source on GitHub ↗

Demo: Execute bash commands.

()

Source from the content-addressed store, hash-verified

88
89
90async def demo_bash_tool():
91 """Demo: Execute bash commands."""
92 print("\n" + "=" * 60)
93 print("Demo 4: BashTool - Execute bash commands")
94 print("=" * 60)
95
96 tool = BashTool()
97
98 # Example 1: List files
99 print("\nCommand: ls -la")
100 result = await tool.execute(command="ls -la")
101 if result.success:
102 print(f"✅ Command executed successfully")
103 print(f"Output:\n{result.content[:200]}...")
104
105 # Example 2: Get current directory
106 print("\nCommand: pwd")
107 result = await tool.execute(command="pwd")
108 if result.success:
109 print(f"✅ Current directory: {result.content.strip()}")
110
111 # Example 3: Echo
112 print("\nCommand: echo 'Hello from BashTool!'")
113 result = await tool.execute(command="echo 'Hello from BashTool!'")
114 if result.success:
115 print(f"✅ Output: {result.content.strip()}")
116
117
118async def main():

Callers 1

mainFunction · 0.85

Calls 2

executeMethod · 0.95
BashToolClass · 0.90

Tested by

no test coverage detected