What Is OpenCode? ![rw-book-cover](https://img.youtube.com/vi/qbJhroATnj4/maxresdefault.jpg) What is open code? Well, open code is the AI coding agent that is open. It is flexible. It is not tied to any one provider. You can bring your own AI provider. You can use your own API keys. You can use pretty much anything in this thing. And you can customize it to your heart's content via custom tools, custom agents, and all that stuff. I've been using Open Code quite a bit for a long time now and really love several core aspects of it. So, I'm going to tell you a little bit about what the heck this thing is and why you should give it a try. It is free to use. So, uh there is a paid thing which we'll talk about that as well. But, uh to use this, you just run a curl command or you can do bun whatever and this will install this as an application you can run as both a CLI or inside of a terminal UI. And the way this works, again, it has a really nice native terminal UI. Uh, multiple sessions, so you can have multiple agents running in parallel. All you got to do is just open up a new, uh, terminal tab, open code, and get going. You can, uh, save and come back to various sessions. You can implement commands and run those commands that then trigger agents and do all that good stuff. So, I'll show you a little bit of this stuff in action, but it's a really great tool. And the one thing I really like about it is if you're paying for something like Copilot already, uh you can log into Copilot and get access to all of the Copilot models directly in open code or bring your own API keys from any of the various providers or they also often have a free uh model available for testing at any given point. Like for instance, if we head into open code and I I do models right now, you can see that right now there are a a few free ones. Now, these might not be the best models, but if you're just wanting to give this thing a try, uh I do have a Copilot subscription. So, for me, from Copilot, I have access to all of these different models that I can use myself or again, like I said, you can uh bring in your API keys for various other things. Now the open code interface and the way that it works like if I'm in a site here and I say let's update to uh spelt 5 syntax everywhere. Now now this type of command is obviously only going to be as effective as the model the tools that you're giving it especially with spelt 5 stuff. Uh but you can see there's a lot of nice things. There's a lot of built-in tools to this where we have things like uh to-dos. Now, I've always found to-dos outside of something like Curo to be kind of useless. I mean, I'm sure it's not useless for the AI to be able to go through and do these things itemized, but like I like a to-do list that's a little bit more interactive where I'm able to uh tell it exactly which to-do and which variety. I think Hero really nailed that, even if their their spec flow is a little heavy-handed sometimes. But as you can see, it is going through some of this stuff and it is going to be updating it. Now, it it does actually seem like with Sonnet 4.5, it's doing a decent job of actually pulling out spelt 5 syntax. You know, one thing it's not doing here is it's not prompting me to uh accept or do this or that. But this is just with the normal build agent. Now, in addition to a build agent, there's also a plan agent built in or you can customize your own and just hit tab to change the various agents that you have available. And likewise, when you run custom commands, you just hit forward slash and your custom commands are available as well as the commands that are baked into open code itself. So, let's take a look at the docs really quick. Again, you can uh get going with most providers here. I mean, the directory is huge. It all is easy to set up. Um, again, the terminal UI is nice. As you just saw, there's a number of extra built-in tools here like details, editor, exit, export, help, uh, initialize to create agents.md, which this does use an agents.md for their rules. So things are nice and standardized and normal as you might expect them to be. Uh you can always start a new session with new. The CLI is actually really nice for one-off things. You can use the CLI just by running open code run. And what's cool about this is that means you can actually use this in things like GitHub actions if that's the type of thing you'd want to do, right? Like maybe analyze my recent pull request and generate a change set. Um there's a number of things you can do here with the CLI that are super nice. Now you can also use it inside of things like VS Code or cursor um just by running open code in the terminal. It's a terminal UI, right? You don't have to have something special for that. Now there's also the Zen mode. Now, Zen is a paid solution and Zen is basically you pay open code and then you get access to the models that are within Zed that are within Zen and you can see what these models are. You can see their pricing. Um, it's interesting. I personally, since I do have a co-pilot subscription, I haven't looked into using Zen. But for people who only want to pay for one thing, one place, and you're like all bought in on Open Code, it's a nice system for them to have to just be able to have it be like no stress, sign up, just use the thing. Now, as far as configuring this thing, you can add your own tools, whether they are MCP servers or fully custom tools that are just TypeScript code. um it's really nice and you you're basically just defining things within a open code JSON. Now the one thing I really love about open code is that sometimes these other uh CLI sometimes these other terminal UI things or AI systems in general they have like one very specific um provider specific way of doing things where with open code you can configure a lot of things and you can have uh config files that exist globally down to your root project that have different configurations. So you can have your default configurations, you can have your local project configurations, which is really great for setting things up once globally and then dialing in locally where you need to. Now also as far as rules go there is the agents.md file but just like most things in open code you can actually customize this as well. There's a global agents.mmd file in config open code agents. However, we'll look for the local one then look for the global one which is really nice to have. You can also specify custom instructions via um an array here of various instruction files and then you can even glob every single thing inside of a directory. Now, obviously this is something you need to be careful with because if you add too many instruction files, like if you glob a whole bunch of MD files in on every single every single command, your context is going to bloat up really big and you're going to get terrible results out of the LLM. But it's really great that it gives you the option of setting up your own systems. And as somebody who likes to do that, I I would not setting up my own systems to the point where it was probably detrimental to me. Um, you can also have custom agents and sub agents. Sub agents are specialized agents that primary agents can invoke with specific tasks. So therefore, you can have your main agent that that is like an orchestration that goes off and uses sub agents to do various things. And likewise, I already showed you the two built-in primary agents. There's the plan mode and build mode, but again, you can specify all of your own like a spelt pro that um always wants to use the spelt MCP or has specific instructions for your specific uh way of working. And these things are great because you can give the agents uh individual permissions like you can only write, you can only read, you can run bash commands or this or that. Um it's great. You can have access to this. You can use this specific model even if you want. You can control the temperature. You can dial it in. Open code is really a tinkerer's dream in many regards because if you nerd out on some of this stuff, you can get in depth with it. Ultimately though, sometimes that can lead to just uh tweaking knobs on a sinking ship, right? So, it is it is like uh it's great that they give you those options though. As far as models go, Open Code uses the AI SDK and models.dev. support for 75 plus uh LLM providers basically giving you access to most of the stuff most of the time and they're really quick on getting all of the new stuff into Open Code so you never are wondering what's going to like am I going to have access to the latest Gemini or whatever. There's themes which are great because man I love I love adding themes, right? You can just change your theme. Look at that. You can even get a nice little preview. Uh, for somebody like me, I just like I like having that. I like having that. As dumb as it is, it it does nothing other than just makes me happy working uh with themes. So, that's great. Uh, key bindings, you can specify your own custom key bindings if you would like. That's great. Uh, again, Open Code is very customizable, and I love that commands are super useful. There's a number of built-in commands, but you can specify your own. Like let's say you want to have a command that just runs your your linting and then fixes things. You could just forward slash lint and fix and then uh that command is basically an MD file where you can specify some custom context for anything and it's going to be basically the instructions that the command should do. Now again these commands are not like JavaScript code. These are markdown but you can use arguments which I actually really like. I found this to be troublesome in many other applications. But if you want arguments, you can use dollar sign the number for the number of the argument, which makes command super useful in a way where you can actually target things. When when we're working with LLM, so much of this stuff is nondeterministic that like, oh, it's really nice to be able to pass some arguments and make sure it knows what it's doing. Uh, again, I really end up uh really liking this. The docs are great for this, too. By the way, there's also built-in formatterers so that uh your code can get formatted after changes. I yeah, I I haven't really uh used this too much because I'm I'm mostly like really in my code already. So, the formatting is getting applied while I'm I'm not usually just like letting the LLM go to town on my code. Um permissions. You can give detailed permissions to all kinds of things from web fetch. Oh, doom loop is a uh new one. approve whether or not a doom loop occurs where the same tool is called three times in a row. I haven't actually seen this when it was added. But that's really neat that it's there. You can also have ask permissions for anytime a file is changed or edited or anything. So the permissions can be ask, allow, or deny. And I actually probably recommend always leaving it on ask for everything because I kind I I I kind of just like need to know what it's doing, right? I needed to ask me if it should do it. Uh there's also support for LSP servers, MCP obviously and ACP. Uh MCP probably being the one that you use the most, but uh getting your MCP servers configured is just a matter of a very simple JSON configuration. It does not support OOTH for MCP, but it says that it will soon. So, that would be nice when that's here. One thing I actually didn't mention about agents and sub agents that I really like, as opposed to something like Claude Code where you're just like, "Hey, please use this agent and hope it does." You can actually explicitly at an agent and like if I have this quality reviewer agent, I can specifically at it and it's going to uh always invoke that agent without having to guess. That is something that I feel like uh cloud code is certainly lacking is some of these explicit commands, explicit arguments, these types of things where uh even though they do work most of the time, you still feel like you're guessing a little bit. I like the deterministic nature of an at or an argument. And again, there's support for custom tools which can be just straight up JavaScript that is running and therefore you don't have to have it be done by an LLM and tools can be used to accomplish things all kinds of things return data in a deterministic way. Now what's cool about um open code also is that there are plugins and there is plug-in support. In fact, like recently people were talking about, you know, Claude skills and and here's a plugin that someone created that matches claude code skills. So you can even sync skills and use claude code skills directly in open code. So having the ability to install things to augment and work with uh this system to me is one of the key features of open code. So, I recommend if you're using this stuff, if you like clawed code, if you like any of these uh copilot CLI tools or any of this stuff, I would highly recommend checking out Open Code because I do really like it and because besides being well thought of, I think it is very developer friendly. It uh allows you to actually be in control a little bit more and it feels way less loose uh than some of the things I've experienced in some others. And the configuration options are pretty much endless and uh really great. So check it out. Open.ai. If you hate this stuff, that's cool. If you love this stuff, give Open Code a try. All that. Either way, it's a fun project. Something to be aware of. This is Scott. I'll see you in the next one., What Is OpenCode?, YouTube, 01kc4djftxq7he32rnj2b17s8b.