This tutorial demonstrates how to deploy AI agents using the LangGraph CLI, covering the complete workflow from scaffolding a new agent project with templates, testing locally in LangSmith Studio with hot reload capabilities, to deploying to production with a single command, along with managing deployments through logs, listing active deployments, and deleting them.
Deploy AI Agents From Terminal With LangGraph CLI Tutorial
Added:Introducing Langraph Deploy. Deploy an agent to Langsmith in just a single command. You can go from prototype to production in minutes, all without leaving your terminal. In this video, we're going to walk through that whole workflow from scaffolding a new agent to testing it out locally in Linksmith Studio to finally deploying it using our CLI. Let's go ahead and get right into it. All right, so let's go ahead and get started from scratch. The first thing that we're going to do is run uv tool install langraph cli. That's going to globally install the CLI. [music] The next thing that we can do is run langraph new.
That's going to let us create a langraph application from scratch from one of these pre-made [music] templates. So let's go ahead and give it a name or a path. So I'm going to call this deep agent.
Next, it's going to ask us to pick one of these templates. So you can see we have one already for deep agents or a simple [music] uh create agent react style agent and also a just default minimal langraph project. I'm actually going to go ahead and use the deep agent. It's then going to ask us if we want to use Python or TypeScript. Let's go ahead and use Python. And now we're ready to go. So if I go over into our folder here, we can see we've downloaded this deep agent. So the next step is to go ahead and set up myv file. I'm going to go ahead and set my lang API key and also my enthropic API key since I'll be using that as our LL provider. All right, so we use the scaffolding here. We set our environment variables. And now I want to go ahead and test this out locally before I get ready to deploy it on to Langmith. So let's go ahead and do that.
First thing I'm going to do is go ahead and get into the correct directory.
I'm then going to run uh to download all of our dependencies. [music] And now I can actually go ahead and run this locally using langraph dev.
And what that's going to do is go ahead and package up our agent into a local server and allow us to test this locally using Langmith [music] Studio. Great. So you can see now in Langmith Studio, we're able to interact with our agent that's running locally directly from our browser. [music] So I can go ahead and send in a message here, something just like hi.
And we can see the execution happens live.
I can also switch back over into our terminal and we can see the logs here from our server that's running locally.
Great. Now, back into our browser here, there's a few different things in Studio that are really nice when you're kind of building and testing locally. I can also switch over to this trace view on the top right and we can view that trace right here. So, we can see that was a pretty simple run here. It just went into this chatthropic call, had a list of different tools from our deep agent harness and responded back to us. And we can see our system prompt and our eventual output. So Studio is great for rapidly kind of iterating on your agents locally, debugging what's happening, and just overall getting a picture into how your agents performing.
The other thing that comes with Studio is this hot reload feature. So I can go back into Studio here.
If I go back into my agent and let's say I wanted to make a teeny tiny change to my agent here and I don't know modify the system prompt. So let's say I said um you speak only in Spanish.
If I open up my terminal you can see that it's hot reloading. I can then switch back into my browser and send it another message. So, let's just open up a new thread. And I can open this up and just say hello. [music] And we'll see now it's going to respond back in Spanish. That's what's really nice about Studio is we can really quickly iterate on our agent design. Um, we can change architectures, prompts, the models that we're using, um, and see those reflected live without having to continually kind of redeploy or retest our agents. So, really, really nice.
Okay, so now back in our project, [music] I'm ready to take this agent into production. I test it out locally.
It's working as intended and I'm ready to get this into our Langmith deployments. [music] Let's go ahead and open up our terminal and see how we can do this directly via the CLI.
Next thing, we'll go ahead and run uvun langraph deploy.
We'll give our deployment a name. I'm going to name it something simple like deep agent. You see it goes ahead and starts off that deployment process. So, this might take a few minutes. So, I'm going to let this run for a little and check back in.
Great. So, we can see the deployment didn't take that long at all. We have a deployment ID that we can use going forward. [music] It gave us a status URL to check on the status while it was building. Then also the actual URL to go ahead and interact with this agent either via the SDK or via API. So, let's go ahead and look at this deployment in our UI. [music] Looking at our deployment in the UI, you can see every deployment comes with a few different things. [music] We've able to see the status of this deployment and its health. We can see the different traces that have come in through the linksmith integration. So far, we haven't had any cuz we just deployed.
You can see the API URL that we mentioned and that it served to us in the CLI. Then also some API docs. So, with every deployment, we get access to a variety of different endpoints and routes that are pre-built into our agent server. We have a video covering all of these in depth. Um, [music] but one of the notable ones is ATA and MCP protocols come out of the box. We can also kick off and create conversations or what we call threads with our agent.
We can also create [music] different configurations and save and version them which we call assistance. So, I'd encourage you to check those out um and learn more about that through our docs and other videos.
Great. So, let's go back over into our actual deployment. We can see the other thing that comes with every deployment is the ability to pull it into studio just like we saw before. So let's just make sure that this is working as intended in studio. I again can just say something like hi.
And we can see it's still responding us in Spanish because we haven't updated that from the last time we made the change locally. But this is working great. So I can go back into our deployment UI and we can take a further look.
There's plenty more to our deployments and I encourage you to check out our docs and our other videos on it. But let's go back into the terminal so we can keep interacting with this deployment directly from there. Great.
So back in this terminal, one of the things that I can do is actually see the logs directly in our terminal. So I can do UV run langraph deploy logs and I can trail it by the name.
[music] All right. So now we're going to be able to see the logs as they come in. Let me go ahead and switch over into Studio again and we can take a peek. [music] So, I'm going to make another request like tell me story.
We can switch over into our terminal.
I'm going to see these threads get kicked off and we're in here. [music] Great. So, I'm going to go ahead and exit out of that. The other thing that we can do is go ahead and list all of our deployments. So, I can do the same thing. you rerun lang graph deploy I can just ask it to list all the deployments for us we can see we have our deep agent and we have chat langchain dev which is another deployment on this workspace the next thing I'll show you is how we can wind down or delete a deployment so I can do uv run lang graph [music] deploy delete we'll just pass in that ID from this deep agent deployment it's going to ask us if we're sure go ahead and say yes and that's it our deployment is now deleted. We can go back to the UI to double check and we can see now that project is no longer found. And if I go to all of our deployments here, barely have chat link chain dev.
So that's the full loop with our CLI. We can use langraph new to start a new project from a template. We can then use langraph dev to go ahead and test that agent out locally using studio. And then finally, when we're ready to deploy it, we can use langraph deploy to ship it right into production. We also have additional commands such as logs, list, and delete to help you manage your deployments from the CLI. If you want to try the deploy CLI for yourself, sign up for free at langsmith.com and check out our docs to get started. If you have any questions, you can find us on the lang chain forum.
Up Next

AI Agent Development: Debug, Evaluate, and Deploy with LangSmith
@LangChain
154 views•2026-03-12

IFS Therapy Demonstration: Complete Session with Unburdening
@IFSCA
95.9K views•2021-01-13

FastAPI vs Flask vs Django: Choosing the Right Python Web Framework
@TechWithTim
302.5K views•2024-05-26

Game of Thrones Opening Credits: A Cinematic Analysis
@gameofthrones
46.3M views•2011-04-18
Related Study Plans & Knowledge Roadmaps
Structured learning paths in General & Interdisciplinary Studies
















![[Node.js] 백엔드 맛보기 | 환경 변수 관리 | 보안 향상 | dotenv](https://i.ytimg.com/vi/OEZedYK5biA/maxresdefault.jpg)






















