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

Function _parse_cli_args

lib/cli/tests/test_create_crew.py:2690–2701  ·  view source on GitHub ↗

Parse ARGS against the real CLI without running the command.

(args: list[str])

Source from the content-addressed store, hash-verified

2688
2689
2690def _parse_cli_args(args: list[str]) -> None:
2691 """Parse ARGS against the real CLI without running the command."""
2692 command: click.Command = crewai
2693 name = "crewai"
2694 # A group can run without a subcommand, options and all (`crewai eval --models …`,
2695 # beside `crewai eval export ID`).
2696 while isinstance(command, click.Group) and args and not args[0].startswith("-"):
2697 name, *args = args
2698 subcommand = command.get_command(click.Context(command), name)
2699 assert subcommand is not None, f"unknown command {name!r}"
2700 command = subcommand
2701 command.make_context(name, args)
2702
2703
2704def test_agents_md_command_parser_accepts_a_group_run_without_a_subcommand():

Calls

no outgoing calls

Tested by

no test coverage detected