Inspiration

We'd had the idea to make an inline CLI helper from a previous hackathon - it was one of the tasks we thought looked interesting, but we didn't have time to build it in the end. We thought it would be great for younger students just getting into computer science. The command line is such a powerful tool, but the barrier for entry is often quite high at first. With this in mind, we wanted to introduce more people to the technology with an interactable assistant.

What it does

Requires a bit of aliasing:

doskey clint=python .\clint.py $*

But otherwise is pretty easy to get going. CLINT allows you to ask questions about basic CLI tasks like navigating directories, creating and removing files, and listing directory contents. Just ask something like:

clint help me create a blank .txt file called 'test'

and it should give you the commands fairly reliably. You'll have each command displayed and explained to you, and you have complete control over what gets executed at all times.

How we built it

We ran a huggingface model locally do all of the LLM prompts. Everything was pretty much one big python script. It's very nails-and-tape in there, especially with the prompt formatting. We didn't have time to cache anything though which means it takes a while to get booted up.

Challenges we ran into

Whole bunch. First off, the model seemed to be super used to linux environments, but not so much windows. This meant we had to manually map a bunch of commands to their windows counterparts, like rmdir -> del. It still finds ways of sneaking impossible commands in though, so we have to test everything before it goes through. The tradeoff is also difficult, becaues the LLM gave great answers when we upgraded to a higher-parameter version, but the wait times were too long, especially given our goal to make the experience feel conversational for the user.

Accomplishments that we're proud of

I mean it kind of works? It started just not running recently and I'm not so sure why, but we had a couple of good uses, especially when it came to creating files and navigating. Again it's all very hacky.

What we learned

This was my first time running an LLM locally on my machine and it was definitely an interesting process. I would've really loved more time to refine this project and take advantage of caching and a proper memory setup, but as a proof of concept it's pretty alright.

What's next for CLINT - Inline command assistant

We've got a lot to fix. In it's current state it's almost more confusing for someone who doesn't already know CLI - but I think with some more attention we could make something truly useful out of it.

Built With

Share this project:

Updates