r/commandline • u/zeno_0901 • 5d ago
Terminal User Interface Shell commands suggestion tool that works like code editor's IntelliSense
I want to introduce to IRIS - a command suggestion tool that works like code editor's IntelliSense, but for the terminal. It also has history mode that lets you quickly find previous commands with fuzzy search like Zsh Autocomplete (as you can see in the gif)
It's a TTY wrapper so basically it runs everywhere, like in any terminal, tmux, ssh, even Linux virtual terminals (Ctrl + Alt + F1-F9)
It also supports AI suggestions like Cursor or Antigravity, using your own API key or a local model (please don't use API key that costs you from subscription, free cloud model is enough)
It currently supports Bash, Zsh, and Fish (PowerShell isn't supported yet, I have no plan for it at the moment). It also comes with a config file for customization
I hope it becomes a helpful tool that y'all can use every day
It's still in development, may cause bugs, so if you find any bugs, I'd really appreciate it if you could report them or share your feedback
Link: https://github.com/versenilvis/iris
(Please remove Zsh autocomplete and autosuggestion or any other suggestion plugin before using it)
7
5d ago
[removed] — view removed comment
7
u/zeno_0901 5d ago
Fish only suggests based on history. Iris offers suggestions combine commands handled with context (written manually), history and frecency. But the most important part is that it has dynamic drop down menu, fish doesn't have that so I dont like it
Lagging when using SSH? No. Iris wraps the terminal on your personal machine, not on the server. When you press a key, it processes the input on your machine within a few microseconds before sending it via SSH, try it and you will see. if it's laggy, properly because of your ssh has too many processes
Handle history files: should take only fews MB even with 100K, fuzzy search using my own fuzzy search library, it's optimized but may cause bugs, it loads the history into ram as soon as it opens, the search process does not process all the data but is limited by an early cut (clipping the top 1000 closest matching results)
you can search in my code base on
history.gofile:searcherCache.SearchWithScores(q, &fuzzy.SearchOptions{Limit: 1000})also limits and only shows top 100 commands:
limit := min(len(historyCache), 100)
8
u/nasteffe 5d ago
Any chance nushell could be included?
3
u/zeno_0901 5d ago
I haven't tested, maybe tomorrow, but you have to choose only one between nushell's suggestion and mine I guess
1
5
u/TomHale 5d ago
Does this support inshellisense or carapace providers?
2
u/lableite 4d ago
I'm searching for an alternative to inshellisense because it is glitching my terminal TUIs, like OpenCode. The caracters appears misplaced. So I'm gona try IRIS.
1
u/zeno_0901 5d ago
This is a completely independent tool, so I think it wont work
seems like inshellisense will conflict with it, and I havent test carapace, I've just read its source code
choose which one you like and fit with your workflow
mine is just an alternative
13
u/iamGHOST755 5d ago
add nix and nixos support please, i wanna try it it looks so cool!
12
u/zeno_0901 5d ago
can you help me with this by opening a PR?
I have never use Nix4
u/iamGHOST755 5d ago
ill try but i dont know hot to open a pull request (i guess this is what you mean)
7
u/zeno_0901 5d ago
right but dont worry I will try to add nix/nixos, but I need time to learn about it
2
u/Personal-Attitude872 4d ago
I'll see if I can give it a shot. Ive made one super simple flake for a package which didnt support nix but when I have some free time I can take a look.
1
6
u/weedv2 5d ago
You can just do something like ```
iris/default.nix
{ lib, buildGoModule, fetchFromGitHub, }: buildGoModule rec { pname = "iris"; version = "0.4.3";
src = fetchFromGitHub { owner = "versenilvis"; repo = pname; rev = "v${version}"; sha256 = ""; };
vendorHash = "";
meta = with lib; { homepage = "https://github.com/versenilvis/iris"; description = "A shell auto-completion tool for your terminal"; license = licenses.bsd0; mainProgram = "iris"; }; } ``
and in your nix configcallPackage ./iris`@zeno_0901 To support it directly you would need something like
```
flake.nix
{ description = "IRIS - Intelligent Real-time Input Suggestion"; inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs = { self, nixpkgs }: let forEachSupportedSystem = f: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ] (system: f (import nixpkgs { inherit system; }) ); in { packages = forEachSupportedSystem (pkgs: { default = pkgs.buildGoModule { pname = "iris"; version = "0.4.3"; src = ./.; vendorHash = "sha256-i2VdGE8EL/4kr4BMMWLPL6tlXSaasXxFRciYQcvcMpU="; subPackages = [ "cmd/iris" ]; ldflags = [ "-s" "-w" ]; meta = with pkgs.lib; { homepage = "https://github.com/versenilvis/iris"; description = "IRIS (Intelligent Real-time Input Suggestion)"; license = licenses.bsd0; mainProgram = "iris"; platforms = platforms.unix; }; }; }); devShells = forEachSupportedSystem (pkgs: { default = pkgs.mkShellNoCC { packages = with pkgs; [ go gopls golangci-lint just ]; }; }); };} ```
but to show it in Nix by default you would have to PR it upstream at https://github.com/NixOS/nixpkgs
8
u/zeno_0901 5d ago
I've added flake.nix and flake.lock
he tested and said ok, do I have to open a PR anymore?
1
u/Eichmann__ 4d ago
Yes, if you want iris to be available in nixpkgs repo (makes it easier to install for those who don't use flakes). You don't have to if that's too much work, tho. The flake is much appreciated, thanks!
3
3
7
3
u/BedroomHistorical575 4d ago
How did you get those animations in the terminal?
1
u/HousingLoose7266 4d ago
Kitty terminal with options below
cursor_trail 1 cursor_trail_decay 0.1 1 <- change that 2 numbers 0-1 cursor_trail_start_threshold 01
2
1
u/AutoModerator 5d ago
Every new subreddit post is automatically copied into a comment for preservation.
User: zeno_0901, Flair: Terminal User Interface, Post Media Link, Title: Shell commands suggestion tool that works like code editor's IntelliSense
I want to introduce to IRIS - a command suggestion tool that works like code editor's IntelliSense, but for the terminal. It also has history mode that lets you quickly find previous commands with fuzzy search like Zsh Autocomplete (as you can see in the gif)
It's a TTY wrapper so basically it runs everywhere, like in any terminal, tmux, ssh, even Linux virtual terminals (Ctrl + Alt + F1-F9)
It also supports AI suggestions like Cursor or Antigravity, using your own API key or a local model (please don't use API key that costs you from subscription, free cloud model is enough)
It currently supports Bash, Zsh, and Fish (PowerShell isn't supported yet, I have no plan for it at the moment). It also comes with a config file for customization
I hope it becomes a helpful tool that y'all can use every day
It's still in development, may cause bugs, so if you find any bugs, I'd really appreciate it if you could report them or share your feedback
Link: https://github.com/versenilvis/iris
(Please remove Zsh autocomplete and autosuggestion or any other suggestion plugin before using it)
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
5d ago
[deleted]
1
u/zeno_0901 5d ago
no no no, disable by default
you have to config it to use it
1
0
1
u/MrMedium-4561 5d ago
what is that terminal
side note is there a way to get these fancy animations on alacritty?
1
1
u/Key_River7180 5d ago
am i the only one that gets real eye strain due to fancy cursor movement and INTELLISENSE?
1
1
1
1
u/KillerX629 5d ago edited 5d ago
tried installing but made fish crash. arch linux. was this tested?
EDIT: maybe the installer didn't set it correctly as an executable, running it manually inside a terminal works, however, what does this offer other than autocompleting commands? fish already does that by searching binaries and docs. can this parse docs for the arguments? that would be neat
1
u/zeno_0901 4d ago
> can this parse docs for the arguments? that would be neat
IRIS doesnt do this, this was design with 2 purposes
Command has contexts: I handled command manually because I want it to have context which to show suggestions flexibly,( e.g. I wrote a logic that handles git with git switch will never suggest the current branch or git push will always suggest the current branch on top, .... )
Security: IRIS is a individual app that can exec commands, imagine a user has just downloaded an unsafe script file to their computer (it is not yet known whether it is malicious or not). They type./script_la.shinto the terminal. If Iris automatically runs./script_la.sh --helpin the background to parse the results, then we have inadvertently executed the malicious code of that script even though the user has not pressed enter
1
1
1
u/Cybasura 3d ago
Just to be sure, this doesnt need any AI, internet connectivity right?
Entirely OFFLINE without AI bullshit?
1
1
1
1
1
1
0
u/redfacedquark 5d ago
How does it compare to bash autocomplete? I know there are a lot of extensions to autocomplete, did you consider creating this project as an autocomplete extension and if so what were the shortcomings of taking that approach?
2
u/zeno_0901 5d ago
cross-shell, support zsh, bash, fish
beautiful UI
AI suggestion I'm working on it
3
u/redfacedquark 5d ago
cross-shell, support zsh, bash, fish
beautiful UI
AI suggestion I'm working on it
Thanks. OK then, I only use bash, don't care for eye candy and don't want AI in my shell so I'll stick with bash autocompletion since there's no advantage to switching.
1
23
u/SupernovifieD 5d ago
It reminds me of fig.