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

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

James Montemagno

0:00 GitHub Copilot is everywhere.

0:02 I use it every single day to write code in VS Code and in Visual Studio 2026.

0:07 But that's not the only place I use it.

0:09 I'm constantly delegating tasks and assigning issues

0:12 to the coding agent in the cloud and actually most

0:15 of the time directly from my phone with the GitHub

0:17 mobile app where I can pull it up,

0:18 pull up a repo, give it an idea, and it gets to work.

0:21 I'm constantly asking questions on github.com

0:24 and I'm even working across code bases

0:26 in Xcode and Intelligj when I have to work in Swift or Cotlin libraries.

0:30 So truly I take GitHub copilot with me

0:32 everywhere on every single machine across every single codebase.

0:36 Now one thing I find myself doing more and more is running

0:39 these background tasks and booting up

0:41 multiple instances of the GitHub Copilot CLI.

0:46 Now this thing has been updating all the time nearly every single day.

0:50 They've recently added planning mode, cloud delegation,

0:53 custom agents, sub aents, and so much more.

0:56 So, if you tried out the C-pilot CLI before and haven't picked it up in a while,

1:01 give it another go and update to the latest version.

1:03 I'll link to the change log below.

1:05 Now, I also build AI into my apps, often leveraging Microsoft Foundry,

1:09 so I can build and deploy AI at scale.

1:12 But what if I wanted to actually integrate the GitHub copilot agent, you know,

1:17 the one that powers the CLI directly into my apps

1:20 and services that I build for myself and for others?

1:22 Like, wouldn't that be a crazy concept to directly

1:25 have access to GitHub Copilot through your own applications?

1:29 Well, that's exactly what the brand new C-Ilot SDK enables you to do.

1:34 You can integrate the C-pilot SDK into your apps

1:37 to manage and communicate directly with the C-Pilot CLI programmatically.

1:41 This is crazy.

1:42 We're talking about full session management,

1:45 access to models across all providers,

1:48 tool calling, streaming results, and so much more.

1:51 It unlocks so much potential of apps and ideas leveraging the co-pilot CLI.

1:58 Now, this new co-pilot SDK just stealth

2:01 launched into technical preview, and in minutes,

2:03 I started building and leveraging it to create

2:05 some astonishing apps to really help streamline my workflow.

2:09 So, what I want to do today is take a look at it in action and what I built

2:13 and how you can get started using the Copilot SDK

2:16 to leverage all of this power of the Copilot CLI.

2:20 So, let's get into it.

2:28 [music] All right, let's go ahead and level set a little bit here.

2:33 First, you have GitHub Copilot, right?

2:35 This is your main hub.

2:36 This is your subscription.

2:37 This is your AI co-pilot to help you with all things software development.

2:41 You've seen it inside of VS Code, Visual Studio,

2:43 Intelligj, all the places out there that I've talked about.

2:46 And this really enables you to be

2:48 hyperproductive and pull in the latest and greatest,

2:51 including MCPs, Skills, agents,

2:54 and so much more to iterate rapidly on your codebase.

2:58 Now, beyond that, there's a bunch of agents as well.

3:00 So of course you can plug in to the GitHub coding agent to delegate work

3:04 and assign to other agents as well

3:05 that you have super focused on specific tasks.

3:08 This is sort of the mission controller which I love doing and assigning work.

3:12 And then you have the copilot CLI, right?

3:14 And this is all part of the same GitHub copilot ecosystem enabling you

3:18 to basically have GitHub copilot directly inside of your terminal via the CLI.

3:23 You have the same exact things, MCP servers, skills,

3:26 agents, all those goodies all inside of there, right?

3:29 So it's all available diffing,

3:30 [clears throat] starting up different instances, a whole bunch of things.

3:33 You can just have as many of them as you want.

3:35 So let's first just take a look here, right?

3:38 So here I am inside of my terminal and I'm inside of this, you know,

3:41 my switch library app that I've been building.

3:44 I'm going to say copilot and then I'm going to also say d-banner here.

3:47 So you can see the cool copilot banner come up.

3:50 Boop.

3:50 There it is.

3:51 Cool.

3:52 So the first thing we're going to see here is like,

3:53 do we trust the files in this folder?

3:55 And I'm going to say yes.

3:57 So from here I'm logged in.

3:59 You can also do sluggin log out there.

4:02 And then you can just ask it anything.

4:04 So you could say can you give me an overview of this app?

4:10 Right?

4:10 So this is that sort of normal experience here.

4:13 This is going in.

4:14 It's going to take a look at the codebase and this interactive CLI experience.

4:19 It's going to understand the readme, the package JSON, the list here.

4:24 And this is going to say, hey, this is the my switch.

4:26 It's a progressive web app tracking switch games and it gives

4:29 me a bunch of overview of the architecture including a react app,

4:33 Azure functions backend, superbase integration and a lot more.

4:37 Now I can do other things.

4:39 So I could say you know here's library.

4:41 So I could say what is this file all about?

4:45 So you can reference files, give it context,

4:48 obviously ask for modifications as well.

4:50 So here, this is going to break down the library

4:52 page components for me and then give me an overview

4:55 of exactly what this uh page is going to do

4:59 and how it makes up the library inside of the application.

5:03 Now beyond this though,

5:05 we can do other things besides at mentions of different files.

5:09 You can also use slash commands.

5:11 So here we're add directories.

5:13 We can browse selected agents.

5:15 We can obviously clear the conversation,

5:17 compact the conversation, which it also does automatically.

5:20 You can delegate the work as well.

5:22 So we could delegate something off to the coding agent.

5:25 Uh from here you can share your entire session in a gist or a markdown.

5:29 Uh you can obviously log in, log out, add MCPS,

5:33 you have different models, plan mode here in models.

5:36 You can go in and just say what model do you want.

5:38 So whether it's a claude model, a GPT model, a Gemini model, you're good to go.

5:44 Uh I could also come and say plan.

5:46 So here I can implement you know kind of create a plan ahead of time.

5:49 and say, "How would I implement a NES theme in the app?" So now this is going

5:56 to go into that plan mode agent if you

5:59 will that we're we're sort of used to as well.

6:01 So we're going to say, "All right, let's put this plan together again.

6:04 It's going to understand ask me questions, understand the codebase here.

6:08 We're looking at the user preferences, understands the theming,

6:11 and then it's going to do some clarifying questions

6:14 here for the different theme approach that's going on.

6:17 Should it be NES?

6:18 be a third theme visual scoping and a lot more.

6:22 So I could say here delegate um create uh create

6:28 create the NES theme and best pick options for me.

6:37 There we go.

6:38 So this is now going to go off.

6:39 It's going to say, "Hey,

6:40 we're going to create a pull request based on your local changes

6:43 and you know draft pull request." And it's going to get to work, right?

6:46 So now it's going to summarize the conversation,

6:49 start a copiling coding agent session for me and get to work.

6:52 So I could have it implemented locally

6:53 on my machine just right directly inside of here or I could go off and just fire

6:58 this off and delegate and get onto something else.

7:01 Okay, let's talk a little bit though now that you have a grasp

7:04 of the CLI and the power inside of it, the actual SDK.

7:08 So this is on github.com/github/copilot SDK.

7:12 So it's multiplatform SDK leveraging get

7:14 a copilot agent into your apps and services.

7:17 So it's available in node, python,

7:20 go and in C# for net developers and you'll be good to go.

7:24 And of course you need the copilot CLI.

7:26 So from here though, this is sort of the architecture how it works.

7:29 you have your application,

7:30 you just integrate the client SDK and then over JSON RPC,

7:33 it'll communicate back and forth with the copilot CLI

7:36 that will be running in server mode on either

7:39 your machine or some you know remote connection external CLI

7:43 server whatever you have on it and it's crazy simple.

7:47 So if you go into any of the libraries so here fornet there's

7:51 a test there's a source and you can take a look at it.

7:53 So it's just a nougat package github.copilot.sdk SDK.

7:57 And this is really neat.

7:58 You just create a C-pilot client, you start it up, and then you start a session.

8:04 So in this case, I'm going to start a start a new session with GPT5.

8:07 And we'll actually see how to see all the different um models as well.

8:12 Here you get an on.

8:14 So session.on and you get different events in this queue uh that will

8:18 just output different data and then you'll set the result when it's done.

8:22 So this idle event means it's done.

8:23 And then you just send it questions over and over again.

8:26 So you have this loop over and over again.

8:28 And there's tons of stuff inside of here.

8:29 So you can get the path, you get the CLI arguments, you know,

8:32 if you want to use standard IO,

8:34 the logging level restarts, environment variables, loggers, and a lot more.

8:39 So you have tons of capabilities here.

8:41 So here there's tons to configure such as models, tools that you wanted to call.

8:46 You can list out available tools, um,

8:49 different providers including bring your own key

8:51 if you want streaming inside of it.

8:53 You can just ping it.

8:54 You can do a whole bunch of stuff inside here.

8:55 This is really, really cool the power of this thing.

8:59 So, let's head back over to the CLI.

9:01 This is probably delegating and doing some stuff.

9:03 But, I created a little hello world of the SDK.

9:08 So, I did this all in C#.

9:09 So, I'm going to say net run here.

9:12 And what I wanted to do is sort of show off this interactive mode.

9:16 So, the first thing here we're going to see it's a copilot SDK interactive demo.

9:20 All the source code will be available.

9:21 We'll put it in the show notes and it's going to say what models do you want?

9:24 So here are the same exact models that we

9:26 saw earlier in the copilot CLI listing them out.

9:29 So I could detect cloud sonnet haiku gpt here.

9:33 So let's do GPT uh 52.

9:37 Perfect.

9:38 Okay.

9:39 Now from here I've come up with a few different demos.

9:42 So we can see that first it has selected GPT52.

9:45 It's starting the session and it's even going to ping it.

9:48 It has a unique session ID here.

9:50 So that's kind of cool.

9:51 Then we have some kind of code focus.

9:54 I want to say, hey, imagine you're building your own sort

9:58 of application on top of the CLI to help you triage your work,

10:02 do performance of work, delegate out tasks,

10:03 and do a bunch of stuff based on how your team works,

10:06 interact with your own stuff.

10:07 Um, here I can just type any message.

10:09 Uh, I can type in a demo.

10:11 I can change a model.

10:12 So I can say, you know, what's 2+ 2 question mark.

10:16 And then it should hopefully come back with four.

10:18 So this is going to send it off and boom, copilot comes back 2 plus 2 equals 4.

10:23 Cool.

10:23 But let's look at some other things like maybe a code review.

10:26 So you can maybe automate some code review happening on your machine.

10:29 So I'm going to say demo one.

10:31 There we go.

10:32 And now this is going to go off.

10:34 It's going to say, hey, review this code.

10:36 And this is doing a new database.

10:38 It's doing a query.

10:39 And it's going to say, hey, listen.

10:41 You can prevent SQL injection, avoid creating a database per call,

10:45 dispose resources, async cancellation, you know, re you user research, you know,

10:51 service and and actually gives you this code quality coming in, right?

10:54 So, you kind of get that same exact experience,

10:56 but it's from my application that's streaming in automatically.

10:59 And again, it's using my GitHub co-pilot um uh login, right?

11:05 It's using, you know, my my account, which is nice.

11:08 So, let's do another one here.

11:09 be performance for example.

11:10 So I'm going to say demo six.

11:12 Demo six here.

11:14 And this is going to go off and ask

11:15 for just like best performance for improving a dunet web application.

11:19 Again, if you're into scripting, you're into like figuring this out.

11:21 This is really crazy powerful to come in and create your own application.

11:25 So this is going to show me exactly how to do

11:27 performance improvements based on this knowledge tree that's coming in.

11:30 I can provide additional comments, uh code suggestions, uh URLs.

11:35 I could also come in and give it um you know uh tools and MCP servers.

11:40 I could connect that up as as well which is awesome.

11:43 Okay, so there we go.

11:44 So we exited out.

11:45 Now let's see exactly what how that was created.

11:48 So I'm going to come into VS Code here.

11:50 And what I want to show you is just kind of how easy it is.

11:53 So this is the program.

11:55 So we can see that I have a bunch of sort of ASI artwork here.

11:58 And the first thing we do is we have out output

12:01 some some lines and we we do this CLI check for status.

12:06 So again what's cool here is that you know we're inside of this file.

12:10 So I can check the copilot status.

12:12 I can just check environment variables see if the GitHub token is set.

12:16 Else I can go off and see if it is installed.

12:18 So I can go to definition here and we can see that it's just

12:22 going to start up a process look

12:23 for copilot version and understand what's installed here.

12:26 It's going to double check to see if I'm authenticated or not inside of here.

12:31 And then from there, once I have the status,

12:33 it's going to select the model asynchronously.

12:36 And the model selector, yeah, you guessed it,

12:38 goes off and just kind of queries and sends the same

12:41 command of-model to the CLI to grab that back for me automatically.

12:46 So then I can select the model.

12:48 Now, what's really cool here is that when I start the conversation,

12:52 I'm able to go in ping just to make sure it has a connection.

12:55 I create the session.

12:57 I say I'm going to stream in the results.

12:58 You saw it popping in there back and forth.

13:01 And then I go in and I have this loop basically

13:03 of going in and just uh reading the line and understanding,

13:08 you know, what I want to select.

13:09 So, do I want to select a new model?

13:11 Do I just type something?

13:12 Do I clear it?

13:13 Or do I have a demo specifically in here?

13:15 And when I select a demo, I just have this simple chat helper.

13:18 And all it's doing is what we saw before, right?

13:20 It's has the co-pilot session.

13:22 It's going to say session on and then it's going to output.

13:26 So there's delta events, main messages.

13:29 Uh inside of here we have some error logging and then I just

13:32 send the message off to it and stream the results back into my application.

13:36 So it's really really simple just to go off and pull all these in.

13:40 And these demo prompts are just that.

13:41 They're prompts just like you would prompt anything.

13:43 So we can see all the prompts that are going in.

13:45 pretty straightforward inside this one to just send that prompt off,

13:49 give it additional context, anything I may need to send it.

13:52 Well, let's talk about something a little bit more unique, right?

13:55 Because if we have code, I could just do this in VS Code.

13:57 What if I want to create an application leveraging the Copilot

14:00 CLI to do something that I do every single day?

14:03 So, something I do every single day for like merge

14:05 conflict or the VS Code podcast is I generate different titles,

14:10 descriptions, YouTube chapters, and things like that.

14:14 So, I created a podcast metadata generator leveraging the copilot CLI.

14:20 So, if I go in, let me go in here and see what I have here.

14:23 So, let me go into CD source.

14:25 I've created a blazer web app and a console web app to show this off.

14:31 So, I'm going to go and boot up the console first and let's say net run.

14:36 Now, this is using Spectre console.

14:38 Um, and this is going off.

14:40 And here they have this podcast metadata generator and we can see

14:43 that I again have the CLI installed and it's ready to use.

14:46 So inside of here I'm able to do a few things.

14:48 So I want to have very similar settings.

14:50 So I can change the model that I want to use.

14:52 It's using the same exact thing.

14:54 So I'll use 52.

14:55 I can change output directories,

14:56 podcast information, uh episode context or settings.

15:00 So, if I want to generate like eight different titles for example,

15:05 and I'll say maybe 15 words max, description lengths, chapter settings,

15:10 I have all these settings that are saved for me.

15:12 So, let me save settings.

15:13 Let me go back here.

15:15 And the power of this is I can load up a transcript and then

15:18 from that transcript leverage the copilot CLI through

15:21 the SDK to generate all this stuff for me.

15:23 So, I'm going to say browse for files.

15:25 And I have uh one in here from the most recent merge conflict,

15:29 which is a pretty deep dive episode.

15:31 So, it's a pretty long transcript.

15:33 So, I'm going to send this.

15:35 I was going to say, do I want to add any contacts?

15:36 I'm going to say no.

15:38 And then from here, I can go ahead and generate all the metadata,

15:42 generate titles, convert it to an SRT, generate descriptions.

15:46 Let's go ahead and do title here.

15:48 So, again, this is now starting that session up.

15:50 It's going to go and prompt off and then give that over to the co-pilot CLI.

15:54 So now I have all of these inside of here.

15:56 So this was all about CI/CD for Mac apps.

15:59 So let's do this one.

16:01 Cool.

16:02 And I can generate descriptions.

16:04 So this is now going to go off

16:05 and generate these descriptions in real time here that I

16:08 can then copy and paste inside of um you

16:12 know YouTube and fireside where I host the podcast.

16:15 So here we can see everything coming in of these different descriptions.

16:19 I can go in, I can view the results, right?

16:21 I can view the titles that were here.

16:23 I can view the descriptions that were here.

16:26 I can go back and generate chapters, for example.

16:28 That's a long one.

16:29 That's a really complex process.

16:31 So, I'm creating these system prompts that go

16:33 off and generate and do this work for me.

16:35 And then it's going to come back and generate this.

16:38 Um, which is really really neat.

16:39 Like the ability to do this previously would mean I would need to spin

16:43 up and talk to different APIs or talk and spin up my own,

16:47 you know, backend in Foundry for example.

16:49 But now I'm able to just send the prompts off,

16:51 leverage the CLI, and then get it back.

16:53 So we're able to get this all here.

16:55 So this is really neat.

16:56 Look at this.

16:56 So not only did it generate five chapters, uh it gave me sort of like, you know,

17:02 um the YouTube chapters, a copy paste format here,

17:05 which is really cool and just seeing everything.

17:08 And then from there, I can save the results, export, and a lot more.

17:12 But I didn't stop there.

17:13 Uh because if we go into the Blazer one, I cannot net run that.

17:18 And I created a full web application.

17:21 And this web application is, you guessed it, is a Blazer web app.

17:25 So I'm just going to go ahead and tap on that.

17:26 Let's go back over to Edge here.

17:29 Paste it in here.

17:30 Perfect.

17:30 And we have this full podcast metadata generator.

17:33 Now, this is a Blazer server application.

17:34 It's a server.

17:35 It can actually connect to the through the SDK to the CLI,

17:39 but we can see the same exact thing.

17:40 We have settings and we can see all of the different models here.

17:43 And it's going to pick the same one that I had because it's

17:46 legitimately like the same exact uh setting

17:48 file that's shared between the two there.

17:51 And then I can generate stuff.

17:52 So let's go ahead and pick a file here.

17:54 Let me go into that data file.

17:56 I'm going to pick that transcript again.

17:58 And then here we go.

17:59 So now we have a visual overview.

18:00 So let me just go ahead and do

18:01 titles and short description and YouTube chapters as well.

18:05 So now it's going to go off and I have this entire application.

18:08 is communicating over the SDK to the CLI and it's going to pull these all in.

18:12 We can see here are the the outputs coming

18:14 in, the generating the chapters that are coming in in real time.

18:18 Chapters take a while because they're pretty complex.

18:20 Uh I would say, but it's coming in and I can see

18:22 the results and I can toggle through them in this nice beautiful guey.

18:26 Uh, but what I love about this is that I'm using the same exact code between

18:30 the console app and the web application

18:33 and communicating directly to the CLI through the SDK.

18:37 And the crazy part is I built all three of these applications under one hour,

18:43 all using the GitHub copilot CLI to generate these applications

18:48 to communicate through the SDK to the CLI, which is crazy.

18:52 So, here are all the chapters coming in.

18:53 I can see the descriptions coming in and then I can

18:56 generate more or just go ahead and export these as well.

18:59 So like this is just mind-boggling to me to be

19:02 able to come in generate and create these powerful workflows,

19:06 powerful AI applications that are leveraging the CLI in this type of way.

19:12 And honestly, as a developer, this is a complete gamecher for me to be

19:16 able to do this and create these powerful applications.

19:19 So, I just think that having all of these models at your fingertips

19:23 directly through your GitHub copilot subscription like this, leveraging the CLI

19:28 with the SDK is crazy powerful and you absolutely have to try

19:32 it out to actually feel the power of this simple streamline SDK,

19:37 leveraging the absolute craziness of the Copilot CLI.

19:41 All right, there you go.

19:42 That is a look at not only what the C-pilot CLI is,

19:46 but how you can start to leverage the power of the C-pilot agent

19:50 directly into your apps and services

19:52 with the brand new technical preview copilot SDK.

19:57 The team is revving on this nonstop, not only in the CLI,

20:01 but on the SDK, and they want your feedback.

20:03 So, get to work.

20:04 Start building some cool things.

20:05 I started pulling this in and building it in seconds.

20:08 I'm going to link to all the repos below

20:10 and all the change logs and everything that you need.

20:12 I honestly took an app to kind of leverage AI

20:16 and put it in to production in honestly like 20 30 minutes.

20:20 It was mindboggling.

20:21 And to have access to all those models at your fingertips all leveraging

20:25 your co-pilot subscription is absolutely astonishing.

20:28 So anyways, check it out today.

20:30 Let me know what you think in the comments below and get to building.

20:32 So until next time, happy coding and thanks for watching.

Study with Looplines Download Captions Watch on YouTube