MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / run_command

Function run_command

lib/devtools/src/crewai_devtools/cli.py:69–89  ·  view source on GitHub ↗

Run a shell command and return output. Args: cmd: Command to run as list of strings. cwd: Working directory for command. Returns: Command output as string. Raises: subprocess.CalledProcessError: If command fails.

(cmd: list[str], cwd: Path | None = None)

Source from the content-addressed store, hash-verified

67
68
69def run_command(cmd: list[str], cwd: Path | None = None) -> str:
70 """Run a shell command and return output.
71
72 Args:
73 cmd: Command to run as list of strings.
74 cwd: Working directory for command.
75
76 Returns:
77 Command output as string.
78
79 Raises:
80 subprocess.CalledProcessError: If command fails.
81 """
82 result = subprocess.run( # noqa: S603
83 cmd,
84 cwd=cwd,
85 capture_output=True,
86 text=True,
87 check=True,
88 )
89 return result.stdout.strip()
90
91
92def check_gh_installed() -> None:

Callers 15

check_gh_installedFunction · 0.70
check_git_cleanFunction · 0.70
_branch_exists_remoteFunction · 0.70
_open_pr_url_for_branchFunction · 0.70
create_or_reset_branchFunction · 0.70
get_github_contributorsFunction · 0.70
_poll_pr_until_mergedFunction · 0.70
_update_all_versionsFunction · 0.70
_generate_release_notesFunction · 0.70

Calls 1

runMethod · 0.45

Tested by

no test coverage detected