DEV Community

Cover image for The Story Behind Warp's AI Command Search
Jessica Wang
Jessica Wang

Posted on • Edited on

The Story Behind Warp's AI Command Search

Introduction

In April 2022, Warp launched a feature called AI Command Search. It allows users to type natural language search into the terminal and get back a command generated by artificial intelligence. It's one of Warp's more unique features, and an extremely powerful tool if you know how to use it. To learn more about AI Command search specifically, please check out our official documentation or read this blog here where we gave AI Command Search a pop quiz on Git commands.

Trying out @warpdotdev again and they have this AI command search - pretty impressive! I can see this being handy for those command you can never remember pic.twitter.com/4PBSjN4YND

— Wes Bos (@wesbos) May 24, 2022

But the story of how AI Command Search came to be is quite interesting. I talked with Kevin Yang, the engineer behind the feature, and gained some insight into the challenges he navigated before arriving at the product we see in Warp today.

Kevin's profile in Warp's About Us Page

The Origin Story of AI Command Search

In October 2021, Github Copilot was announced to the public. It is an artificial intelligence tool created by Github and OpenAI Codex to help software engineers work more efficiently by autocompleting their code.

Kevin realized that Codex actually has support for shell commands, and found that the suggested commands were quite accurate. He realized the potential in being able to search for hard commands using just natural language, instead of turning to Google or reading through long Stack Overflow forums.

That October, an initial prototype was built. Kevin was kind enough to pull up a screen-capture of what I call "Baby AI Command Search":

Baby AI Search

Unfortunately, AI Command Search was mostly a side-project for Kevin, who was working on other core features to Warp at the time. So, this initial prototype sat on the shelf for a few months.

In December 2021, Kevin got a nudge from one of his coworkers, Agata.

Jim-gata and Dwigt-vin, the pillars of our engineering team

She mentioned that she used the initial prototype of AI Command Search in her day-to-day work, saying that it was especially great for re-calling specific flags for tar commands. This was encouraging - if one of our own engineers found the feature useful enough to use, it was worth building out a version that we could release to the public. Kevin scheduled a design jam with our amazing designer and cofounder, Shikhiu - and the sleek command search UI that we know and love today was born.

In Feb 2022, I learned that Kevin built out a large portion of this UI on a plane to Hawaii for Warp's annual retreat. And after a wave of iterations, bug bashes and dogfooding, AI Command Search was ready for an official release in April 2022 as part of Warp's official beta launch!!

Warp's AI Command Search is powered by OpenAI Codex, which converts English into popular coding languages.

It powers tools like GitHub Copilot, Pygma, and more!

We were recently featured in Codex's blog. It's super interesting - read about it here!https://t.co/lICkCUBMHW

— Warp (@warpdotdev) May 24, 2022

Engineering Challenges

One of the main challenges was improving the accuracy of the answers returned by Codex. What was the right way to engineer the prompt so that the AI could understand the right context and format for generating answers?

Another challenge was figuring out the best way to integrate Warp's AI Command Search with other modals we use for command search, like history search and workflows.

Design Challenges

In the initial prototype, the user would simply enter the natural language search into their terminal input box and hit a keystroke to generate the AI command. It would take the output and insert it back into the shell command.

Design challenges of the first iteration of AI Command Search


In this design, the user has no context as to what the feature does when using it. It also re-uses the terminal input box as a search bar, which can cause confusion. What if the user had already typed in a command they wanted to run, but pressed the keystroke to trigger AI Command on accident? Their command would be erased and replaced with something else.

Here is a video of AI Command Search today. The current user interface solves a lot of these design challenges.

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

Thoughts After Shipping the Feature

AI Command Search is a unique feature that has not existed within a terminal before. As a result, it's hard to know how to prioritize it when compared to core terminal features like split panes, autocomplete, and session restoration.

For Kevin, it was hard to know whether this feature would have a big impact, and as a result, it was difficult to advocate for it as an official engineering work item versus keeping it as a side project. Luckily, he was encouraged by coworkers and a general engineering culture within Warp.

@warpdotdev wow! what a product! CLI guru by EOD guaranteed! pic.twitter.com/GcaWcaVBNS

— Salim Karim (@metasal_) May 17, 2022

Want to try out AI Command Search Yourself?

If you're interested in trying out AI Command Search yourself, you can!

Download Warp using the Download button in the top right corner of this site. It's free to use. If you want to hear from the people who are already using Warp, go here.

Once you have Warp downloaded, you can check out our official documentation, or simply press CTRL + ` to open up the AI Command Search panel.

And if you try out any interesting commands, we'd always love for you to tweet them and mention us @warpdotdev on Twitter, or share them on our Discord. You can find all our social media links through our profile.

Thanks for reading!

Top comments (0)