Transcript for:
Setting Up Zed with AIDR for AI

Hi, welcome to another video. So, I've already covered Zed and how you can set it up locally and use it as much as you want. But there's one issue with Zed's AI features. It doesn't support multi-file editing. Multi-file editing basically means that you give it a prompt. and it automatically goes through all your files, applies the patch, and does what you want without you having to go into each file and ask the AI to fix it. Cursor has this feature, I believe, but obviously, it's paid, and not that great anyway. So today, I'm going to show you how to set up something that's fully comparable to Cursor, but fully open source and free, with all the basic AI features. as well as the multi-file editing feature we want. To do this, we'll be using Zed as our main editor, because it has really good AI features. It can do pretty solid editing within files, and you can also give it file context and chat about it. You can even set it up with local models, which I've already covered in a separate video. Apart from that, we'll be using Ader. AIDR will allow us to do fully automated multi-file editing, which ZED's AI can't do yet. Plus, because it's a terminal interface, we can easily open it within ZED's terminal, which should be pretty good. So, this will give us exactly what we want. When we need to do simple things like changing a block of code, chatting about the code, or fixing a chunk of code, ZED's AI can handle that. And if we want to do something more complex that requires editing multiple files, AIDR can step in and do that. Plus, we'll be able to do it all from one place, which is ZED. Now, for the model, I'll be using Anthropic because it's the best model we can use currently, and it makes things easier. Plus, ZED also has Anthropic, which is currently fully free to use without any limits. which is really cool. If you want, you can also set it up with Ollama. It's pretty easy as well. You'll just need to select a model and get that configured. I have a separate video on how to set up Zed with Ollama, so you can check that out. Anyway, now that we've figured out what to use, let's get started. First, we'll need to get Zed installed. Just go to Zed's site and download it from there. Once you have it installed, open it and sign in with a Zed account, because that's required to access the free Clawed 3.5 Sonnet. Once you've done that, just click on the AI option, and you'll see the Clawed 3.5 Sonnet model in your dropdown, which is pretty good. You can send in messages, and it works well. You can also add your files to the context, and things like that. To generate code, You can go to the Inline Assist option over here, ask it to generate something, and it will get that done, which is also cool. But before we use these features, let's install AIDR. To install AIDR, just open up the terminal inside ZED. In the terminal, run the pip install AIDR chat command. Once you do that, AIDR should get installed. You'll also need to export your API keys in the terminal. For OpenAI, export that, or for Anthropic, export like this. You can also use it with Ollama by using the model operator with the AIDR command. I have multiple videos on how to set up AIDR with Ollama, so you can check those out. Anyway, just run the AIDR command, and AIDR will get started. Once you do that, you'll see this interface. Here. You can ask it to create any kind of application, and it will go through all the files and generate it for you. It can also do multi-file editing, which is really good. Now, let me show you an example of how you can use it. Let's create a simple to-do list application here. To do that, first, let's ask AIDER to create a simple to-do list application using HTML, CSS, and JS. Let's send the prompt over here, and as you can see, it's doing that now. We'll need to wait a bit. And as you can see, it's now done. It has created the file, and we can just start using it. So, let's open it and preview it. Okay, as you can see, here's the to-do list app. This looks pretty good and works well. But now, I want to add a simple heading to this app saying, Sweep King. So, let's go to Zed over here, select the whole thing, And through the inline assist, let's ask it to add a simple heading. Let's send it now, and as you can see, here's the change it suggests. So, let's approve it, and click the tick option. Now, let's save it. Let's look at it now, and here's the heading, which looks pretty good. So, that's basically how you can use this workflow. You can generate the basic stuff with AIDR. And when you need to do simple things, you can just use Zed's AI features. You can also use the chat interface if you want to have a simple chat about your code and understand how it works. That's cool as well. One more thing you can do is figure out the changes you want in the Zed AI chat interface. And then when you've got the exact code you want to implement, you can just go to the inline assist and ask it to implement the changes. The chat interface and inline assist are hooked up to the same context, which is a cool thing I found out. There are also a bunch of other stuff that you can do in the chat interface, like adding the files to context or specific lines, which is also pretty good. Overall, I think this is one of the best options, with all the basic AI features and the multi-file editing feature. You can create some good key bindings. and make it much smoother as well. I don't think there's anything better than this, because AIDR is already really good, and ZED will keep getting better. Both of them are very customizable, and support a bunch of providers, including Ollama, which is really cool. If you want to know which model is best for local usage, then check out my ZED AI with Ollama video, where I have covered that. But, in short, the QEN27B can be good with it. Overall, it's pretty cool. Anyway, let me know your thoughts in the comments. If you liked this video, consider donating to my channel through the Super Thanks option below, or you can also consider becoming a member by clicking the join button. Also, give this video a thumbs up and subscribe to my channel. I'll see you in the next video. Till then.