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

Function run_command

lib/devtools/src/crewai_devtools/cli.py:67–87  ·  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

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

Calls 1

runMethod · 0.45

Tested by

no test coverage detected