cli[minor]: Add langgraph new command (#2369)

Adds a "new" command to create langgraph application from a template.
This commit is contained in:
Eugene Yurtsev
2024-11-12 14:30:51 -05:00
committed by GitHub
parent a73f9affab
commit 2bcf1c0a20
9 changed files with 337 additions and 2 deletions
+14
View File
@@ -15,6 +15,7 @@ from langgraph_cli.constants import DEFAULT_CONFIG, DEFAULT_PORT
from langgraph_cli.docker import DockerCapabilities
from langgraph_cli.exec import Runner, subp_exec
from langgraph_cli.progress import Progress
from langgraph_cli.templates import TEMPLATE_HELP_STRING, create_new
from langgraph_cli.version import __version__
OPT_DOCKER_COMPOSE = click.option(
@@ -378,6 +379,19 @@ def dockerfile(save_path: pathlib.Path, config: pathlib.Path):
)
@click.argument("path", required=False)
@click.option(
"--template",
type=str,
help=TEMPLATE_HELP_STRING,
)
@cli.command("new", help="Create a new LangGraph project from a template.")
@log_command
def new(path: Optional[str], template: Optional[str]) -> None:
"""Create a new LangGraph project from a template."""
return create_new(path, template)
def prepare_args_and_stdin(
*,
capabilities: DockerCapabilities,