LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-cli

    langgraph-cli

    Description

    LangGraph CLI

    The official command-line interface for LangGraph, providing tools to create, develop, and deploy LangGraph applications.

    Installation

    Install via pip:

    pip install langgraph-cli

    For development mode with hot reloading:

    pip install "langgraph-cli[inmem]"

    Commands

    langgraph new 🌱

    Create a new LangGraph project from a template

    langgraph new [PATH] --template TEMPLATE_NAME

    langgraph dev 🏃‍♀️

    Run LangGraph API server in development mode with hot reloading

    langgraph dev [OPTIONS]
      --host TEXT                 Host to bind to (default: 127.0.0.1)
      --port INTEGER             Port to bind to (default: 2024)
      --no-reload               Disable auto-reload
      --debug-port INTEGER      Enable remote debugging
      --no-browser             Skip opening browser window
      -c, --config FILE        Config file path (default: langgraph.json)

    langgraph up 🚀

    Launch LangGraph API server in Docker

    langgraph up [OPTIONS]
      -p, --port INTEGER        Port to expose (default: 8123)
      --wait                   Wait for services to start
      --watch                  Restart on file changes
      --verbose               Show detailed logs
      -c, --config FILE       Config file path
      -d, --docker-compose    Additional services file

    langgraph build

    Build a Docker image for your LangGraph application

    langgraph build -t IMAGE_TAG [OPTIONS]
      --platform TEXT          Target platforms (e.g., linux/amd64,linux/arm64)
      --pull / --no-pull      Use latest/local base image
      -c, --config FILE       Config file path

    langgraph dockerfile

    Generate a Dockerfile for custom deployments

    langgraph dockerfile SAVE_PATH [OPTIONS]
      -c, --config FILE       Config file path

    Configuration

    The CLI uses a langgraph.json configuration file with these key settings:

    {
      "dependencies": ["langchain_openai", "./your_package"],  // Required: Package dependencies
      "graphs": {
        "my_graph": "./your_package/file.py:graph"            // Required: Graph definitions
      },
      "env": "./.env",                                        // Optional: Environment variables
      "python_version": "3.11",                               // Optional: Python version (3.11/3.12)
      "pip_config_file": "./pip.conf",                        // Optional: pip configuration
      "dockerfile_lines": []                                  // Optional: Additional Dockerfile commands
    }

    See the full documentation for detailed configuration options.

    Development

    To develop the CLI itself:

    1. Clone the repository
    2. Navigate to the CLI directory: cd libs/cli
    3. Install development dependencies: uv pip install
    4. Make your changes to the CLI code
    5. Test your changes:
    # Run CLI commands directly
    uv run langgraph --help
    
    # Or use the examples
    cd examples
    uv pip install
    uv run langgraph dev  # or other commands

    License

    This project is licensed under the terms specified in the repository's LICENSE file.

    Classes

    Class

    LocalDeps

    A container for referencing and managing local Python dependencies.

    Class

    UvLockSourceEntry

    Class

    UvLockPackage

    Class

    UvLockWorkspace

    Class

    UvLockPlan

    Class

    DockerBuildPlan

    Class

    HostBackendError

    Raised when the host backend returns an error response.

    Class

    HostBackendClient

    Minimal JSON HTTP client for the host backend deployment service.

    Class

    NestedHelpGroup

    Click group that shows one level of nested subcommands in top-level help.

    Class

    BuildResult

    Captures the outcome of a build stage so the shared wait tail can be

    Class

    NestedHelpGroup

    Click group that shows one level of nested subcommands in top-level help.

    Class

    DeployGroup

    Group that treats leading '-' args as passthrough docker flags.

    Class

    TTLConfig

    Configuration for TTL (time-to-live) behavior in the store.

    Class

    IndexConfig

    Configuration for indexing documents for semantic search in the store.

    Class

    StoreConfig

    Configuration for the built-in long-term memory store.

    Class

    ThreadTTLConfig

    Configure a default TTL for checkpointed data within threads.

    Class

    SerdeConfig

    Configuration for the built-in serde, which handles checkpointing of state.

    Class

    CheckpointerConfig

    Configuration for the built-in checkpointer, which handles checkpointing of state.

    Class

    SecurityConfig

    Configuration for OpenAPI security definitions and requirements.

    Class

    CacheConfig

    Class

    AuthConfig

    Configuration for custom authentication logic and how it integrates into the OpenAPI spec.

    Class

    EncryptionConfig

    Configuration for custom at-rest encryption logic.

    Class

    CorsConfig

    Specifies Cross-Origin Resource Sharing (CORS) rules for your server.

    Class

    ConfigurableHeaderConfig

    Customize which headers to include as configurable values in your runs.

    Class

    HttpConfig

    Configuration for the built-in HTTP server that powers your deployment's routes and endpoints.

    Class

    WebhookUrlPolicy

    Class

    GraphDef

    Definition of a graph with additional metadata.

    Class

    WebhooksConfig

    Class

    UvSource

    Deployment source rooted at a uv project or workspace.

    Class

    Config

    Top-level config for langgraph-cli or similar deployment tooling.

    Class

    Progress

    Class

    LogData

    Class

    Version

    Class

    DockerCapabilities

    Functions

    Function

    has_disallowed_build_command_content

    Check if a command string contains disallowed characters or patterns.

    Function

    validate_config

    Validate a configuration dictionary.

    Function

    get_unknown_keys

    Return warnings for unrecognized top-level keys (typos, etc.).

    Function

    validate_config_file

    Load and validate a configuration file.

    Function

    get_build_tools_to_uninstall

    Function

    python_config_to_docker

    Generate a Dockerfile from the configuration.

    Function

    node_config_to_docker

    Function

    default_base_image

    Function

    docker_tag

    Function

    config_to_docker

    Function

    config_to_compose

    Function

    python_config_to_docker_uv_lock

    Function

    cli

    Function

    up

    Function

    build

    Function

    dockerfile

    Function

    dev

    CLI entrypoint for running the LangGraph API server.

    Function

    validate

    Function

    new

    Create a new LangGraph project from a template.

    Function

    prepare_args_and_stdin

    Function

    prepare

    Prepare the arguments and stdin for running the LangGraph API server.

    Function

    validate_deployment_selector

    Ensure either deployment_id or name is provided.

    Function

    validate_deploy_commands

    Validate optional deploy commands for disallowed content.

    Function

    find_deployment_id_by_name

    Return deployment ID for an exact name match, or None if not found.

    Function

    normalize_name

    Sanitize a deployment/directory name into a valid deployment name.

    Function

    normalize_image_tag

    Validate and return a Docker image tag.

    Function

    format_deployments_table

    Function

    format_revisions_table

    Function

    format_timestamp

    Convert a timestamp (epoch ms or string) to a readable string.

    Function

    format_log_entry

    Format a single log entry for display.

    Function

    level_fg

    Return click color for a log level.

    Function

    deploy

    Function

    deploy_list

    Function

    deploy_revisions

    Function

    deploy_revisions_list

    Function

    deploy_delete

    Function

    deploy_logs

    Function

    create_new

    Create a new LangGraph project at the specified PATH using the chosen TEMPLATE.

    Function

    Runner

    Function

    subp_exec

    Function

    monitor_stream

    Function

    create_archive

    Context manager that creates a .tar.gz archive of the project source.

    Function

    get_anonymized_params

    Function

    log_data

    Function

    log_command

    Function

    can_build_locally

    Return whether local deployment builds can run on this machine.

    Function

    check_capabilities

    Function

    debugger_compose

    Function

    dict_to_yaml

    Convert a dictionary to a YAML string.

    Function

    compose_as_dict

    Create a docker compose file as a dictionary in YML style.

    Function

    compose

    Create a docker compose file as a string.

    Function

    build_docker_image

    Build a Docker image from a LangGraph config.

    Function

    clean_empty_lines

    Function

    warn_non_wolfi_distro

    Show warning if image_distro is not set to 'wolfi'.

    Modules

    Module

    langgraph_cli

    Module

    config

    Module

    uv_lock

    Module

    host_backend

    HTTP client for LangGraph host backend deployments.

    Module

    cli

    CLI entrypoint for LangGraph API server.

    Module

    deploy

    Deploy command and subcommands for the LangGraph CLI.

    Module

    schemas

    Module

    templates

    Module

    progress

    Module

    exec

    Module

    archive

    Create a tarball of project source for remote builds.

    Module

    analytics

    Module

    version

    Main entrypoint into package.

    Module

    constants

    Module

    docker

    Module

    util

    General-purpose utilities shared across the LangGraph CLI.