OpenCode is so much better than the rest...
Key Takeaways
This video explores and demonstrates the features and usage of OpenCode, an open-source community-driven terminal agent with a text-based user interface
Full Transcript
What is going on, guys? Welcome back. In this quick video, today we're going to explore Open Code, which is an agentic terminal environment or an AI agent in the terminal, similar to Claude Code, similar to Codex, but open source and community-driven. It has a lot of interesting features, and I think, personally, it has the best terminal user interface. So, we're going to explore how to use it and some of its features in this video today, and we do this primarily because I'm personally rooting for it to become the state of the art terminal agent tool. I like it more than Claude Code and more than Codex, not necessarily because it's superior, but just because I like the style and I like the fact that it's open source and community-driven. If you like this video, let me know by hitting a like button and subscribing, but now let us get right into it. >> [music] >> All right, so this is going to be quite a simple, casual, and straightforward video. We're going to explore Open Code just by using it. I want to show you how to use it, what it can do, what the terminal user interface looks like, and primarily maybe to get you to use it, to try to use it, because actually you can replace at least Codex with it, because you can actually even use the ChatGPT subscription in Open Code. So, let us get started. I'm going to move here to my tutorial directory. Let's go full screen here, zoom in a little bit. And now I'm going to just start a session with Open Code. Now, I'm not going to cover the installation. It depends on your operating system. Um you will have different package names or different package uh managers, at least, that you have to use to install it. Just get Open Code onto your system. I think I'm using the AUR version, so I'm using yay to install it. And once you have Open Code on your system, you can just start Open Code. And then it opens up a terminal user interface, in my opinion, looks superior to all the other uh terminal agents that we have. And what we can do here now, first of all, is we can press control and P. This is going to show us the commands that we have available here. Now, you don't have to use these commands uh by using control P, and you also don't have to use the shortcuts. You can also use commands like {slash} models, for example. This is going to allow you to switch the model. Now, you can use a bunch of different models. I think they also provide you here some Open Code models for free. You don't even have to do anything in order to use them, uh as far as I know. So, you just use Open Code uh Zen. I mean, you have here MiniMax M2.5 free. Um or you can connect to OpenAI. The reason I can use OpenAI models here is because I connected the provider. So, in my case, I did control A here, and I chose the provider. And as you can see, you can choose from a lot of different providers here. The only thing is, you cannot use Anthropic subscription, so you cannot use Claude Code or the Claude Code subscription in Open Code. You can use the API, the Anthropic API, but you cannot use the subscription, but you can use the OpenAI subscription, at least as of right now. So, I'm not sure if I can do this. Yeah, I can actually do this here. You can see OpenAI ChatGPT Plus Pro or API key. Both is possible. For Anthropic, it only says uh Claude Max. Okay, for Max, it seems like it works, or the API key. And of course, you can also do other stuff like Ollama Cloud, or you can also do Ollama locally. I'm going to show you how to do that later on. But essentially, this is just your basic agent. So, I can do something simple like create a um simple Flask application with a simple HTML, CSS, JS front end. It should manage to-dos. And now you can see what this looks like. We get this animation here for loading. We get on the side here uh the context, so how many tokens are in the context, how much of the context has been used, how much uh money we spent on this, and then also the to-dos here are listed, so you can track the tasks, and you can also see what's happening all the time. Now, if I want to, I can interrupt this by pressing escape twice, but I'm not going to do that right now. You can see it automatically does the changes, so it doesn't ask me for uh confirmation. However, we can change that if we want to. So, right now it just creates the files, runs the commands, it doesn't ask me if I'm okay with that. It just does that. I personally don't like that, so what I'm going to do is I'm going to tell it to actually ask me before doing anything. But I'm going to let it finish the task right now, so we have a basic version first. Now, you can see it uses the requirements.txt file. I don't like that, so I'm going to interrupt here with double escape, and I'm going to say, "Please use UV init, UV add, etc." And as you can see, it also runs these commands without asking for permission, which is quite dangerous, if we're honest, but we can easily uh we can easily change that. All right, so it's done now. Let's go and try to run it. For this, I can do control C to exit Open Code. You can also see I can continue the session by saying Open Code {dash} S, and then the session identifier, or I can say Open Code uh {dash} C to continue the previous session. So, the last session. This is going to do the same thing as providing the session ID, but if I have multiple sessions, it makes sense to provide the identifier. Now, let's go and say UV run. What is the file name? app.py. Open this in the browser, and here we see now a to-do manager. Let's try something like test, add something else here, and then I can check them off. I can delete them. Perfect. Now, let's see if this is already persisted onto disk. No, when I start this again, it doesn't have the to-dos persisted on disk. Fine. So, the first thing I want to do now is I want to make it ask for permissions, no matter what I do. So, if it runs a command, or if it wants to run a command, if it wants to create a file or change something in a file, I want to approve this manually. This is just how I like to do agentic coding, because I'm not a fan of fully vibe coding, like telling it to do something and then believing it succeeded. I like to see what it's doing. I don't necessarily have to write the code myself all the time, but I want to see uh what is happening, and I want to approve the individual steps. Um so, what I'm going to do here now, in this base directory, in this project, I'm going to create a file called open code.json. And this is going to contain my config. So, I'm going to use curly brackets here, and I'm going to start by specifying uh schema. So, dollar schema. And this schema is going to point to a URL, and this URL is https, uh and then open code.ai/config.json. So, this is like a template or a base version of the config, and now we're going to extend it with our own settings. And for this, I'm going to say here permission. This is the thing I want to change, and I want to have two different permissions. One is going to be the edit permission. So, when editing something, I want to be asked for permission. So, edit is going to be ask. Now, in addition to that, I also want to be asked when it runs bash commands. So, I'm going to say bash, and here now I want to have a dictionary, because I want to white-list a certain command. So, let's say for all the different commands, so for an asterisk here, I want to be asked for approval. However, if I tell it, or if it needs to run LS for some reason, I don't need to be asked. So, I'm just going to allow this by typing allow. So, this right here says, "If you want to make any change, ask for approval. If you want to run any command, ask for approval, unless this command is just LS." And if we go into Open Code now, if I say um Open Code {dash} C, and I tell it to run the LS command, I'm going to be or it's going to be able to do that without any problems. So, uh run LS command. This is going to now just execute LS. Perfect. And now if I say run LS {dash} LA command, it's not going to work, because this flag is not um not allowed here. So, permission required. It's going to ask me to allow this, allow always, or reject. So, I'm going to allow once, and there you go. Perfect. So, this is a very basic setup. And also, if I tell it now to um make sure the data of the to-dos is actually persisted on disk, use SQLite3. Then it's going to now use a database to persist our to-dos, but it's going to ask me for approval when it tries to change something in the code. There you go. So, here it says now permission required, and sometimes it might have uh or it might want to try certain things, or it might want to change certain things, and I don't see everything uh in a convenient way, because this is not not the best way to look at code changes. So, what I can do is I can say control F, and this is going to launch this in full screen. So, now I see this diff view, which shows me like on GitHub, what is being removed, what is being added, and I can see if this makes sense, and if I'm okay with that, I can just press allow once. And you can see it also reacts here to uh linter errors, because it also uses an LSP. This is a thing that you don't really interact with, so you don't really do anything specifically with the LSP, but Open Code itself uses an LSP, which means that it is much better at finding stuff. So, it doesn't have to just use grep commands to find certain occurrences. It can just use refactoring, it can use um the LSP, essentially, um so, the language server, to realize what's happening, and also to find certain linter errors. Um so, here again, it wants permission. I'm just going to allow. Now, it wants to run uh the Python script or py compile. I'm going to allow this as well, and then at some point, it's done. Now, if I'm not happy with this change, what I can do is I can undo. So, I can do {slash} undo, and it's going to allow me to undo what has happened in the last step. However, I can also, and this is I think the difference between uh between Open Code and Claude Code, because as far as I know, and I might be wrong about this, in Codex, I'm not even sure if you can undo it all. In Claude Code, you can undo, but you cannot redo. And here, you can also redo. So, I can also do redo, and it goes back to where I was. And I think I can also jump. I'm not sure what the command is here. I think if I go to control P, uh there is a command jump to message, so it would be control X and G would allow me to do that, and I can just jump to any point here, for example, to run the LS command, and I can say, "What do I want to do here? Do I want to revert everything and go back to this state of my files and the message history? Do I just want to copy the text to clipboard, or do I want to fork into a new session?" This is also a nice feature. However, the forking feature is not exactly what you might think it is. It is not exactly like a GitHub fork where you can just um where you can just have now two versions of your code on your system. Uh like you have a to-do application and in one branch you say, "Make it blue." In another one you say, "Make it red." It's not like that. You don't have this kind of code fork. You have more like a conversation fork. So, at some point you might be asking, you know, you have the context of the whole application. You want to ask, "Okay, how is this feature being implemented here?" And then you want to ask some other question about the code base. And maybe to not confuse it, you want to ask it in a fresh state with all the context but without the previous request. So, that is uh the idea of forking but you're not really forking um the code. So, if I if I go to a message, what was it? Uh control XG. If I go to a message here and I fork this, I have a new session with the same history. But if I now do something, it's going to also be applied on the code of the other session. So, we're not treating this here like a independent thing. Um all right. So, I can also take a look at the sessions that I already have by saying {slash} session or sessions. This shows me here the different sessions I have. I have a fork and I have the default session. I can jump back to it here. And by the way, most of these things can also be done with shortcuts as I said. So, here you can go to commands and you can see probably there's going to be here switch session and then I can just switch here like this as well. And the shortcut for that was uh control XL. So, control XL allows me to also switch the session. Now, another cool feature is sometimes I might have very complicated prompts that I want to write. Maybe with some formatting, maybe I want to do markdown, maybe I want to do uh a lot of uh line breaks and so on. What I can do in this case is I can just open my favorite editor. So, in my case Neovim is registered as the default editor in the terminal. So, what I can do here now or the default editor in general, uh what I can do here now, I think it was control XE, allows me to open Neovim. So, now here I have a markdown file. I can say, "Instruction and then this is my fancy instruction for Open Code." And then maybe I can also just copy-paste this because it's easier to do that in Neovim. Then I can write and quit. And now I have here the entire message um in this field here. And I can also do the same thing again. I can say control XE and I should be able, as far as I know, to also remove all of this, write and quit. Maybe if I do it one more time. Okay, seems to to not work right now but it actually worked before. So, maybe maybe that's a bug right now. But the idea is I don't have to do this myself. I don't have to write here in this uh text window. I can also do that in Neovim and use the macros or whatever uh to make this happen. Even though right now I have to delete it manually. So, maybe either that's a bug or this is a layer eight problem, me using it in the wrong way. But that is the idea here. Also, by the way, a lot of this stuff can be done with a mouse. So, I can also scroll up to a message that I sent like, for example, this one here and I can click on it and it's also going to allow me to take these message actions that I get when I jump to a message. Now, another nice feature here is switching back and forth between variants of the model and also between the modes. So, here you can see right now I have GPT 5.3 Codex and I can also press tab to switch to plan mode or tab to switch back to built mode. So, this works easily. In plan mode, I only have or the agent only has read-only access. So, if I say um "Add a user model to the DB and application. So, users own different to-dos." Then it's going to give me a plan now. It's not going to implement this into code yet. So, I have the plan mode and then I can go into build mode to actually do this. So, as you can see here, I get now a plan and if I'm happy with that, I can just go back to build mode and implement this. Also, with control T, as you can see down below, uh what I can do is I can change the variant. So, I have low thinking or low reasoning effort, medium, high, and extra high, which is extra high. So, that's also quite convenient that I can just easily cycle through that with control T. Then maybe uh a feature that's not really too much of a feature, it's more like uh a styling thing. I can also change the theme. So, I can go to themes and I can go with one dark, for example, which usually would fit my system more but I enjoyed the Open Code uh theme a lot. So, I'm going to keep it. But you can try all the different fields like uh or all the different themes like Gruvbox, for example, if that's your thing, uh that's kind of cool as well. Now, of course, I'll not show you every single thing about Open Code here but I want to show you two more things. Uh one is how to do this with Ollama. This is the last thing I'm going to show you. But the next thing I want to show you is how to use plugins. So, you can easily use Open Code plugins, community plugins, by just specifying the NPM package. So, I just have to specify what package the plugin is on NPM and then it automatically loads that. So, when we take a look at the Open Code documentation in the plugin section, you will see how to install plugins. For example, you can do that from local files by downloading them and putting them there, or you can just specify the NPM package like this: plugin and then a list of plugins based on their NPM package name. And if you go to the ecosystem section, you will also find a couple of plugins. For example, here the one I want to use is the notifier plugin. So, Open Code Notifier. We can click on it. This is going to take us to a GitHub repository and here we can now just copy this and paste it into our Open Code file. So, I can get out of Open Code here. I can open up the Open Code JSON and down here on the same level as permission, I can just add a comma here and then I can just paste the plugin. I don't need the curly bracket. is just a field here. I can indent this properly and now I have the plugin installed here or specified that it should be installed and used. And what I can now do is I can close this. I can open Open Code again and I can go to a different workspace while giving it a command. I can say, "Run LS command." Then I can move to a different workspace here and I should get um here now the not a notification that this is completed. There you go. Open Code tutorial session has finished. So, this is how easily you can plug and play with plugins here. And the final thing I want to show you is how to actually uh use Ollama models, so local models. I'm not going to show you that exactly because I'm on a very weak laptop here. If we look at fastfetch, you will see that I have a very uh limited set of hardware here. So, I'm not going to do this. And also on Ollama, I think I only have uh basic models, not instruction models. But the theory is the same. So, this is a screenshot of what you would have to do. You still have the schema and then you just say provider Ollama. So, this is how you plug in a new provider. You name the provider Ollama. You provide the package here, uh NPM OpenAI compatible. You say that the name is Ollama via LAN. Then you specify the base URL. In my case, this was now a machine that was running Ollama on this Ollama port here. And then I specified that I want to use the GPT open source model with 20 billion parameters. So, what this does is it registers this as a new endpoint, as a new model provider, and as the model that is available there. So, when I have this, I can just go back to Open Code, say {slash} models, type in Ollama, find this, and select the right model. So, that's it for this video today. I hope you enjoyed it and hope you learned something. If so, let me know by hitting a like button and leaving a comment in the comment section down below. Also, in case you're interested, on my website you will find a services tab and a tutoring tab. There you can contact me if you need help with freelancing or if you need a freelancer, if you need some consulting, some one-on-one tutoring for any of your projects, startups, whatever. You can contact me via LinkedIn or email at the bottom of these pages. Besides that, don't forget to subscribe to this channel and hit the notification bell to not miss a single future video for free. Other than that, thank you all for watching. See you in the next video and bye.
Original Description
Today we will explore OpenCode, which is an open source community-driven terminal agent with an awesome TUI.
OpenCode: https://opencode.ai/
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: https://www.neuralnine.com/books/
💻 The Algorithm Bible Book: https://www.neuralnine.com/books/
👕 Programming Merch: https://www.neuralnine.com/shop
💼 Services 💼
💻 Freelancing & Tutoring: https://www.neuralnine.com/services
🖥️ Setup & Gear 🖥️: https://neuralnine.com/extras/
🌐 Social Media & Contact 🌐
📱 Website: https://www.neuralnine.com/
📷 Instagram: https://www.instagram.com/neuralnine
🐦 Twitter: https://twitter.com/neuralnine
🤵 LinkedIn: https://www.linkedin.com/company/neuralnine/
📁 GitHub: https://github.com/NeuralNine
🎙 Discord: https://discord.gg/JU4xr8U3dm
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from NeuralNine · NeuralNine · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Visualizing Stock Data With Candlestick Charts in Python
NeuralNine
Python Beginner Tutorial #1 - Installation and First Program
NeuralNine
Python Beginner Tutorial #2 - Variables and Data Types
NeuralNine
Python Beginner Tutorial #3 - Operators and User Input
NeuralNine
Python Beginner Tutorial #4 - If Statements and Conditions
NeuralNine
Python Beginner Tutorial #5 - Loops
NeuralNine
Python Beginner Tutorial #6 - Sequences and Collections
NeuralNine
Python Beginner Tutorial #7 - Functions
NeuralNine
Python Beginner Tutorial #8 - Exception Handling
NeuralNine
Python Beginner Tutorial #9 - File Operations
NeuralNine
Python Beginner Tutorial #10 - String Functions
NeuralNine
Python Intermediate Tutorial #1 - Classes and Objects
NeuralNine
Python Intermediate Tutorial #2 - Inheritance
NeuralNine
Python Intermediate Tutorial #3 - Multithreading
NeuralNine
Python Intermediate Tutorial #4 - Synchronizing Threads
NeuralNine
Python Intermediate Tutorial #5 - Events and Daemon Threads
NeuralNine
Python Intermediate Tutorial #6 - Queues
NeuralNine
Python Intermediate Tutorial #7 - Sockets and Network Programming
NeuralNine
Python Intermediate Tutorial #8 - Database Programming
NeuralNine
Python Intermediate Tutorial #9 - Recursion
NeuralNine
Python Intermediate Tutorial #10 - XML Processing
NeuralNine
Python Intermediate Tutorial #11 - Logging
NeuralNine
Python Data Science Tutorial #1 - Anaconda and PyCharm Setup
NeuralNine
Python Data Science Tutorial #2 - NumPy Arrays
NeuralNine
Python Data Science Tutorial #3 - Numpy Functions
NeuralNine
Python Data Science Tutorial #4 - Plotting Functions With Matplotlib
NeuralNine
Python Data Science Tutorial #5 - Subplots and Multiple Windows
NeuralNine
Python Data Science Tutorial #6 - Matplotlib Styling
NeuralNine
Python Data Science Tutorial #7 - Bar Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #8 - Pie Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #9 - Plotting Histograms with Matplotlib
NeuralNine
Python Data Science Tutorial #10 - Scatter Plots with Matplotlib
NeuralNine
Python Data Science Tutorial #11 - 3D Plotting with Matplotlib
NeuralNine
Python Data Science Tutorial #12 - Pandas Series
NeuralNine
Python Data Science Tutorial #13 - Pandas Data Frames
NeuralNine
Python Data Science Tutorial #14 - Pandas Statistics
NeuralNine
Python Data Science Tutorial #15 - Pandas Sorting and Functions
NeuralNine
Python Data Science Tutorial #16 - Pandas Merging Data Frames
NeuralNine
Python Data Science Tutorial #17 - Pandas Queries
NeuralNine
Python Machine Learning Tutorial #1 - What is Machine Learning?
NeuralNine
Python Machine Learning Tutorial #2 - Linear Regression
NeuralNine
Python Machine Learning Tutorial #3 - K-Nearest Neighbors Classification
NeuralNine
Python Machine Learning #4 - Support Vector Machines
NeuralNine
Python Machine Learning Tutorial #5 - Decision Trees and Random Forest Classification
NeuralNine
Python Machine Learning Tutorial #6 - K-Means Clustering
NeuralNine
Python Machine Learning Tutorial #7 - Neural Networks
NeuralNine
Python Machine Learning Tutorial #8 - Handwritten Digit Recognition with Tensorflow
NeuralNine
Generating Poetic Texts with Recurrent Neural Networks in Python
NeuralNine
Stock Portfolio Visualization with Matplotlib in Python
NeuralNine
Analyzing Coronavirus with Python (COVID-19)
NeuralNine
Making Text Images Readable Again with Python and OpenCV
NeuralNine
Neural Networks Simply Explained (Theory)
NeuralNine
Motion Filtering with OpenCV in Python
NeuralNine
Top 5 Programming Languages To Learn in 2020
NeuralNine
Simple TCP Chat Room in Python
NeuralNine
Image Classification with Neural Networks in Python
NeuralNine
Edge Detection with OpenCV in Python
NeuralNine
S&P 500 Web Scraping with Python
NeuralNine
Simple Sentiment Text Analysis in Python
NeuralNine
Introduction - Algorithms & Data Structures #1
NeuralNine
Related Reads
📰
📰
📰
📰
Por que o uso massivo de IA nas
empresas não está virando resultado?
Medium · AI
The Era of Personal Cinema: The 99% Ignored AI Entrepreneurship Goldmine
Medium · AI
Debugging Next.js History Desync: When AI Agents Hit a Wall
Medium · AI
Level Up Your Business: How AI Can Unlock Africa’s Untapped Potential (and Earn in USD)
Dev.to AI
🎓
Tutor Explanation
DeepCamp AI