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

Function run_command

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

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