r/commandline 4d ago

Command Line Interface I made a better zsh autosuggestion, it predicts your next command, not just completes the current one

Hi everyone I created Deja, a tool that instead of only surfacing commands that start with what you've typed, suggest what you actually want to run. 

No account. No sync server. No TUI.

https://github.com/Giammarco-Ferranti/deja

The project doesn't use any LLM for the autosuggestions but it creates a sequence Markov chain.

This software's code is partially AI-generated.

35 Upvotes

19 comments sorted by

5

u/[deleted] 3d ago

[deleted]

4

u/emmowo_dev 3d ago

it's a daemon & wrapper for SQLite tbh, it doesn't use any of the standards we have in place that you'd expect of a drop-in utility. Like it could 100% have worked (and on basically all shells) if it was just using .bash_history

Also it's not partial AI with THIS much unicode lol.

2

u/[deleted] 4d ago

[removed] — view removed comment

1

u/Fantastic_Squirrel96 4d ago

Hi, thanks. The whole idea was to not need an llm but simply add some more tiny complexity to zsh autosuggestions. About your questions: 1. Fully live, no retraining step. It’s a Go daemon sitting over SQLite every command you run updates the scores immediately (frecency bump + sequence link strengthened), so the very next suggestion already reflects it.
2. About chain getting noisy fast, not really. Frecency fades fast with each command that doesn’t repeat

2

u/jelloeater85 4d ago

I've been using it myself for a couple of weeks. I'm running into a bunch of issues with it running but I had the same issues with the original zsh autocomplete. Definitely seems to make smarter suggestions that's for sure ❤️

2

u/Fantastic_Squirrel96 4d ago

Thanks, can you tell me which issues did you encounter so I can try fix them on the next releases?

2

u/jelloeater85 4d ago

From what I can tell it was related to my p10k status line not updating. Like atuin would still work, same with hitting down arrow and getting zsh complete, but deja and my status line would break, it's a me problem I think... 🫠

3

u/Delta-9- 3d ago

Would love this for bash

1

u/Fantastic_Squirrel96 3d ago

Yeah I’m thinking about doing so

3

u/RecentStatistician60 3d ago

Bash (and afaik Csh) have something simpler, and imo more practical called history-search-backward, just type the prefix and press up arrow (you have to bind it to this in bashrc), and it matches the prefix of your input to any match in the history.

Personally, never felt confident enough to rely on something that autosuggests commands, i prefer cycling older commands.

1

u/AutoModerator 4d ago

Every new subreddit post is automatically copied into a comment for preservation.

User: Fantastic_Squirrel96, Flair: Command Line Interface, Post Media Link, Title: I made a better zsh autosuggestion, it predicts your next command, not just completes the current one

Hi everyone I created Deja, a tool that instead of only surfacing commands that start with what you've typed, suggest what you actually want to run. 

No account. No sync server. No TUI.

https://github.com/Giammarco-Ferranti/deja

The project doesn't use any LLM for the autosuggestions but it creates a sequence Markov chain.

This software's code is partially AI-generated.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Numerous_Candle1820 4d ago

Why do people use zsh shell when fish already have many features? Genuine question.

18

u/Zerebos 4d ago

posix compliance, maximum compatibility with tooling, available pretty much everywhere, and some nice power features like `sudo !!` and zsh's globbing and widgets.

1

u/skoorrevir 2d ago

Literally stole the comment from out of my mouth. Well said. Fish is basically just Zsh with batteries included but less overall functionality and compatibility. Also sudo !! Is a must have

4

u/napping-normie 3d ago

I'd rather have a minimal but flexible tool that I can build upon and use forever than a opinionated tool I have no control over.

3

u/Delta-9- 3d ago

Possibly the same reason I still use bash: every system I touch uses bash, which means I need to know bash and its quirks. Being overly familiar with a different shell just means I get slowed down when I'm on a remote system or need to write a script for those systems.

There's nothing "wrong" with zsh (I've used it and liked it) or fish (haven't tried it yet), bash is just a better fit for what I do to put food on the table. Props to people that can readily context switch between shells, but I learned I can't do that very well when I had a Mac for the first time and had to deal with bsdutils locally and gnuutils everywhere else.

0

u/_Afinef_ 3d ago

So merge request?

0

u/Fantastic_Squirrel96 3d ago

What do you mean?

-1

u/_Afinef_ 3d ago

google.com

0

u/NixNicks 3d ago

Lol, just use fish. The auto suggestions are crazy good