MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / run_bash

Function run_bash

agents/s07_task_system.py:131–141  ·  view source on GitHub ↗
(command: str)

Source from the content-addressed store, hash-verified

129 return path
130
131def run_bash(command: str) -> str:
132 dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"]
133 if any(d in command for d in dangerous):
134 return "Error: Dangerous command blocked"
135 try:
136 r = subprocess.run(command, shell=True, cwd=WORKDIR,
137 capture_output=True, text=True, timeout=120)
138 out = (r.stdout + r.stderr).strip()
139 return out[:50000] if out else "(no output)"
140 except subprocess.TimeoutExpired:
141 return "Error: Timeout (120s)"
142
143def run_read(path: str, limit: int = None) -> str:
144 try:

Callers 1

s07_task_system.pyFile · 0.70

Calls 1

runMethod · 0.45

Tested by

no test coverage detected