AI YOLO - Sit Back and Watch Cursor Automatically Run Terminal Commands

Warning: AI's make mistakes. Some of them can be very costly. Terminal have access to your most private information, especially if you're using a "work computer". Please proceed with extreme caution!

Cursor's new "YOLO" feature It allows you to enter an AI prompt and then just sit back and watch as an AI will run terminal commands automatically. The AI will automatically install packages, automatically start and stop dev servers, and even check the output of the terminal commands to run subsequent terminal commands and attempt to fix them.

Traditionally, this is some of the most critical, but also some of the most boring work that a developer has to do, especially when it comes to memorizing all of the various syntax and all of their various commands that you need to know. In larger projects, it's even really easy to forget which commands are even available. So handing all this work over to an AI is a natural step in the evolution of development. But again, please be extremely cautious with these features as there are a million ways that everything could go terribly, horribly wrong.

Share with a coworker

Transcript

[00:00] Cursor now has a YOLO mode under features. So check this box down here. Agree to the very serious risks. And then for my prompt I added allow all PNPM and Git commands and start and stop servers. I also enabled the delete file protection.

[00:15] And I still have to experiment more with the command allow list and deny list. So I'm going to start with a plan which I'll paste in, which I created by dictating to chatgpt pro that I want to start a server, enter a URL, scrape the page, and then present it back in a nicely styled format and I told it to make a plan using TypeScript and Node. So from this plan, I need to make sure I'm in Composer. From this plan we'll make sure Agent is enabled and now once I hit submit, YOLO mode will just start executing and installing things. So let's watch it fly.

[00:45] So it's starting with an empty directory, it's initializing our project, it's adding packages, creates a TS config, creates a project structure, updating TS config, it's creating the server file, creating some styles, and each step it's checking for linter errors as well. Now it's adding the scripts to the package.json, adding a readme, and it's starting the dev server. It completed so let's test our localhost. We'll bring a browser over, paste in the URL. Let's try espn.com, hit enter.

[01:12] We hit an error so what I usually do is I'll take a screenshot of this, drag this out of the way, drag my screenshot in, and it says it already has the terminal context here. So I'll just type in please fix, where before I would have typically copy and pasted this. I'll hit submit. So I found the error of reading load which was here. So it looks like it missed a package to install.

[01:35] It's adding more error handling. Looks like it actually found some lint errors and it found that this failed. So it's fixing this automatically. Now it's fixing some more type errors. And just as a side note I did try this before I started this video and I did not run into this many type errors.

[01:53] It was a much smoother process last time but I still think it'll get to the end this time. Now it's restarting the dev server so it should be back in business. Giving me a summary here. So I'll bring this back over. I'll go back to the main page.

[02:06] Make sure I refresh. Enter our URL. Click scrape. And it looks like it worked to a certain extent. From here I'd dig into the actual site, maybe take some screenshots, and give it some scenarios that I think it's missing.

[02:17] But the only thing I ever typed was please fix. So I can honestly say my mind is blown. So let's wrap this up by use the GitHub CLI to create a repository for this project and push the repository up to github. And please make sure you're using a proper gitignore file before you start. This is a bit of a yellow moment, we do not have a gitignore and I'm allowing it to push to my repo and it could push all of the node modules up.

[02:40] I'm going to full trust it here and just send it, see what happens. All right thank goodness it added node modules to the gitignore. It's initializing the repository and now if I check my GitHub my most recent repository should be this sitescraper.