📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

The GitHub Copilot SDK IS INSANE! Put Copilot INSIDE Your Apps!

James Montemagno20:55

Transcription

GitHub Copilot is everywhere. I use it every single day to write code in VS Code and in Visual Studio 2026. But that's not the only place I use it. I'm constantly delegating tasks and assigning issues to the coding agent in the cloud and actually most of the time directly from my phone with the GitHub mobile app where I can pull it up, pull up a repo, give it an idea, and it gets to work. I'm constantly asking questions on github.com and I'm even working across code bases in Xcode and Intelligj when I have to work in Swift or Cotlin libraries. So truly I take GitHub copilot with me everywhere on every single machine across every single codebase.

Now one thing I find myself doing more and more is running these background tasks and booting up multiple instances of the GitHub Copilot CLI. Now this thing has been updating all the time nearly every single day. They've recently added planning mode, cloud delegation, custom agents, sub aents, and so much more. So, if you tried out the C-pilot CLI before and haven't picked it up in a while, give it another go and update to the latest version. I'll link to the change log below.

Now, I also build AI into my apps, often leveraging Microsoft Foundry, so I can build and deploy AI at scale. But what if I wanted to actually integrate the GitHub copilot agent, you know, the one that powers the CLI directly into my apps and services that I build for myself and for others? Like, wouldn't that be a crazy concept to directly have access to GitHub Copilot through your own applications? Well, that's exactly what the brand new C-Ilot SDK enables you to do. You can integrate the C-pilot SDK into your apps to manage and communicate directly with the C-Pilot CLI programmatically. This is crazy. We're talking about full session management, access to models across all providers, tool calling, streaming results, and so much more. It unlocks so much potential of apps and ideas leveraging the co-pilot CLI.

Now, this new co-pilot SDK just stealth launched into technical preview, and in minutes, I started building and leveraging it to create some astonishing apps to really help streamline my workflow. So, what I want to do today is take a look at it in action and what I built and how you can get started using the Copilot SDK to leverage all of this power of the Copilot CLI. So, let's get into it.

[music]

All right, let's go ahead and level set a little bit here. First, you have GitHub Copilot, right? This is your main hub. This is your subscription. This is your AI co-pilot to help you with all things software development. You've seen it inside of VS Code, Visual Studio, Intelligj, all the places out there that I've talked about. And this really enables you to be hyperproductive and pull in the latest and greatest, including MCPs, Skills, agents, and so much more to iterate rapidly on your codebase.

Now beyond that, there's a bunch of agents as well. So of course you can plug in to the GitHub coding agent to delegate work and assign to other agents as well that you have super focused on specific tasks. This is sort of the mission controller which I love doing and assigning work. And then you have the copilot CLI, right? And this is all part of the same GitHub copilot ecosystem enabling you to basically have GitHub copilot directly inside of your terminal via the CLI. You have the same exact things, MCP servers, skills, agents, all those goodies all inside of there, right? So it's all available diffing, [clears throat] starting up different instances, a whole bunch of things. You can just have as many of them as you want.

So let's first just take a look here, right? So here I am inside of my terminal and I'm inside of this, you know, my switch library app that I've been building. I'm going to say copilot and then I'm going to also say d-banner here. So you can see the cool copilot banner come up. Boop. There it is. Cool. So the first thing we're going to see here is like, do we trust the files in this folder? And I'm going to say yes. So from here I'm logged in. You can also do sluggin log out there. And then you can just ask it anything. So you could say can you give me an overview of this app? Right? So this is that sort of normal experience here. This is going in. It's going to take a look at the codebase and this interactive CLI experience. It's going to understand the readme, the package JSON, the list here. And this is going to say, hey, this is the my switch. It's a progressive web app tracking switch games and it gives me a bunch of overview of the architecture including a react app, Azure functions backend, superbase integration and a lot more.

Now I can do other things. So I could say you know here's library. So I could say what is this file all about? So you can reference files, give it context, obviously ask for modifications as well. So here, this is going to break down the library page components for me and then give me an overview of exactly what this uh page is going to do and how it makes up the library inside of the application.

Now beyond this though, we can do other things besides at mentions of different files. You can also use slash commands. So here we're add directories. We can browse selected agents. We can obviously clear the conversation, compact the conversation, which it also does automatically. You can delegate the work as well. So we could delegate something off to the coding agent. Uh from here you can share your entire session in a gist or a markdown. Uh you can obviously log in, log out, add MCPS, you have different models, plan mode here in models. You can go in and just say what model do you want. So whether it's a claude model, a GPT model, a Gemini model, you're good to go. Uh I could also come and say plan. So here I can implement you know kind of create a plan ahead of time. and say, "How would I implement a NES theme in the app?" So now this is going to go into that plan mode agent if you will that we're we're sort of used to as well. So we're going to say, "All right, let's put this plan together again. It's going to understand ask me questions, understand the codebase here. We're looking at the user preferences, understands the theming, and then it's going to do some clarifying questions here for the different theme approach that's going on. Should it be NES? be a third theme visual scoping and a lot more.

So I could say here delegate um create uh create create the NES theme and best pick options for me. There we go. So this is now going to go off. It's going to say, "Hey, we're going to create a pull request based on your local changes and you know draft pull request." And it's going to get to work, right? So now it's going to summarize the conversation, start a copiling coding agent session for me and get to work. So I could have it implemented locally on my machine just right directly inside of here or I could go off and just fire this off and delegate and get onto something else.

Okay, let's talk a little bit though now that you have a grasp of the CLI and the power inside of it, the actual SDK. So this is on github.com/github/copilot SDK. So it's multiplatform SDK leveraging get a copilot agent into your apps and services. So it's available in node, python, go and in C# for net developers and you'll be good to go. And of course you need the copilot CLI. So from here though, this is sort of the architecture how it works. you have your application, you just integrate the client SDK and then over JSON RPC, it'll communicate back and forth with the copilot CLI that will be running in server mode on either your machine or some you know remote connection external CLI server whatever you have on it and it's crazy simple.

So if you go into any of the libraries so here fornet there's a test there's a source and you can take a look at it. So it's just a nougat package github.copilot.sdk SDK. And this is really neat. You just create a C-pilot client, you start it up, and then you start a session. So in this case, I'm going to start a start a new session with GPT5. And we'll actually see how to see all the different um models as well. Here you get an on. So session.on and you get different events in this queue uh that will just output different data and then you'll set the result when it's done. So this idle event means it's done. And then you just send it questions over and over again. So you have this loop over and over again. And there's tons of stuff inside of here. So you can get the path, you get the CLI arguments, you know, if you want to use standard IO, the logging level restarts, environment variables, loggers, and a lot more. So you have tons of capabilities here. So here there's tons to configure such as models, tools that you wanted to call. You can list out available tools, um different providers including bring your own key if you want streaming inside of it. You can just ping it. You can do a whole bunch of stuff inside here. This is really, really cool the power of this thing.

So, let's head back over to the CLI. This is probably delegating and doing some stuff. But, I created a little hello world of the SDK. So, I did this all in C#. So, I'm going to say net run here. And what I wanted to do is sort of show off this interactive mode. So, the first thing here we're going to see it's a copilot SDK interactive demo. All the source code will be available. We'll put it in the show notes and it's going to say what models do you want? So here are the same exact models that we saw earlier in the copilot CLI listing them out. So I could detect cloud sonnet haiku gpt here. So let's do GPT uh 52. Perfect. Okay.

Now from here I've come up with a few different demos. So we can see that first it has selected GPT52. It's starting the session and it's even going to ping it. It has a unique session ID here. So that's kind of cool. Then we have some kind of code focus. I want to say, hey, imagine you're building your own sort of application on top of the CLI to help you triage your work, do performance of work, delegate out tasks, and do a bunch of stuff based on how your team works, interact with your own stuff. Uh, here I can just type any message. Uh, I can type in a demo. I can change a model. So I can say, you know, what's 2 + 2 question mark. And then it should hopefully come back with four. So this is going to send it off and boom, copilot comes back 2 + 2 equals 4. Cool.

But let's look at some other things like maybe a code review. So you can maybe automate some code review happening on your machine. So I'm going to say demo one. There we go. And now this is going to go off. It's going to say, hey, review this code. And this is doing a new database. It's doing a query. And it's going to say, hey, listen. You can prevent SQL injection, avoid creating a database per call, dispose resources, async cancellation, you know, re you user research, you know, service and and actually gives you this code quality coming in, right? So, you kind of get that same exact experience, but it's from my application that's streaming in automatically. And again, it's using my GitHub co-pilot um uh login, right? It's using, you know, my my account, which is nice.

So, let's do another one here. be performance for example. So I'm going to say demo six. Demo six here. And this is going to go off and ask for just like best performance for improving a dunet web application. Again, if you're into scripting, you're into like figuring this out. This is really crazy powerful to come in and create your own application. So this is going to show me exactly how to do performance improvements based on this knowledge tree that's coming in. I can provide additional comments, uh code suggestions, uh URLs. I could also come in and give it um you know uh tools and MCP servers. I could connect that up as as well which is awesome.

Okay, so there we go. So we exited out. Now let's see exactly what how that was created. So I'm going to come into VS Code here. And what I want to show you is just kind of how easy it is. So this is the program. So we can see that I have a bunch of sort of ASI artwork here. And the first thing we do is we have out output some some lines and we we do this CLI check for status. So again what's cool here is that you know we're inside of this file. So I can check the copilot status. I can just check environment variables see if the GitHub token is set. Else I can go off and see if it is installed. So I can go to definition here and we can see that it's just going to start up a process look for copilot version and understand what's installed here. It's going to double check to see if I'm authenticated or not inside of here. And then from there, once I have the status, it's going to select the model asynchronously. And the model selector, yeah, you guessed it, goes off and just kind of queries and sends the same command of-model to the CLI to grab that back for me automatically. So then I can select the model.

Now, what's really cool here is that when I start the conversation, I'm able to go in ping just to make sure it has a connection. I create the session. I say I'm going to stream in the results. You saw it popping in there back and forth. And then I go in and I have this loop basically of going in and just uh reading the line and understanding, you know, what I want to select. So, do I want to select a new model? Do I just type something? Do I clear it? Or do I have a demo specifically in here? And when I select a demo, I just have this simple chat helper. And all it's doing is what we saw before, right? It's has the co-pilot session. It's going to say session on and then it's going to output. So there's delta events, main messages. Uh inside of here we have some error logging and then I just send the message off to it and stream the results back into my application. So it's really really simple just to go off and pull all these in. And these demo prompts are just that. They're prompts just like you would prompt anything. So we can see all the prompts that are going in. pretty straightforward inside this one to just send that prompt off, give it additional context, anything I may need to send it.

Well, let's talk about something a little bit more unique, right? Because if we have code, I could just do this in VS Code. What if I want to create an application leveraging the Copilot CLI to do something that I do every single day? So, something I do every single day for like merge conflict or the VS Code podcast is I generate different titles, descriptions, YouTube chapters, and things like that. So, I created a podcast metadata generator leveraging the copilot CLI. So, if I go in, let me go in here and see what I have here. So, let me go into CD source. I've created a blazer web app and a console web app to show this off. So, I'm going to go and boot up the console first and let's say net run.

Now, this is using Spectre console. Um, and this is going off. And here they have this podcast metadata generator and we can see that I again have the CLI installed and it's ready to use. So inside of here I'm able to do a few things. So I want to have very similar settings. So I can change the model that I want to use. It's using the same exact thing. So I'll use 52. I can change output directories, podcast information, uh episode context or settings. So, if I want to generate like eight different titles for example, and I'll say maybe 15 words max, description lengths, chapter settings, I have all these settings that are saved for me. So, let me save settings. Let me go back here. And the power of this is I can load up a transcript and then from that transcript leverage the copilot CLI through the SDK to generate all this stuff for me. So, I'm going to say browse for files. And I have uh one in here from the most recent merge conflict, which is a pretty deep dive episode. So, it's a pretty long transcript. So, I'm going to send this. I was going to say, do I want to add any contacts? I'm going to say no. And then from here, I can go ahead and generate all the metadata, generate titles, convert it to an SRT, generate descriptions. Let's go ahead and do title here. So, again, this is now starting that session up. It's going to go and prompt off and then give that over to the co-pilot CLI. So now I have all of these inside of here. So this was all about CI/CD for Mac apps. So let's do this one. Cool. And I can generate descriptions. So this is now going to go off and generate these descriptions in real time here that I can then copy and paste inside of um you know YouTube and fireside where I host the podcast. So here we can see everything coming in of these different descriptions. I can go in, I can view the results, right? I can view the titles that were here. I can view the descriptions that were here. I can go back and generate chapters, for example. That's a long one. That's a really complex process. So, I'm creating these system prompts that go off and generate and do this work for me. And then it's going to come back and generate this. Um, which is really really neat. Like the ability to do this previously would mean I would need to spin up and talk to different APIs or talk and spin up my own, you know, backend in Foundry for example. But now I'm able to just send the prompts off, leverage the CLI, and then get it back. So we're able to get this all here. So this is really neat. Look at this. So not only did it generate five chapters, uh it gave me sort of like, you know, um the YouTube chapters, a copy paste format here, which is really cool and just seeing everything. And then from there, I can save the results, export, and a lot more.

But I didn't stop there. Uh because if we go into the Blazer one, I cannot net run that. And I created a full web application. And this web application is, you guessed it, is a Blazer web app. So I'm just going to go ahead and tap on that. Let's go back over to Edge here. Paste it in here. Perfect. And we have this full podcast metadata generator. Now, this is a Blazer server application. It's a server. It can actually connect to the through the SDK to the CLI, but we can see the same exact thing. We have settings and we can see all of the different models here. And it's going to pick the same one that I had because it's legitimately like the same exact uh setting file that's shared between the two there. And then I can generate stuff. So let's go ahead and pick a file here. Let me go into that data file. I'm going to pick that transcript again. And then here we go. So now we have a visual overview. So let me just go ahead and do titles and short description and YouTube chapters as well. So now it's going to go off and I have this entire application. is communicating over the SDK to the CLI and it's going to pull these all in. We can see here are the the outputs coming in, the generating the chapters that are coming in in real time. Chapters take a while because they're pretty complex. Uh I would say, but it's coming in and I can see the results and I can toggle through them in this nice beautiful guey. Uh, but what I love about this is that I'm using the same exact code between the console app and the web application and communicating directly to the CLI through the SDK. And the crazy part is I built all three of these applications under one hour, all using the GitHub copilot CLI to generate these applications to communicate through the SDK to the CLI, which is crazy. So, here are all the chapters coming in. I can see the descriptions coming in and then I can generate more or just go ahead and export these as well. So like this is just mind-boggling to me to be able to come in generate and create these powerful workflows, powerful AI applications that are leveraging the CLI in this type of way. And honestly, as a developer, this is a complete gamecher for me to be able to do this and create these powerful applications. So, I just think that having all of these models at your fingertips directly through your GitHub copilot subscription like this, leveraging the CLI with the SDK is crazy powerful and you absolutely have to try it out to actually feel the power of this simple streamline SDK, leveraging the absolute craziness of the Copilot CLI.

All right, there you go. That is a look at not only what the C-pilot CLI is, but how you can start to leverage the power of the C-pilot agent directly into your apps and services with the brand new technical preview copilot SDK. The team is revving on this nonstop, not only in the CLI, but on the SDK, and they want your feedback. So, get to work. Start building some cool things. I started pulling this in and building it in seconds. I'm going to link to all the repos below and all the change logs and everything that you need. I honestly took an app to kind of leverage AI and put it in to production in honestly like 20 30 minutes. It was mindboggling. And to have access to all those models at your fingertips all leveraging your co-pilot subscription is absolutely astonishing. So anyways, check it out today. Let me know what you think in the comments below and get to building. So until next time, happy coding and thanks for watching.