Skip to content

LangGraph CLI

The LangGraph CLI is a multi-platform command-line tool for building and running the LangGraph API server locally. This offers an alternative to the LangGraph Studio desktop app for developing and testing agents across all major operating systems (Linux, Windows, MacOS). The resulting server includes all API endpoints for your graph's runs, threads, assistants, etc. as well as the other services required to run your agent, including a managed database for checkpointing and storage.

Installation

The LangGraph CLI can be installed via Homebrew (on macOS) or pip:

brew install langgraph-cli
pip install langgraph-cli

Commands

The CLI provides the following core functionality:

build

The langgraph build command builds a Docker image for the LangGraph API server that can be directly deployed.

up

The langgraph up command starts an instance of the LangGraph API server locally. This requires docker to be installed and running locally. It also requires a LangSmith API key for local development or a license key for production use.

The server includes all API endpoints for your graph's runs, threads, assistants, etc. as well as the other services required to run your agent, including a managed database for checkpointing and storage.

dockerfile

The langgraph dockerfile command generates a Dockerfile that can be used to build images for and deploy instances of the LangGraph API server. This is useful if you want to further customize the dockerfile or deploy in a more custom way.