Settings

Theme

Psychic: Like fzf but learns from your actions

klauria.tech

54 points by articulatepang · 16 comments

Reader

7 threads
sudahtigabulan

> The paths I selected were about 50 characters away, on average. So I’m typing 3% of that to get there.

Does "50 characters away" mean the paths were 50 characters long?

If yes, the 3% math assumes that, without Psychic, we type every single character. Which I find unrealistic, even ancient shells have features that save typing. Like completion, $CDPATH, aliases, history expansion.

dpz

Is this not just like zoixde https://github.com/ajeetdsouza/zoxide (z) but with ai thrown in?

modinfo

I use atuin is like yours fzf+ml but for ctrl+r, also with fuzzy search, but somehow i like your project, as i started first time (tui) it just take small amount of time to index, even detected my zoxide already! then just works but somehow i don't like if time 'x seconds ago' is updated live, maybe add some config for static time for tui? But great work!

  • articulatepangOP

    (author here)

    Thanks!

    > maybe add some config for static time for tui

    I thought about it and decided you're right: there's no reason for that time to update every second. I changed it to only update once a minute. That way, if someone leaves the TUI open for a while, the times will still be accurate, but it won't be needlessly attention-grabby.

    Pushed to github and started releases on crates and homebrew.

    • pamcake

      If you do every 30s instead, you'll stay mostly within expected precision instead of often being close to a minute off.

  • _doctor_love

    Is atuin worth it? I keep seeing it highlighted but have yet to make the plunge.

    • Zizizizz

      It's so close to fzf it's up to you. It does store per directory command history which can be useful if you hop around a lot. Backs it up as well which can also be useful. I don't use or care about the stats personally

    • hmartin

      yes

eterps

I use fzf for a lot more than selecting files, this seems mostly focused on files and directories?

  • articulatepangOP

    (author here)

    Yes! For now this is just for files and directories. In principle the same idea can be extended to other things people use fzf for, like selecting processes or containers. But one of the reasons I found this works so well is that we can use filesystem metadata as input to the ML model. LightGBM works great on that kind of numerical/tabular data.

    For more general text input, I don't currently have any great ideas for how to make that fast and really good. Transformer models can do prediction on that kind of data, but they're a bit too slow for now.

    I'd love to hear suggestions!

undebuggable

fzf alone is kind of meh, for me fzf-rga in context of a directory gives an enormous productivity boost. Why do I need ML on top of it?

With files and directories it's like with editor tabs. I don't want MRU, I don't want the most popular one, I don't want the sponsored one. I want exactly what I want.

reddit_clone

The site seems down. Can someone post a TLDR? Is this a shell history browser or a souped up 'cd' like zoxide?

  • articulatepangOP

    Oh interesting, it's hosted on Cloudflare so as far as I can tell it's still up. I'll check the logs.

    Here's the github repo: https://github.com/kshitijl/psychic.

    The basic idea is that (quoting from the article): it's a fast terminal-based file browser. It tracks the directories you go to and remembers which files you open. It trains a lightweight ML model on your data and ranks results using that model. It prioritizes interactivity and speed above all else: results update as you type and the UI renders in under 16ms.

    So it shows you a pane of files and dirs, ranked using a model that's specific to you. When you type it updates the results. When you hit enter you go into the dir or open the file.

    Edit: ugh, it seems like Cloudflare's security filters blocked some visitors. Sorry about that! I'll try turning off their Browser Security Check. My website is static so I don't really need it.

ak4153

I don't think that anyone navigates the terminal anymore, people just ask an agent to do that

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection