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

Function plot_flow

lib/cli/src/crewai_cli/plot_flow.py:6–31  ·  view source on GitHub ↗

Plot the flow from declarative config or the Python UV entrypoint.

()

Source from the content-addressed store, hash-verified

4
5
6def plot_flow() -> None:
7 """
8 Plot the flow from declarative config or the Python UV entrypoint.
9 """
10 from crewai_cli.run_declarative_flow import (
11 configured_project_declarative_flow,
12 plot_declarative_flow_in_project_env,
13 )
14
15 if definition := configured_project_declarative_flow():
16 plot_declarative_flow_in_project_env(definition)
17 else:
18 command = ["uv", "run", "plot"]
19
20 try:
21 subprocess.run( # noqa: S603
22 command, capture_output=False, text=True, check=True
23 )
24
25 except subprocess.CalledProcessError as e:
26 click.echo(f"An error occurred while plotting the flow: {e}", err=True)
27 raise SystemExit(1) from e
28
29 except Exception as e:
30 click.echo(f"An unexpected error occurred: {e}", err=True)
31 raise SystemExit(1) from e

Callers 1

flow_plotFunction · 0.90

Calls 4

echoMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected