The Story Behind Warp's AI Command Search
Published: 2022-07-11 21:17:29

## 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](https://docs.warp.dev/features/ai-command-search) or read this blog [here](https://www.warp.dev/blog/replace-git-cheat-sheet-ai-command-search) where we gave AI Command Search a pop quiz on Git commands.

‍
<blockquote class="twitter-tweet" data-partner="tweetdeck"><p lang="en" dir="ltr">Trying out <a href="https://twitter.com/warpdotdev?ref_src=twsrc%5Etfw">@warpdotdev</a> again and they have this AI command search - pretty impressive! I can see this being handy for those command you can never remember <a href="https://t.co/4PBSjN4YND">pic.twitter.com/4PBSjN4YND</a></p>&mdash; Wes Bos (@wesbos) <a href="https://twitter.com/wesbos/status/1529113581362487296?ref_src=twsrc%5Etfw">May 24, 2022</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
‍

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g26lseo78n19dtygn6nv.png)‍


## The Origin Story of AI Command Search
‍

In October 2021, [Github Copilot](https://en.wikipedia.org/wiki/GitHub_Copilot#:~:text=On%2026%20October%202021%2C%20GitHub,plugin%20on%20the%20JetBrains%20marketplace.) 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](https://openai.com/blog/codex-apps/) 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"](https://www.loom.com/share/040c8eedad244ff08a4b1afb1b75323a):
‍

![Baby AI Search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/egzaal3zab67k3ayx4fc.png)
‍

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/forjr5lga55szcxf7vcs.png)


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!!

‍
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Warp&#39;s AI Command Search is powered by OpenAI Codex, which converts English into popular coding languages. <br><br>It powers tools like GitHub Copilot, Pygma, and more!<br><br>We were recently featured in Codex&#39;s blog. It&#39;s super interesting - read about it here!<a href="https://t.co/lICkCUBMHW">https://t.co/lICkCUBMHW</a></p>&mdash; Warp (@warpdotdev) <a href="https://twitter.com/warpdotdev/status/1529175828658937856?ref_src=twsrc%5Etfw">May 24, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
‍

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3r11do62c6aiw7aiwkgo.png)
‍
‍
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.

‍
<blockquote class="twitter-tweet" data-partner="tweetdeck"><p lang="en" dir="ltr"><a href="https://twitter.com/warpdotdev?ref_src=twsrc%5Etfw">@warpdotdev</a> wow! what a product! CLI guru by EOD guaranteed! <a href="https://t.co/GcaWcaVBNS">pic.twitter.com/GcaWcaVBNS</a></p>&mdash; Salim Karim (@metasal_) <a href="https://twitter.com/metasal_/status/1526372957303767040?ref_src=twsrc%5Etfw">May 17, 2022</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
‍

## 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](https://twitter.com/warpdotdev/timelines/1518290964212641793).


Once you have Warp downloaded, you can check out our [official documentation](https://docs.warp.dev/features/ai-command-search), 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](https://discord.com/invite/warpdotdev). You can find all our social media links through our profile.
‍

Thanks for reading!