To help you ship LangGraph apps to production faster, check out LangSmith. LangSmith is a unified developer platform for building, testing, and monitoring LLM applications.
uv add langgraph-cli
The LangGraph CLI is the official command-line interface for LangGraph. It provides tools to create, develop, build, and run LangGraph applications locally or in Docker.
For full documentation, see the LangGraph CLI reference. For conceptual guides and tutorials, see the LangGraph Docs.
For development mode with hot reloading:
uv add "langgraph-cli[inmem]"
langgraph new ๐ฑCreate a new LangGraph project from a template.
langgraph new [PATH] --template TEMPLATE_NAME
langgraph dev ๐โโ๏ธRun Agent 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 Agent 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 buildBuild 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 dockerfileGenerate a Dockerfile for custom deployments.
langgraph dockerfile SAVE_PATH [OPTIONS]
-c, --config FILE Config file path
langgraph deployBuild and deploy an Agent Server image to LangSmith. Use --agent-server-id to
update an existing Agent Server and --agent-server-type to select its type.
The legacy --deployment-id and --deployment-type spellings remain supported
as hidden compatibility aliases, with no removal scheduled. Older Python CLI
versions and the JavaScript CLI may still require the legacy spellings; check
command help for your installed version.
langgraph deploy metricsFetch Agent Server monitoring time series as JSON through the LangSmith control plane.
Use langgraph deploy list to find the Agent Server ID. Authentication uses the same
API key and workspace configuration as the other deploy commands.
langgraph deploy metrics AGENT_SERVER_ID \
--start-time 2026-10-28T0000Z \
--end-time 2026-10-28T0100Z \
--metrics cpu_usage,memory_usage,worker_count
--metrics accepts a comma-separated list of these names (also listed in
langgraph deploy metrics --help):
memory_usage, cpu_usage, disk_usagerestart_count, replica_count, worker_count, lg_run_countresponses_per_second, error_responses_per_second, p95_latencyrun_queue_wait_timeThese are exact metric names, not free-text search terms. Availability depends on
the Agent Server and platform; a supported metric may have no data. Use
lg_run_count for Agent Server runs, not the UI schema's placeholder run_count.
Omit --metrics to fetch all available metrics. Time bounds default to the last
15 minutes, and the backend picks the resolution from the time
range. This command never prompts; for an organization-scoped key, set
LANGSMITH_TENANT_ID to the workspace ID.
Default output is compact JSON grouped by section title, chart title, and series
name. Each series contains its real project_metric as metric, inferred unit
(percent, count, or null), latest, min, max, avg, and
points: [[iso_timestamp, value], ...]. Values are rounded to three decimals;
statistics use unrounded finite values and ignore missing samples. latest is
the latest non-missing value. Missing samples remain null gaps, and series with
no values have null statistics. Empty sections are marked {"_empty":true}.
The top level includes deployment_id, start_time, end_time, and
step_seconds. Bounds always describe the requested window, not the observed
point bounds. The CLI resolves omitted bounds once: end defaults to now (UTC),
and start defaults to 15 minutes before the resolved end. With only --end-time,
start is 15 minutes before that value; with only --start-time, end is now. Both
values are sent explicitly to the backend and output, even when there are no points. step_seconds is the most common gap between consecutive
timestamps within series, with ties broken by the smallest gap. Whole seconds
are integers; fractional seconds are preserved. It is null only when every
series has fewer than two timestamps. UI metadata and repeated series IDs are
omitted. The host-backend response itself is unchanged.
langgraph deploy metrics AGENT_SERVER_ID --summary
langgraph deploy metrics AGENT_SERVER_ID --raw
--summary returns the same shape without points. --raw returns the original
UI chart schema without reshaping or rounding. These flags are mutually exclusive.
Neither mode returns traces.
Size comparison using the realistic synthetic unit-test fixture (compact JSON serialization for all modes; not a live Agent Server benchmark):
| Before: raw UI schema | After: default | After: summary |
|---|---|---|
| 4,302 bytes | 1,226 bytes (72% smaller) | 806 bytes (81% smaller) |
The CLI uses a langgraph.json configuration file with these key settings:
{
"dependencies": ["langchain_openai", "./your_package"],
"graphs": {
"my_graph": "./your_package/file.py:graph"
},
"env": "./.env",
"python_version": "3.11",
"pip_config_file": "./pip.conf",
"dockerfile_lines": []
}
Git dependencies should use credential-free URLs. The CLI conservatively scans direct langgraph.json dependencies, common Python package files, uv project and lock files, and common Node.js package and lock files for HTTP Git URLs with userinfo. This check is not exhaustive: generated Docker builds can copy other files, including nested requirement or constraint files, into image layers without scanning them. For private dependencies, provide short-lived credentials through your build environment's secret-backed Git credential helper. Do not store credentials in copied files such as langgraph.json or pip_config_file.
See the full documentation for detailed configuration options.
To develop the CLI itself:
cd libs/cliuv sync# Run CLI commands directly
uv run langgraph --help
# Or use the examples
cd examples
uv sync
uv run langgraph dev # or other commands
See our Releases and Versioning policies.
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see the Contributing Guide.
Captures the outcome of a build stage so the shared wait tail can be parameterized identically for both local and remote builds.
Options for an external-image deployment that only apply when creating one, never when updating an existing deployment.
Click group that shows one level of nested subcommands in top-level help.
Group that treats leading '-' args as passthrough docker flags.
Configuration for TTL (time-to-live) behavior in the store.
Configuration for indexing documents for semantic search in the store.
This governs how text is converted into embeddings and stored for vector-based lookups.
Configuration for the built-in long-term memory store.
This store can optionally perform semantic search. If you omit index,
the store will just handle traditional (non-embedded) data without vecto
Configure a default TTL for checkpointed data within threads.
Configuration for the built-in serde, which handles checkpointing of state.
If omitted, no serde is set up (the object store will still be present, however).
Configuration for the built-in checkpointer, which handles checkpointing of state.
If omitted, no checkpointer is set up (the object store will still be present, however).
Configuration for OpenAPI security definitions and requirements.
Useful for specifying global or path-level authentication and authorization flows (e.g., OAuth2, API key headers, etc.).
Configuration for custom authentication logic and how it integrates into the OpenAPI spec.
Configuration for custom at-rest encryption logic.
Allows you to implement custom encryption for sensitive data stored in the database, including metadata fields and checkpoint blobs.
Configuration for custom run priority logic.
Allows you to decide each thread's priority settings with a Python function that the server calls at the first run on a thread with no settings, which can
Specifies Cross-Origin Resource Sharing (CORS) rules for your server.
If omitted, defaults are typically very restrictive (often no cross-origin requests). Configure carefully if you want to allow us
Customize which headers to include as configurable values in your runs.
By default, omits x-api-key, x-tenant-id, and x-service-key.
Exclusions (if provided) take precedence.
Each value can be a ra
Configuration for the built-in HTTP server that powers your Agent Server's routes and endpoints.
Definition of a graph with additional metadata.
Deployment source rooted at a uv project or workspace.
Top-level config for langgraph-cli or similar deployment tooling.
A container for referencing and managing local Python dependencies.
A "local dependency" is any entry in the config's dependencies list
that starts with "." (dot), denoting a relative path
to a loc
Click group that shows one level of nested subcommands in top-level help.
Raised when the host backend returns an error response.
Minimal JSON HTTP client for the host backend deployment service.
Return whether local deployment builds can run on this machine.
Checks:
Convert a dictionary to a YAML string.
Create a docker compose file as a dictionary in YML style.
Create a docker compose file as a string.
Build a Docker image from a LangGraph config.
Validate optional deploy commands for disallowed content.
Sanitize an Agent Server/directory name into a valid Agent Server name.
Agent Server names only allow lowercase alphanumeric characters and hyphens ([a-z0-9-]). Invalid characters are replaced with h
Validate and return a Docker image tag.
Tags may only contain [A-Za-z0-9_.-]. Defaults to "latest" when empty.
Convert a timestamp (epoch ms or string) to a readable string.
Format a single log entry for display.
Return click color for a log level.
Return every tracked package found in deps as <name>:<version> entries.
config is the absolute path to langgraph.json; dep paths in
config_json["dependencies"] are resolved relative to its pa
Show warning if image_distro is not set to 'wolfi'.
When emit is provided, each warning line is sent through it (used by
callers that need JSON-aware output). Otherwise falls back to colored
``cl
Check if a command string contains disallowed characters or patterns.
Validate a configuration dictionary.
Return warnings for unrecognized top-level keys (typos, etc.).
Load and validate a configuration file.
Generate a Dockerfile from the configuration.
CLI entrypoint for running the Agent Server.
Create a new LangGraph project from a template.
Prepare the arguments and stdin for running the Agent Server.
Create a new LangGraph project at the specified PATH using the chosen TEMPLATE.
Reshape UI charts without mutating the response; step is in seconds.
Context manager that creates a .tar.gz archive of the project source.
Uses _assemble_local_deps to discover local dependencies referenced in langgraph.json, including those outside config.parent (mon
Main entrypoint into package.
Deploy command and subcommands for the LangGraph CLI.
Detection of tracked Python packages in a local LangGraph project.
Mirrors host-backend's host.models.dependency_tracking so that CLI-based
deploys report the same tracked_packages revision metad
General-purpose utilities shared across the LangGraph CLI.
CLI entrypoint for Agent Server.
HTTP client for LangGraph host backend deployments.
Compact deployment chart responses for command-line consumers.
Create a tarball of project source for remote builds.