Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/cli-no-reload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@langchain/langgraph-cli": patch
---

What: add --no-reload option to js CLI
Why: to match python implementation
How: add --no-reload argument to langgraph-cli dev to run the dev server without watch mode
11 changes: 7 additions & 4 deletions libs/langgraph-cli/src/cli/dev.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ builder
.option("-p, --port <number>", "port to run the server on", "2024")
.option("-h, --host <string>", "host to bind to", "localhost")
.option("--no-browser", "disable auto-opening the browser")
.option("--no-reload", "disable automatic reloading when code changes are detected")
.option("-n, --n-jobs-per-worker <number>", "number of workers to run", "10")
.option("-c, --config <path>", "path to configuration file", process.cwd())
.option(
Expand Down Expand Up @@ -171,10 +172,12 @@ builder
}
};

watcher.on("all", async (_name, path) => {
logger.warn(`Detected changes in ${path}, restarting server`);
launchServer();
});
if (options.reload) {
watcher.on("all", async (_name, path) => {
logger.warn(`Detected changes in ${path}, restarting server`);
launchServer();
});
}

// TODO: sometimes the server keeps sending stuff
// while gracefully exiting
Expand Down