How To Install MetaGPT

How To Install MetaGPT - Build A Startup With One Prompt

How To Install MetaGPT - Build A Startup With One Prompt

https://www.youtube.com/watch?v=uT75J_KG_aY

Transcript:

Welcome back. In today's video, I'm going to show you MetaGPT, an app that promises to be your entire engineering organization. I'm going to tell you about it. I'm going to show you how to install it, and then I'm going to show you how to use it. Let's go.

So this is the MetaGPT GitHub repo, and you'll find a bunch of information on it. So I invite you to check it out. So the first thing I want to show you is this diagram, and this shows you what MetaGPT will do. As you see at the top, it presents itself as an entire software company. There's the boss who supplies the requirement, the product manager who writes the PRD and revises it.

The architect, the project manager, the engineer, and the QA, all in this single project. It is incredibly impressive, and the costs are not much. For one example, it says it's going to be about 20 cents, and $2 for a full project. It's pretty easy to install, but I'm going to show you how to do it step by step.

I'm going to drop a gist in the description with every command that I'm using here. So if you don't want to pause the video again and again, you can find it there. So I'm running this on a Windows machine, but I already tested it on Mac, and it works just fine there as well. So the first thing you're going to do is open up console with Anaconda running.

And if you don't already have Anaconda installed, I highly recommend you do it, because it provides you a really easy way to segment your different environments with Python. And so the first command we're going to run is to create a new conda environment. conda create -n metaGPT Python equals 3.1 1.4.

So we're using a very new, if not the most recent version of Python. And we're going to proceed. It's going to download all the dependencies and the requirements. And then the next thing we're going to do is copy the command right here, and we're going to activate the environment conda activate metaGPT. And now we can see it's activated because it says metaGPT right here in parentheses.

The next thing you're going to need to do is make sure that you have NPM installed. So we're going to type NPM - - version, and I do not have it installed on my Windows machine. So let's go ahead and do that. So we're going to go to the node.js.org website, and we're going to click this Windows installer button.

We're going to download it, and we're going to install it. And then we have to restart our console. So we're going to activate metaGPT again. And now when we do NPM - - version, we have the version. So that means it's installed. And if you're following along on a Mac and you have Homebrew installed, you can simply type brew install NPM, and it'll do the same thing.

The next thing we're going to do is install mermaid. So NPM at mermaid - JS slash mermaid - CLI. Next, we're going to clone the repository. So git clone, and then the repo URL, which again will be in the description below and in the instructions that I provide in the gist. And there we go. Now we change directory into that new repository.

So CD metaGPT. Next, we're going to install all of the requirements. So Python - M pip install -R requirements.txt. Okay, that's done. That took about three to four minutes. Next, we're going to use their setup.py file to install. I'm not sure if you normally need to run both commands of installing requirements.

txt and the install file, but I couldn't get it to work otherwise. So we're going to do it here. So Python setup.py install. All right, it's done. That just took a few seconds. Next, we need to create an open AI API keys. So go to openai.com. And if you don't already have an account register, then you're going to come to the API keys page, create new secret key.

We're going to name it metaGPT and then create key. And I'm going to copy it. And I'm going to revoke this key before publishing this video. Then we're going to open a Visual Studio code. We're going to go up, click file, and then open folder. And then you're going to select the metaGPT folder from there.

On the left side, you're going to look for the config folder, click it. And on config.aml, go ahead and click it again. So on line 10, you're going to uncomment it, open AI API key, and you're going to replace it with your API key. You don't need the quotes. And for the open API model, you're going to use GPT-4 if you have that available.

And of course, if you don't, if you only have GPT 3.5, you put that there instead. Go ahead, save. Then we're going to switch back to console and we're ready to go. So to create a new project, all we type is python startup.py. And then in a string, we write what we want it to do. So here I wrote something really simple.

Write a CLI snake game based on pygame. And you can make it more complex, of course. And there's one more toggle that you can add to the end of this dash dash code underscore review. True will actually make the code better, but it'll cost more. So it essentially goes through a number of iterations to get the code correct.

But we're not going to do that right now. So I'm just going to hit enter and let's see what it does. Okay. So I got the same exact error when I ran this on the Mac. So it says module not found error, no module named BS4. So we're going to go ahead and just install it. Python dash M pip install BS4.

So I'm not sure why they don't have this in the requirements.txt file. They really should, but it's an easy fix. And now we're done. So then we're going to go back to our previous command and run it again. Python startup.py and then the instructions. And there it goes. So we have the original requirements.

The boss has requested the creation of a command line interface snake game based on pygame. Product goals create a simple, easy to play CLI snake game and show the game is built using pygame. Blah, blah, blah. User stories, competitive analysis, competitive quadrant chart. So this is actually extremely impressive and it really does hit every aspect of a software engineering organization.

And it actually prints out PNG versions of these and PDF versions. So you can actually see the PRD file if you want. It says, is anything unclear? No. And then it starts writing the code. So as it's doing that, I'm going to switch back to visual studio code. And so all of a sudden this workspace slash CLI snake game folder is going to be here.

So we go ahead and click it and then we click into CLI snake game and we see that it's starting to build out the code. All right. So interestingly, this time it didn't actually output a PNG or a PDF file for the diagrams and for the PRD files, but it did that on the Mac. However, it does have this PRD dot MD file, which seems to have all the same information.

It's just not as pretty. I'm sure there is a way to convert all of this into a nice visual diagram, but I'm not going to worry about that right now. Then if I switch back to our console, it seems like it's done. So it has all the files, everything all written out perfectly. Now let's give it a try.

Switching back to visual studio code workspace slash CLI snake game, go into that. And then we have main.py and we're going to go ahead and click run at the top right. And this is actually pretty hard, but it seems to work. The snake is getting longer. It tells me the score. One issue I see is that I can go off the map.

So I can obviously correct that as I get more detailed in my prompt, but it works and it works really well and it does all the research for me. I'm going to go ahead and quit out of here now. So the one thing that meta GPT is missing is iterating on existing code. I know they already have an issue for it and they're aware of it.

So I think they're going to be adding that soon. This is still very exciting. And if you're looking to build a full project, not just the code, but actually the competitive analysis, the PRD, everything meta GPT is great. So I recommend you check it out. And if you want to compare this to another coding assistant that I found to be absolutely amazing, which is called Aider, check out this video here.

If you liked this video, please consider giving a like and subscribe and I'll see you in the next one.

Last updated