Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting to me, your mileage may vary.

Working in my spare time on a command line terminal UI application that searches over source code and ranks the results.

It came about from watching a work college constantly opening VSCode when trying to find things in a codebase. I mentioned he should use ripgrep/silver searcher which he tried, but said he preferred to get more context and wanted ranked results. The context was possible using -A and -B but he didn't want that.

I had always wanted to make a terminal application and it seemed like an interesting problem to solve. I had also always wanted to implement BM25/TFIDF ranking algorithms myself and I was curious to see how well this could be done without pre-flighting and building an index.

Still a work in progress https://github.com/boyter/cs but coming along. Its usable now (with bugs) and is being used by my work mate.



Hey! Looks cool, I tried compiling it on Windows (at work ATM, hehe) but so far it does not seem to find any files. If I start it in a folder, the search always says 0 in 0 files.

Is windows a supported platform?


Yes it is, or should be. I’d need more details to really work it out for your case. I will have a look at potential issues in the next few hours.

EDIT I tried and no issues on Windows. I would need more details to investigate. Please raise the issue on github and I will investigate.


Looks promising and definitely that can have a huge commercial value. I'm curious about how you establish context for code-search? Also, how do you decide on how to rank the result based on a single string?


Looks useful. Would it be fast in huge codebases?


Yes and no. The interactive version appears to be because it displays results as it goes. However for pure command line, it will be fast but not comparable to ripgrep/grep/silver server or others.

I want it fast, but absolute performance is not a goal as its a trade off with any ranking algorithm. Not really the same sort of tool.

Anyway here is a search over my projects directory which is about 5.7 GB of content https://github.com/boyter/cs/blob/master/large-search.gif

Feel free to try it out if you are able to build from source. It certainly has some bugs in there over large codebases in the UI which I am aware of but does work generally.


This is super cool! Could see myself using this when I'm feeling foggy-brained and want to bash keys until something useful comes up. But I also just love how it looks; nice interactive TUI apps are always a pleasure to use. Good luck getting it stable!


Thank you. It is rather nice to use. The instant feedback is fantastic for code spelunking in my opinion.

The tui is indeed the sticking point and the thing people like the most. I had planned on sticking an embedded HTML page in there as well but that might be a bit much for a first version.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: