From 648f03d7150e61b002a06c7b6f686761cf1e8a63 Mon Sep 17 00:00:00 2001 From: Will Fu-Hinthorn Date: Tue, 7 Apr 2026 17:56:19 -0700 Subject: [PATCH] chore: validate --- libs/cli/langgraph_cli/cli.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 # ---------------------------------------------------------------------------