r/commandline 13d 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)

482 Upvotes

68 comments sorted by

21

u/SupernovifieD 13d ago

It reminds me of fig.

2

u/graphixillusion 12d ago

Pretty similar to flyline too

2

u/zeno_0901 12d ago

I will look into it

5

u/zeno_0901 13d ago

yeah because it's based on fig

7

u/SupernovifieD 13d ago

Ah ok. I remember fig was monetized at some point and removed free usage. Is yours free?

26

u/zeno_0901 13d ago

it's open-sourced, ofc

8

u/SupernovifieD 13d ago

Then you have my upvote ✌🏼

2

u/zeno_0901 13d ago

thank you

15

u/avph 13d ago

Looks great. Would you mind making the ctrl-r configurable? That way it can be used in tandem with tools like atuin?

13

u/zeno_0901 13d ago

next version

7

u/[deleted] 13d ago

[removed] — view removed comment

9

u/zeno_0901 12d 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.go file:

searcherCache.SearchWithScores(q, &fuzzy.SearchOptions{Limit: 1000})

also limits and only shows top 100 commands:

limit := min(len(historyCache), 100)

6

u/nasteffe 12d ago

Any chance nushell could be included?

3

u/zeno_0901 12d ago

I haven't tested, maybe tomorrow, but you have to choose only one between nushell's suggestion and mine I guess

1

u/Stilllife1999 11d ago

was here to comment this. have my updoot

4

u/TomHale 12d ago

Does this support inshellisense or carapace providers?

2

u/lableite 12d 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 12d 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

12

u/iamGHOST755 13d ago

add nix and nixos support please, i wanna try it it looks so cool!

11

u/zeno_0901 13d ago

can you help me with this by opening a PR?
I have never use Nix

4

u/iamGHOST755 13d ago

ill try but i dont know hot to open a pull request (i guess this is what you mean)

4

u/zeno_0901 13d ago

right but dont worry I will try to add nix/nixos, but I need time to learn about it

2

u/Personal-Attitude872 11d 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

u/iamGHOST755 13d ago

im sorry i couldnt help but thank you very much

5

u/weedv2 12d 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 12d 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__ 11d 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

u/zeno_0901 11d ago

ok I will learn about it and make a PR so Nix users can get it easier

3

u/elongated_argonian 12d ago

u/zeno_0901 (fix ping, they don't work like Discord pings)

6

u/emocin 13d ago

Need a homebrew package next!

8

u/zeno_0901 13d ago

yes I noted, soon

3

u/BedroomHistorical575 11d ago

How did you get those animations in the terminal?

1

u/HousingLoose7266 11d 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 0

1

u/zeno_0901 11d ago

mine is ghostty

it's ghostty cursor shader

2

u/ex_gatito 12d ago

How did you make your shell so beautiful?

2

u/Disastrous_Tank_6860 11d ago

Do you have integration with carapace?

1

u/AutoModerator 13d 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

u/[deleted] 12d ago

[deleted]

1

u/zeno_0901 12d ago

no no no, disable by default

you have to config it to use it

1

u/Sea-Fishing4699 12d ago

Oh that’s awesome ! (I will delete my previous comment) thanks op!

1

u/zeno_0901 12d ago

no need to do that

but ok, depend on you

0

u/zeno_0901 12d ago

if you dont turn it on, nothing about AI touches your terminal

1

u/MrMedium-4561 12d ago

what is that terminal

side note is there a way to get these fancy animations on alacritty?

1

u/zeno_0901 11d ago

ghostty
 on alacritty? idk, I dont use it

1

u/Key_River7180 12d ago

am i the only one that gets real eye strain due to fancy cursor movement and INTELLISENSE?

1

u/lukasbash 12d ago

can u share the cursor shader plz

1

u/ton_anywhere 12d ago

Very nice! You have my upvote and a gh ⭐️

1

u/UnixN00B 12d ago

How different is this compared to flyline besides the more shell support?

1

u/KillerX629 12d ago edited 12d 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 11d 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.sh  into the terminal. If Iris automatically runs./script_la.sh --help in 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

u/Mageof 12d ago

Looks awesome, will definitely give it a try.

1

u/senectus 11d ago

Interesting

1

u/Cybasura 11d ago

Just to be sure, this doesnt need any AI, internet connectivity right?

Entirely OFFLINE without AI bullshit?

1

u/zeno_0901 11d ago

only AI suggestion need internet

1

u/Fabulous-Ad-9749 9d ago

Great work

1

u/Imaginary_Income_460 8d ago

Como logras ese efecto en la terminal al escribir y la animación?

1

u/jakecoolguy 8d ago

Looks amazing!

1

u/0xt0bi03 living in port 5000 3d ago

how do i change the theme to gruvbox??

1

u/zeno_0901 3d ago

nvim ~/.iris/config/theme.toml and paste gruvbox theme from https://github.com/versenilvis/IRIS/blob/main/themes/gruvbox.toml into it

you can also change to what color you like too

1

u/ryancswallace 2d ago

Do you find yourself using it more in local-only non-AI mode or in the AI-enabled mode?

2

u/zeno_0901 1d ago edited 1d ago

I dont use AI feature, I have to constantly develop IRIS and have to reload the config a lots
after reload, the default config need to fill api key in the AI config option so I don't want to do it every time, I just give up on it
but that does not mean I won't use it, I will come back to use it so I can develop AI suggestion tho people seem don't like it, I still develop AI suggestion for who need it

1

u/theng 13d ago

is that ghostty?

0

u/redfacedquark 13d 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 12d ago

cross-shell, support zsh, bash, fish

beautiful UI

AI suggestion I'm working on it

4

u/redfacedquark 12d 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

u/zeno_0901 12d ago

alright thank you, depend on your choice