diff --git a/libs/cli/langgraph_cli/cli.py b/libs/cli/langgraph_cli/cli.py index a9b5405f6..d33ddde75 100644 --- a/libs/cli/langgraph_cli/cli.py +++ b/libs/cli/langgraph_cli/cli.py @@ -817,6 +817,23 @@ def dev( ) +# --------------------------------------------------------------------------- +# validate command +# --------------------------------------------------------------------------- + + +@OPT_CONFIG +@cli.command(help="✅ Validate the LangGraph configuration file.") +@log_command +def validate(config: pathlib.Path): + config_json = langgraph_cli.config.validate_config_file(config) + num_graphs = len(config_json.get("graphs", {})) + click.echo( + f"Configuration file {config} is valid. " + f"({num_graphs} graph{'s' if num_graphs != 1 else ''} found)" + ) + + # --------------------------------------------------------------------------- # new command # ---------------------------------------------------------------------------