What I Use Instead
- Views
- 53.8K
- 53,792
- Outlier
- ×1.1
- Median 47.5K
- Length
- 19:59
- Published
- Jun 23
- Tuesday
- Comments
- 136
- 1.5K likes
Script
How it's written
- Words
- 5,241
- Words a minute
- 262
- Reading time
- 23 min
- Segments
- 14
The hook
0:00–0:26Pi is an absolutely incredible agent harness and it's very similar to something like Claude code or open code, but the big difference is that Pi is incredibly minimal and it's super customizable. And this means that you can essentially do whatever you want with Pi to make it work exactly like you want. In this video, I'm going to be covering everything that you could possibly need to know about Pi from getting started with it all the way up to how to customize it to your exact needs. And if you want to dive even deeper, I have a full cheat sheet that
Structure
Pi is an absolutely incredible agent harness and it's very similar to something like Claude code or open code, but the big difference is that Pi is incredibly minimal and it's super customizable. And this means that you can essentially do whatever you want with Pi to make it work exactly like you want. In this video, I'm going to be covering everything that you could possibly need to know about Pi from getting started with it all the way up to how to customize it to your exact needs. And if you want to dive even deeper, I have a full cheat sheet that covers all of the different keyboard shortcuts as well as the different prompting and command related things you can do inside of Pi. It's available in both light and dark mode and I have a version for Mac, Linux, and Windows. If you want to check that out, it's completely free and it'll be linked down in the description below. Welcome back to Web Dev Simplified. My name is Kyle and my job is to simplify the web for you. The very first thing we need to do is just install Pi on our system. I'd recommend just running the NPM command. Essentially, copy this command, run this in your clipboard, and that's going to download that Pi agent for you. Once you've done that, inside of your terminal, you can just type Pi or Pi, hit enter, and that's going to open up Pi for you. Yours may not have quite as much information. For example, this skills section for you may be completely blank depending on if you've downloaded skills before, but essentially, this is what Pi looks like. You can see here that we have a section where we can type in information and then we also have different slash commands that we can use to change different things inside of here. And if you're connected up with a model, for example, I could just ask it to say hi and it's going to respond to me with whatever it wants based on whatever I type in as my prompt. So, this is a way for me to prompt my AI and have it respond to me directly. Now, obviously,
Watch from 0:00when you first get this set up, you're not going to have any models or anything set up. So, when you try to type something, you're going to get some type of error saying that you need to configure your models. Now, if you have a subscription to a service, the easiest way to do this is just to type in {slash} login. This is going to allow you to either use an API key if you're using API key pricing or you can just use a different subscription. For example, you can set up any of these subscriptions here. I can just click on GitHub Copilot and now it's going to let me essentially sign in with GitHub Copilot. So, here I can just click enter and then all I would need to do is follow essentially all of these different prompts, so I can click on this to open it up. I can say that that is me, so I'll continue signing in, and then I just need to make sure I get that device code. So, I'm going to just copy that code right here. And we'll just paste that code directly into here, click continue, and now essentially that's authorizing my GitHub to be able to be used with this. And now with that done, we can actually go back into here, and we are logged in specifically with GitHub Copilot. Now, once you do that, we need to be able to determine what model we want to use. So, I can type in {slash} model, and that is going to allow me to select all the different models I have available. Now, I have a few local models set up. You can see these LM Studio ones, for example, Qwen 3.6. And if you want to learn how you can set up a full local AI setup, I'm going to link that in the cards and description for you. But as you can see here, I also have all my different GitHub Copilot models. And if I were to choose one of these models, we can test to see if that's working by just saying say hi, and hopefully it's able to respond to me relatively quickly. There you go, you can see that that is working like we expect. Now, I'm going to be using the local version of the model that I have, which is that Qwen model, so we'll just search for that. Make sure I have the correct one loaded, there we go. And now if I just do say hi again, it's going to use that local model instead of the model that's
Watch from 1:31being paid for. So, now we essentially have the basic setup for our Pi terminal. We can hook up model, we can run different commands with that model, but what exactly makes Pi different than something like Claude Code or Open Code? The big thing that makes it different is how minimal Pi is. Lots of these other harnesses come with tons and tons of different tools baked in, but Pi is super minimal. Essentially, the only thing that it has for tools is the ability to read files, edit files, and do bash commands. This means there's no built-in for things like GitHub integrations or stuff like that, which for most people is perfectly fine, cuz you can either do that through a bash command, or you can just set up the terminal to be used that properly for you. So, you can customize Pi to have those different tools. It starts you out with essentially the bare minimum, because that's enough to actually get started. And it also doesn't have any like MCP support, there's no sub agents, there's no plan mode, there's no to-do list, there's none of that additional stuff that you may be used to. Now, the nice thing is there's additional extensions and packages you can use and download and install to get those features if you want, but you start with a super clean slate and you can add on whatever you want and customize it however you want. Now, let's go ahead and actually test out some of the different things we can do inside of Pi now that we have this set up. For example, let's say that I want to start a brand new session cuz I have a bunch of information in this session that doesn't really make sense for what I want to do. I can just type in {slash} new and that allows me to start a brand new completely blank session and from here I can do whatever I want. For example, if I wanted to reference a file that exists inside my project, I can use the @ symbol and that's going to give me nice auto complete. We can look, I have four different files inside this project and they are showing up right here. And if I were to start typing, you can see
Watch from 3:02it'll auto complete that for me which is super nice. And I can just say like, "Tell me what is in this file?" And it's going to go through and it's going to use that read tool that it has, it's going to read through that entire thing and then it's going to tell me all the different information about what the specific file is. Also, something that you may want to do is run terminal commands directly. For example, I'm inside here and anything I type goes as a prompt directly to the model, but instead I may want to run a command. To do that, you can put an exclamation point in front of whatever text you type and now this is going to run an actual command. So, I can type in LS and you can see it ran that LS command. But, by putting only one exclamation point before my command, it actually sends this to the model. So, I can say, "What does that say?" and it's going to tell me essentially what this LS command is. And you can see here, it's essentially just regurgitating that information cuz that's what I asked it to do. You don't always want to send your commands to the model though. So, if you use two exclamation points before whatever your command is, we'll just do LS again, this does not actually get sent to your model. So, the model has no way of seeing this information. So, one exclamation point sends that data to the model, two exclamation points just keeps it personal to you and doesn't send it to anyone else. Now, one other thing that we can do is we can really easily change what the thinking mode is for our model as well as swap between models with different keyboard shortcuts. For example, hitting control P is going to shift me to the next model in my preferred list. So, when I hit control P, you can see it's swapping me through all the different models. and And if I do control shift P, that's just going to move me backwards, so I can go back to the model that I was originally on.
Watch from 4:33Also, you can change what the thinking mode of your model is as well. That's just going to be done with shift tab. So, right now we're in medium thinking mode, which is in the bottom right-hand corner here. If I click shift tab, you can see I can shift to high, off, minimal, and so on. And it's also telling me right here what thinking mode I'm using for this model. Now, one annoying thing is by default that shift P is going to go through every single model that you have downloaded. So, what you can do is we can type {slash} scoped models just like that. And here we can select the specific models we want to shift through with that control P. So, what I can do, let's just say I want to do like Sonnet 4.6. So, we'll check on that one. And then let's come in and we'll find my Quinn model as well. So, we'll just search for that. There we go. So, now we only have two different models that we can search for. So, now when I do control P, it's just going to toggle me between those two models back and forth, cuz those are the only two models that I have supported. Now, the next big thing that's built into Pi is essentially the entirety of session management. And a session is just the entire conversation you're having with the LLM. And a session is essentially just the conversation that you're having with the model. And in order to see all the details for your current session, you can just type in session just like this. And this is going to give you all the information for whatever your current session is, where everything is being stored, all the different messages, tokens, the cost, and so on. Like if you're using a paid model, that cost information will be here as well. So, it'll give you all the information you could want. And the nice thing about Pi is it allows you to actually swap between sessions and do various things with your sessions incredibly easily.
Watch from 5:55For example, I can type in {slash} resume, and this allows me to jump to essentially any of the different sessions that I've done inside of this section. You can see I had this Sudoku application I was creating when I was testing out some local model capabilities. And you can see some other stuff that I had inside of here for testing. And the one that we did in this video was that say hi one. You can see I can jump directly back into that session, and I can start typing directly into that session if I wanted. Another really nice thing is you can actually go into a tree view of your session, and that allows you to essentially restart your session at various different points. So, for example, if I do {slash} tree, this is going to show me all the different messages that were being sent inside this session. And this is going to include both my messages as well as the agent's message. And if I wanted to go back to a different point in time, I could just select that point in time. Let's say I want to go to this second say hi message. I could choose that, and I could just say that I don't really care about summarizing it. And now you can see I've gone back exactly where that message is. And now let's say I want to change this to say bye. So, it's going to say bye to me now. And if I go back into my tree, we can actually see that I have a branching point in the history. You can see here is that session say bye. That's the one I just created. And then here say hi is the original one, and you can see all the stuff that was being generated by that. So, now I have a branching history that I can navigate between if I really wanted. And this is a great way to be able to, you know, let's say you prompt something and the AI doesn't quite do it like you expect, you can go back in your history and be like, "Oh, you know what? I'm going to prompt that in a different way." And if the second time you do it, it's still not quite right, you can go back to that first way and say, "You know what? We're going to stick with this very first way right here." Now, some other handy things that you can do. First of all, control C will just close out whatever your current prompt is, so no matter what you have typed inside of here, control C clears it, which is really
Watch from 7:15handy. And another thing that's really handy is the ability to essentially duplicate the actual session you're on. I can type in {dash} {slash} clone just like that, and that's going to create a brand new duplicate of my current session. So, when I was doing that tree stuff, I was all kind of in one session that was being forked and treed around, but with clone, I create a brand new session that is just a duplicate of the session that I was currently inside of. And we can actually see that. If I go into that tree command, you can see all that branching and stuff is no longer there, cuz I just created a clone of essentially that one single branched path that I was down. Now, another thing you can do is the {slash} fork command, and that works very similar to tree, but essentially it allows me to go back to any point in history and say I want to create a brand new session from that point in history. So, clone uses the current point in history, fork just says, "You know what? I'm going to go back to this point in history and create a brand new session at this exact point." So, now if I were to just do a tree for this, we can see that there's currently nothing in the tree, cuz I forked from the very first message. So essentially I created a brand new session that's completely empty. Lastly, the other command that you want to worry about when it comes to sessions is compact and that's just going to take your session and it's going to compact it down to reduce the amount of context space being used. Often times you don't really need to worry about manually doing this, but it is there if you want to be able to compact that context to make sure that you have a smaller context overall. Now speaking of context, one really nice thing about pie is if you have a file called agent.md, so we can just come in here agents .md Anything that's inside of this file right here is going to be automatically loaded up by your pie agent as soon as you start it and this is like your general context file that gets loaded all the time and usually these are like
Watch from 8:46project specific, but you can create a general one as well that you can store inside of your home directory for pie if you wanted one for every pie instance, but you can do them project specific. You can also overwrite the system prompt by just creating a system.md, that's going to overwrite the system prompt, but the really nice thing about pie is the built-in system prompt for pie is super super minimal, so you probably don't even have to mess with it at all. Now the next thing I want to talk about in pie is going to be how you can manage skills in pie. The really nice thing is if you have a skill installed either inside of your current directory or a skill installed globally, pie will automatically pick those up. And if you're not sure what skills are how to work with them, I have a full crash course covering everything you need to know from downloading all the way to writing your own skills. It'll be linked in the cards and description for you. But to use a skill, all you do is type {slash} skill {colon} and then whatever the name of that skill is. So if I wanted to use a specific skill, I could just come in here and use that exact skill. So let's just for example do this random grill with docs. I could just use that specific skill just like that and it's going to work like I would want. Now I didn't give it any information after the skill, but I could give it additional information afterwards if I wanted. Now in our case, I don't actually want this to do anything. So to stop this, I can just click escape and it's not actually running right now, but if I just type something and I click escape, that's just going to abort whatever the AI is currently doing. So I can start over typing something else if I wanted. Another really nice thing is let's say I tell the AI to read three files from this folder.
Watch from 10:17It's going to go through and it's going to try to read those different files. Now, the nice thing is if I want to interrupt this, for example, I notice it's doing something kind of weird, I can just say, for example, stop. And as soon as it's done with whatever tool calls it is doing, you can see that it's now going to take in my command and it's going to do whatever I tell it to do. So, this is a way for me to essentially queue up a command to run in the middle of a prompt that is currently happening, which is really nice. Another thing that you may want to do, we'll just say read three files again, and I can say, "You know what? I want a command, but I want to do it after it's done reading those files." So, I can say summarize then and looks like it already finished, so we'll just tell it to read three more again. Let's just close out of this. Tell it to read three files and then we'll say summarize. And now I can hit Alt Enter and what that's going to do is it's going to wait for everything to finish and then it's going to run that command after everything is finished. So, it essentially allows me to queue something up directly after a current command finishes. As you can see, it just finished everything and now it's running that command. So, if you just use Enter to type in a command normally, it's just going to interrupt whatever is happening pretty much as soon as it possibly can. If you use Alt Enter, it's just going to queue it up to be the last thing to run after everything else finishes for your run. Now, I've talked a lot about how Pi is incredibly customizable and this is where we're kind of going to start getting into that customization, but we're going to start with something very simple, which is how do you create a prompt file? A prompt file is essentially a pre-canned prompt that you can just inject directly without having to manually type it out every single time. And you can write your own prompt files yourself. So, I could come in here, I could create a brand new folder, and this folder is going to be called .pi, and then inside that folder I could have a prompts and then inside of here, I could have a
Watch from 11:39file, we'll just call this test.md. And as long as I make sure I include some front matter at the top that has a description, and we'll just say this is a test, and then I just say whatever prompt I want inside of here. Now, what I can do is I can run this directly inside of Pi. Now, to run this, you would do {slash} and then whatever the name of your prompt is. But, you'll notice it doesn't show up when I type in test. That's because we need to reload Pi anytime we change anything it can reference. So, we'll just type in reload here. And now, if I type in {slash} test, you can see it gives me that description. When I run this, it essentially just replaces that with whatever is inside of that file. And I can actually tell Pi to create these for me if I wanted. I could say, "Create a prompt file in this directory for Git diffing staged changes. There we go. And it'll go through and it'll create that prompt file for me directly. And honestly, for most of the customizations that you're going to be doing to Pi, the best way to get it to work is to just tell it to actually make those changes for you. Now, it looks like it didn't quite put it in the correct folder, probably cuz I put told it to put it in this directory. But, if we put it up there and we reload Pi, and I actually make sure that the file is named properly because if we look over here, they put a dot in the front of the name. There we go. So, now let's go ahead and we'll just reload Pi. And we should hopefully see that Git prompt is right there. And now, if I do Git prompt stage, you can see it just copy and paste whatever is directly inside of there. Let's just abort that cuz we don't actually want it to run. But, you can see exactly how that would work.
Watch from 13:09Now, the next more advanced thing I want to talk about is how do we customize exactly how the Pi terminal looks cuz right now, we just kind of have this default look for everything. But, I want to create my own theme. If we go into theme, which is actually going to be in settings, and we just scroll down, we should eventually find theme. And we can change this between light and dark if we want it. And light is quite ugly, so we're going to leave it at dark. But, let's say I wanted to create my very own theme. I can just again ask the agent to do it cuz the nice thing is Pi knows how to modify itself really well. So, I can say, "Create a blue theme in this project for the Pi terminal agent harness." There we go. And it'll go through and it'll probably create some really ugly-looking blue theme. But, it'll at least try to create that theme for me. And as soon as I just re- refload everything after it's done, we can actually set up that theme. Okay, so just finished actually creating that theme. If we go ahead, we look, we have that prompts folder, and inside there we have a theme folder that hopefully is set up correctly to explain exactly all the theme-related code we need. And now I should be able to swap to that theme. Let's just do reload like we've done before. You can see I now have a theme called blue right here. So, if I go into my settings and we scroll to the bottom where theme is, I can select that blue theme, and now you can see that looks like my text has changed to blue, some of these other things have changed to blue inside of here. I mean, it's not a super amount of changes that have happened, but essentially just changed a lot of my text and colors to be blue instead. So, you can see quite how easy it is to do that. And obviously I could come in here and customize exactly what all these different colors are if I want to make it exactly mine. Now, the real power of Pi comes with how easy it is to extend because all of the extensions you write for Pi are just TypeScript files.
Watch from 14:31And again, Pi is really good at extending itself, and since it's just a simple TypeScript file, it's very easy for you to read, modify, and make work exactly like you want. One thing about Pi that is also very unique is that unlike many other harnesses, there are no safety guards at all in place. If I asked Pi to delete my system, and I clicked enter on this, it would actually go through and try to delete my system. There are zero safety nets in place for if you do dangerous commands. So, maybe you want to extend Pi to add that safety net in. So, I could ask it to create an extension for that. So, I can say, "Create a Pi extension in this project that will prevent dangerous commands from being run unless I explicitly allow them to run. Things such as RM are a good example." And we'll just let that run for a second. I'll come back to you as soon as that's done. Now, I just finished running through that, and you can see it created that extension for me. If we look over here in this extensions folder, we have a file called permission gate.ts. And if we look directly inside that file, you can see it's essentially gone through and created that extension, and it's just regular TypeScript code. You see we have some regular expressions here, we have some different types, some different functions, and all of this is hooking into Pie. For example, we have this like Pie on for listening to like tool calls and so on. And it even looks like this one a step further than I even asked it to by adding in certain features. If I scroll down here, such as allowing things to work and so on. So, I can say for example,
Watch from 16:02delete the index.html file in this folder. And we'll just see if it'll actually prevent it from happening and make me actually allow it or not. Because by default, this is 100% allowed by Pie. But now that we added this extension, it hopefully prevent it. And actually, I know it won't prevent it because I didn't reload. So, let's just do a quick reload here. And now I'll say delete at and I'll just do that index.html just like that. So, that just finished running and as we can actually see, it gave me my warning for the command being detected and I can essentially allow it or I can deny it if I want. Let's just say that I don't allow it and we can see that it's being blocked, which is exactly what I want. We'll just escape out of that. And now let's just try a new session and we'll ask it to delete that exact same file again. And this time I'm going to allow this and hopefully that file will be completely deleted. And if I look, you can see inside of here, there is no more index.html file. So, it did work just like I expected. Now, that's how you can customize Pie yourself. But often times there may be major features you want to install that are already created by other people. And that's where the package catalog comes from. So, if you go to Pie site, you can click packages up here. That's going to give you a pack catalog of essentially all the extension skills, themes, and so on other people have uploaded. Now, obviously be careful when you download these things because essentially it's giving code that you can run on your computer. So, just like any other code, make sure it's safe that you're downloading it. But this essentially gives you all the different packages you could possibly want. And they're either going to be labeled as a package, which essentially combines together maybe skills, prompts, templates, themes, and so on or in extensions, or it'll be labeled just like as an extension or as a skill or as a theme. And this is where you can go through and if you want to download
Watch from 17:32these, it's super easy. take this command Pie install whatever and that's going to install that functionality directly into your application for Pie. So, this is a great way, let's say you wanted to have to do support, you could just use this extension right here. Or let's say that you wanted to have some other support for like web access or MCP servers, all of that has been built by someone else, so you can use their work to go off of. Or if you want to be able to create it yourself, you can create it yourself. Because since Pi is so minimal, they don't have MCP or sub-agents, and you want to have those, it's as easy as just copying this command and downloading that directly. Now, that covers everything you need to know to get started with Pi, but I can't cover everything in this video for every keyboard shortcut and every command you could possibly run. So, I highly recommend downloading this cheat sheet. Again, it gives you every single thing you could possibly ever need to know about Pi. So, it's going to be available light mode, dark mode, Linux, Mac, it doesn't matter what operating system you use or what your color preferences are. It's completely free, link down in the description for you. Highly recommend you check that out. That said, thank you very much for watching and have a good day.
Watch from 19:03Full transcript
- 0:00
Pi is an absolutely incredible agent harness and it's very similar to something like Claude code or open code, but the big difference is that Pi is incredibly minimal and it's super customizable. And this means that you can essentially do whatever you want with Pi to make it work exactly like you want. In this video, I'm going to be covering everything that you could possibly need to know about Pi from getting started with it all the way up
- 0:21
to how to customize it to your exact needs. And if you want to dive even deeper, I have a full cheat sheet that covers all of the different keyboard shortcuts as well as the different prompting and command related things you can do inside of Pi. It's available in both light and dark mode and I have a version for Mac, Linux, and Windows. If you want to check that out, it's completely free and it'll be linked down in the description below.
- 0:43
Welcome back to Web Dev Simplified. My name is Kyle and my job is to simplify the web for you. The very first thing we need to do is just install Pi on our system. I'd recommend just running the NPM command. Essentially, copy this command, run this in your clipboard, and that's going to download that Pi agent for you. Once you've done that, inside of your terminal, you can just type Pi or Pi, hit enter, and that's going to open up Pi for you. Yours may not have
- 1:04
quite as much information. For example, this skills section for you may be completely blank depending on if you've downloaded skills before, but essentially, this is what Pi looks like. You can see here that we have a section where we can type in information and then we also have different slash commands that we can use to change different things inside of here. And if you're connected up with a model, for example, I could just ask it to say hi and it's going to respond to me with
- 1:24
whatever it wants based on whatever I type in as my prompt. So, this is a way for me to prompt my AI and have it respond to me directly. Now, obviously, when you first get this set up, you're not going to have any models or anything set up. So, when you try to type something, you're going to get some type of error saying that you need to configure your models. Now, if you have a subscription to a service, the easiest way to do this is just to type in {slash} login. This is going to allow you to either use an API key if you're
- 1:45
using API key pricing or you can just use a different subscription. For example, you can set up any of these subscriptions here. I can just click on GitHub Copilot and now it's going to let me essentially sign in with GitHub Copilot. So, here I can just click enter and then all I would need to do is follow essentially all of these different prompts, so I can click on this to open it up. I can say that that is me, so I'll continue signing in, and then I just need to make sure I get that
- 2:05
device code. So, I'm going to just copy that code right here. And we'll just paste that code directly into here, click continue, and now essentially that's authorizing my GitHub to be able to be used with this. And now with that done, we can actually go back into here, and we are logged in specifically with GitHub Copilot. Now, once you do that, we need to be able to determine what model we want to use. So, I can type in {slash} model, and that is
- 2:26
going to allow me to select all the different models I have available. Now, I have a few local models set up. You can see these LM Studio ones, for example, Qwen 3.6. And if you want to learn how you can set up a full local AI setup, I'm going to link that in the cards and description for you. But as you can see here, I also have all my different GitHub Copilot models. And if I were to choose one of these models, we can test to see if that's working by just saying say hi, and hopefully it's
- 2:46
able to respond to me relatively quickly. There you go, you can see that that is working like we expect. Now, I'm going to be using the local version of the model that I have, which is that Qwen model, so we'll just search for that. Make sure I have the correct one loaded, there we go. And now if I just do say hi again, it's going to use that local model instead of the model that's being paid for. So, now we essentially have the basic setup for our Pi terminal. We can hook up model, we can
- 3:08
run different commands with that model, but what exactly makes Pi different than something like Claude Code or Open Code? The big thing that makes it different is how minimal Pi is. Lots of these other harnesses come with tons and tons of different tools baked in, but Pi is super minimal. Essentially, the only thing that it has for tools is the ability to read files, edit files, and do bash commands. This means there's no
- 3:29
built-in for things like GitHub integrations or stuff like that, which for most people is perfectly fine, cuz you can either do that through a bash command, or you can just set up the terminal to be used that properly for you. So, you can customize Pi to have those different tools. It starts you out with essentially the bare minimum, because that's enough to actually get started. And it also doesn't have any like MCP support, there's no sub agents,
- 3:49
there's no plan mode, there's no to-do list, there's none of that additional stuff that you may be used to. Now, the nice thing is there's additional extensions and packages you can use and download and install to get those features if you want, but you start with a super clean slate and you can add on whatever you want and customize it however you want. Now, let's go ahead and actually test out some of the different things we can do inside of Pi now that we have this set up. For
- 4:09
example, let's say that I want to start a brand new session cuz I have a bunch of information in this session that doesn't really make sense for what I want to do. I can just type in {slash} new and that allows me to start a brand new completely blank session and from here I can do whatever I want. For example, if I wanted to reference a file that exists inside my project, I can use the @ symbol and that's going to give me nice auto complete. We can look, I have four different files inside this project
- 4:30
and they are showing up right here. And if I were to start typing, you can see it'll auto complete that for me which is super nice. And I can just say like, "Tell me what is in this file?" And it's going to go through and it's going to use that read tool that it has, it's going to read through that entire thing and then it's going to tell me all the different information about what the specific file is. Also, something that you may want to do is run terminal commands directly. For example, I'm
- 4:51
inside here and anything I type goes as a prompt directly to the model, but instead I may want to run a command. To do that, you can put an exclamation point in front of whatever text you type and now this is going to run an actual command. So, I can type in LS and you can see it ran that LS command. But, by putting only one exclamation point before my command, it actually sends this to the model. So, I can say, "What does that say?" and it's going to tell
- 5:12
me essentially what this LS command is. And you can see here, it's essentially just regurgitating that information cuz that's what I asked it to do. You don't always want to send your commands to the model though. So, if you use two exclamation points before whatever your command is, we'll just do LS again, this does not actually get sent to your model. So, the model has no way of seeing this information. So, one exclamation point sends that data to the model, two exclamation points just keeps
- 5:32
it personal to you and doesn't send it to anyone else. Now, one other thing that we can do is we can really easily change what the thinking mode is for our model as well as swap between models with different keyboard shortcuts. For example, hitting control P is going to shift me to the next model in my preferred list. So, when I hit control P, you can see it's swapping me through all the different models. and And if I do control shift P, that's just going to move me backwards, so I can go back to
- 5:53
the model that I was originally on. Also, you can change what the thinking mode of your model is as well. That's just going to be done with shift tab. So, right now we're in medium thinking mode, which is in the bottom right-hand corner here. If I click shift tab, you can see I can shift to high, off, minimal, and so on. And it's also telling me right here what thinking mode I'm using for this model. Now, one annoying thing is by default that shift P is going to go through every single
- 6:13
model that you have downloaded. So, what you can do is we can type {slash} scoped models just like that. And here we can select the specific models we want to shift through with that control P. So, what I can do, let's just say I want to do like Sonnet 4.6. So, we'll check on that one. And then let's come in and we'll find my Quinn model as well. So, we'll just search for that. There we go. So, now we only have two different models that we
- 6:35
can search for. So, now when I do control P, it's just going to toggle me between those two models back and forth, cuz those are the only two models that I have supported. Now, the next big thing that's built into Pi is essentially the entirety of session management. And a session is just the entire conversation you're having with the LLM. And a session is essentially just the conversation that you're having with the model. And in order to see all the details for your current session, you
- 6:56
can just type in session just like this. And this is going to give you all the information for whatever your current session is, where everything is being stored, all the different messages, tokens, the cost, and so on. Like if you're using a paid model, that cost information will be here as well. So, it'll give you all the information you could want. And the nice thing about Pi is it allows you to actually swap between sessions and do various things with your sessions incredibly easily. For example, I can type in {slash}
- 7:17
resume, and this allows me to jump to essentially any of the different sessions that I've done inside of this section. You can see I had this Sudoku application I was creating when I was testing out some local model capabilities. And you can see some other stuff that I had inside of here for testing. And the one that we did in this video was that say hi one. You can see I can jump directly back into that session, and I can start typing directly into that session if I wanted. Another
- 7:37
really nice thing is you can actually go into a tree view of your session, and that allows you to essentially restart your session at various different points. So, for example, if I do {slash} tree, this is going to show me all the different messages that were being sent inside this session. And this is going to include both my messages as well as the agent's message. And if I wanted to go back to a different point in time, I could just select that point in time. Let's say I want to go to this second
- 7:58
say hi message. I could choose that, and I could just say that I don't really care about summarizing it. And now you can see I've gone back exactly where that message is. And now let's say I want to change this to say bye. So, it's going to say bye to me now. And if I go back into my tree, we can actually see that I have a branching point in the history. You can see here is that session say bye. That's the one I just created. And then here say hi is the original one, and you can
- 8:18
see all the stuff that was being generated by that. So, now I have a branching history that I can navigate between if I really wanted. And this is a great way to be able to, you know, let's say you prompt something and the AI doesn't quite do it like you expect, you can go back in your history and be like, "Oh, you know what? I'm going to prompt that in a different way." And if the second time you do it, it's still not quite right, you can go back to that first way and say, "You know what? We're going to stick with this very first way
- 8:39
right here." Now, some other handy things that you can do. First of all, control C will just close out whatever your current prompt is, so no matter what you have typed inside of here, control C clears it, which is really handy. And another thing that's really handy is the ability to essentially duplicate the actual session you're on. I can type in {dash} {slash} clone just like that, and that's going to create a brand new duplicate of my current session. So, when I was doing that tree stuff, I was all kind of in one session
- 9:00
that was being forked and treed around, but with clone, I create a brand new session that is just a duplicate of the session that I was currently inside of. And we can actually see that. If I go into that tree command, you can see all that branching and stuff is no longer there, cuz I just created a clone of essentially that one single branched path that I was down. Now, another thing you can do is the {slash} fork command, and that works very similar to tree, but essentially it allows me to go back to
- 9:20
any point in history and say I want to create a brand new session from that point in history. So, clone uses the current point in history, fork just says, "You know what? I'm going to go back to this point in history and create a brand new session at this exact point." So, now if I were to just do a tree for this, we can see that there's currently nothing in the tree, cuz I forked from the very first message. So essentially I created a brand new session that's completely empty. Lastly, the other
- 9:42
command that you want to worry about when it comes to sessions is compact and that's just going to take your session and it's going to compact it down to reduce the amount of context space being used. Often times you don't really need to worry about manually doing this, but it is there if you want to be able to compact that context to make sure that you have a smaller context overall. Now speaking of context, one really nice thing about pie is if you have a file called agent.md, so we can just come in
- 10:03
here agents .md Anything that's inside of this file right here is going to be automatically loaded up by your pie agent as soon as you start it and this is like your general context file that gets loaded all the time and usually these are like project specific, but you can create a general one as well that you can store inside of your home directory for pie if you wanted one for every pie instance,
- 10:24
but you can do them project specific. You can also overwrite the system prompt by just creating a system.md, that's going to overwrite the system prompt, but the really nice thing about pie is the built-in system prompt for pie is super super minimal, so you probably don't even have to mess with it at all. Now the next thing I want to talk about in pie is going to be how you can manage skills in pie. The really nice thing is if you have a skill installed either
- 10:45
inside of your current directory or a skill installed globally, pie will automatically pick those up. And if you're not sure what skills are how to work with them, I have a full crash course covering everything you need to know from downloading all the way to writing your own skills. It'll be linked in the cards and description for you. But to use a skill, all you do is type {slash} skill {colon} and then whatever the name of that skill is. So if I wanted to use a specific skill, I could
- 11:06
just come in here and use that exact skill. So let's just for example do this random grill with docs. I could just use that specific skill just like that and it's going to work like I would want. Now I didn't give it any information after the skill, but I could give it additional information afterwards if I wanted. Now in our case, I don't actually want this to do anything. So to stop this, I can just click escape and it's not actually running right now, but if I just type something and I click
- 11:27
escape, that's just going to abort whatever the AI is currently doing. So I can start over typing something else if I wanted. Another really nice thing is let's say I tell the AI to read three files from this folder. It's going to go through and it's going to try to read those different files. Now, the nice thing is if I want to interrupt this, for example, I notice it's doing something kind of weird, I can just say, for example, stop. And as
- 11:47
soon as it's done with whatever tool calls it is doing, you can see that it's now going to take in my command and it's going to do whatever I tell it to do. So, this is a way for me to essentially queue up a command to run in the middle of a prompt that is currently happening, which is really nice. Another thing that you may want to do, we'll just say read three files again, and I can say, "You know what? I want a command, but I want to do it after it's done reading those files." So, I can say summarize
- 12:09
then and looks like it already finished, so we'll just tell it to read three more again. Let's just close out of this. Tell it to read three files and then we'll say summarize. And now I can hit Alt Enter and what that's going to do is it's going to wait for everything to finish and then it's going to run that command after everything is finished. So, it essentially allows me to queue something up directly after a current command finishes. As you can see, it just finished everything and now it's
- 12:29
running that command. So, if you just use Enter to type in a command normally, it's just going to interrupt whatever is happening pretty much as soon as it possibly can. If you use Alt Enter, it's just going to queue it up to be the last thing to run after everything else finishes for your run. Now, I've talked a lot about how Pi is incredibly customizable and this is where we're kind of going to start getting into that customization, but we're going to start with something very simple, which is how do you create a prompt file? A prompt
- 12:51
file is essentially a pre-canned prompt that you can just inject directly without having to manually type it out every single time. And you can write your own prompt files yourself. So, I could come in here, I could create a brand new folder, and this folder is going to be called .pi, and then inside that folder I could have a prompts and then inside of here, I could have a file, we'll just call this test.md. And
- 13:11
as long as I make sure I include some front matter at the top that has a description, and we'll just say this is a test, and then I just say whatever prompt I want inside of here. Now, what I can do is I can run this directly inside of Pi. Now, to run this, you would do {slash} and then whatever the name of your prompt is. But, you'll notice it doesn't show up when I type in test. That's because we need to reload
- 13:31
Pi anytime we change anything it can reference. So, we'll just type in reload here. And now, if I type in {slash} test, you can see it gives me that description. When I run this, it essentially just replaces that with whatever is inside of that file. And I can actually tell Pi to create these for me if I wanted. I could say, "Create a prompt file in this directory for Git diffing staged changes. There we
- 13:55
go. And it'll go through and it'll create that prompt file for me directly. And honestly, for most of the customizations that you're going to be doing to Pi, the best way to get it to work is to just tell it to actually make those changes for you. Now, it looks like it didn't quite put it in the correct folder, probably cuz I put told it to put it in this directory. But, if we put it up there and we reload Pi, and I actually make sure that the file is named properly because if we look
- 14:17
over here, they put a dot in the front of the name. There we go. So, now let's go ahead and we'll just reload Pi. And we should hopefully see that Git prompt is right there. And now, if I do Git prompt stage, you can see it just copy and paste whatever is directly inside of there. Let's just abort that cuz we don't actually want it to run. But, you can see exactly how that would work. Now, the next more advanced thing I want to talk about is how do we customize exactly how the Pi terminal looks cuz right now, we just kind of have this
- 14:37
default look for everything. But, I want to create my own theme. If we go into theme, which is actually going to be in settings, and we just scroll down, we should eventually find theme. And we can change this between light and dark if we want it. And light is quite ugly, so we're going to leave it at dark. But, let's say I wanted to create my very own theme. I can just again ask the agent to do it cuz the nice thing is Pi knows how to modify itself really well. So, I can
- 14:58
say, "Create a blue theme in this project for the Pi terminal agent harness." There we go. And it'll go through and it'll probably create some really ugly-looking blue theme. But, it'll at least try to create that theme for me. And as soon as I just re- refload everything after it's done, we can actually set up that theme. Okay, so
- 15:19
just finished actually creating that theme. If we go ahead, we look, we have that prompts folder, and inside there we have a theme folder that hopefully is set up correctly to explain exactly all the theme-related code we need. And now I should be able to swap to that theme. Let's just do reload like we've done before. You can see I now have a theme called blue right here. So, if I go into my settings and we scroll to the bottom where theme is, I can select that blue theme, and now you can see that looks
- 15:40
like my text has changed to blue, some of these other things have changed to blue inside of here. I mean, it's not a super amount of changes that have happened, but essentially just changed a lot of my text and colors to be blue instead. So, you can see quite how easy it is to do that. And obviously I could come in here and customize exactly what all these different colors are if I want to make it exactly mine. Now, the real power of Pi comes with how easy it is to extend because all of the extensions you
- 16:00
write for Pi are just TypeScript files. And again, Pi is really good at extending itself, and since it's just a simple TypeScript file, it's very easy for you to read, modify, and make work exactly like you want. One thing about Pi that is also very unique is that unlike many other harnesses, there are no safety guards at all in place. If I asked Pi to delete my system,
- 16:21
and I clicked enter on this, it would actually go through and try to delete my system. There are zero safety nets in place for if you do dangerous commands. So, maybe you want to extend Pi to add that safety net in. So, I could ask it to create an extension for that. So, I can say, "Create a Pi extension in this project that will prevent
- 16:41
dangerous commands from being run unless I explicitly allow them to run. Things such as RM are a good example." And we'll just let that run for a second. I'll come back to you as soon as that's done. Now, I just finished running through that, and you can see it created
- 17:02
that extension for me. If we look over here in this extensions folder, we have a file called permission gate.ts. And if we look directly inside that file, you can see it's essentially gone through and created that extension, and it's just regular TypeScript code. You see we have some regular expressions here, we have some different types, some different functions, and all of this is hooking into Pie. For example, we have this like Pie on for listening to like tool calls and so on. And it even looks
- 17:23
like this one a step further than I even asked it to by adding in certain features. If I scroll down here, such as allowing things to work and so on. So, I can say for example, delete the index.html file in this folder. And we'll just see if it'll actually prevent it from happening and make me actually allow it or not. Because by default, this is 100% allowed by Pie.
- 17:44
But now that we added this extension, it hopefully prevent it. And actually, I know it won't prevent it because I didn't reload. So, let's just do a quick reload here. And now I'll say delete at and I'll just do that index.html just like that. So, that just finished running and as we can actually see, it gave me my warning for the command being detected and I can essentially allow it or I can deny it if I want. Let's just say that I don't allow it and we can see that it's being blocked, which is
- 18:05
exactly what I want. We'll just escape out of that. And now let's just try a new session and we'll ask it to delete that exact same file again. And this time I'm going to allow this and hopefully that file will be completely deleted. And if I look, you can see inside of here, there is no more index.html file. So, it did work just like I expected. Now, that's how you can customize Pie yourself. But often times there may be major features you want to
- 18:26
install that are already created by other people. And that's where the package catalog comes from. So, if you go to Pie site, you can click packages up here. That's going to give you a pack catalog of essentially all the extension skills, themes, and so on other people have uploaded. Now, obviously be careful when you download these things because essentially it's giving code that you can run on your computer. So, just like any other code, make sure it's safe that you're downloading it. But this
- 18:47
essentially gives you all the different packages you could possibly want. And they're either going to be labeled as a package, which essentially combines together maybe skills, prompts, templates, themes, and so on or in extensions, or it'll be labeled just like as an extension or as a skill or as a theme. And this is where you can go through and if you want to download these, it's super easy. take this command Pie install whatever and that's going to install that functionality
- 19:08
directly into your application for Pie. So, this is a great way, let's say you wanted to have to do support, you could just use this extension right here. Or let's say that you wanted to have some other support for like web access or MCP servers, all of that has been built by someone else, so you can use their work to go off of. Or if you want to be able to create it yourself, you can create it yourself. Because since Pi is so minimal, they don't have MCP or sub-agents, and you want to have those,
- 19:29
it's as easy as just copying this command and downloading that directly. Now, that covers everything you need to know to get started with Pi, but I can't cover everything in this video for every keyboard shortcut and every command you could possibly run. So, I highly recommend downloading this cheat sheet. Again, it gives you every single thing you could possibly ever need to know about Pi. So, it's going to be available light mode, dark mode, Linux, Mac, it doesn't matter what operating system you
- 19:50
use or what your color preferences are. It's completely free, link down in the description for you. Highly recommend you check that out. That said, thank you very much for watching and have a good day.
Description
SponsorFREE Pi Cheat Sheet: https://webdevsimplified.com/pi-cheat...
Pi is my favorite agent harness (especially when working with local models) and in this video I will show you everything you need to know about the Pi agent harness.
📚 Materials/References:
SponsorFREE Pi Cheat Sheet: https://webdevsimplified.com/pi-cheat...
Local AI Video: • The Best Local Agentic Coding Workflow (Co...
Skills Video: • How To Use AI Skills Like A Senior Developer
🌎 Find Me Here:
My Blog: https://blog.webdevsimplified.com
My Courses: https://courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: https://github.com/WebDevSimplified
CodePen: https://codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Introduction
00:47 - Pi Install
01:38 - Configure Models
03:13 - Pi vs Other Agents
04:08 - Basic Commands
10:38 - Advanced Prompting Features
12:41 - Customizing Pi
#PiHarness #WDS #Pi
More from Web Dev Simplified
×2244:57The Best Local Agentic Coding Workflow (Complete Guide)
Web Dev Simplified1.1M views
×9.72:10Please… I Need Your Help
Web Dev Simplified459K views
×6.91:15:25The Ultimate MCP Crash Course - Build From Scratch
Web Dev Simplified327K views
×4.925:15I Will Never Use Prettier or ESLint Again
Web Dev Simplified231K views
