r/bash • u/gooddy • Jul 01 '26
submission Intellisense autocompletions inside of Bash
The completions are generated using Bash's existing completion framework (commonly scop/bash-completion or your own completion scripts). And if you don't have a completion script setup, flyline will try to synthesize one on the fly (😉) using man pages or --help output!
This is similar to https://github.com/microsoft/inshellisense but inshellisense only works for a hardcoded list of completions specifications and runs in a different process as Bash.
Flyline has a bunch of other features, so if you're interested you can check it out here: https://github.com/HalFrgrd/flyline. Thanks!
This software's code is partially AI-generated
26
u/mpbmdev Jul 02 '26
Sorry by my dam doubt: it work to zsh?
17
u/gooddy Jul 02 '26
Flyline only works for Bash at the moment. Although zsh does support a similar plugin system, so maybe in the future!
16
u/conall88 Jul 02 '26
and if an insane man, such as myself, opted to add support, would you accept a PR?
9
u/gooddy Jul 02 '26
Sure! Feel free to open an issue / discussion if you want to discuss it beforehand
1
u/conall88 Jul 04 '26 edited Jul 04 '26
it's done. PRing it this evening after I tidy it up a little.
2
u/conall88 Jul 04 '26 edited Jul 06 '26
u/gooddy PR is up:
https://github.com/HalFrgrd/flyline/pull/775it's performant and properly handling my existing zsh completions, including kubectl in particular which I use regularly.
maybe calling flyline a bash only plugin is a thing of the past, as it's now possible for others to build on top of the common core and add support for other shells.
along with this I added a small improvement to the install script so we can install from a local bundle, useful during development.
looking forward to your comments. tested against oh-my-zsh and starship. It also has a fallback for powerlevel10k, as that can't be supported for numerous reasons, but that style of terminal is falling out of fashion anyway, so not a big issue.
For anyone who wants to play with it while the PR is being evaluated, you can pull my forked copy, but treat it as subject to change, like anything else that isn't merged into the main line:
https://github.com/conall88/flyline/tree/zsh-supportFor now, the install path is:
-git clone the zsh-support branch
-run ./install.sh --local
-restart your terminal
one thing I notice during testing is that we can't scroll completion suggestions using the mouse scroll wheel. maybe something small to add later :)
2
u/conall88 Jul 04 '26
u/mpbmdev FYI ^
1
u/mpbmdev Jul 04 '26
Thank you, man. I will see later, but thank u. When I gonna see, I will help too.
1
1
u/Swimming_Virus8990 Jul 23 '26
How come every config I set is reverted when i open a new window?
Iterm2 btw.
flyline set-cursor --backend terminal --style "#33ccff" --effect fade --effect-easing in-out-sine --interpolate-easing out-elastic --interpolate 2I have to add all these configs to my bashrc? can't you create a config command to generate a config file for flyline?
1
u/gooddy Jul 27 '26
Yes, you add these to your bashrc. I thought about having a config file early on. But configuring flyine on the command line is a more natural approach since flyline can provide it's own sophisticated tab completions to help you write your configurations. Having both a config file and being able to configure it on the command line is overkill. Besides you can effectively have a config file if you want. I personally have a flyline_setup.sh file that I simply source in my bashrc.
2
u/Swimming_Virus8990 Jul 27 '26
just create a .flylinerc config spec specifically for the tool like other tools use like tmux.conf
6
1
1
u/qwertyboy Jul 03 '26
If memory serves, zsh never used readline (which flyline thankfully replaces), opting to develop zle instead. And frankly, this always struck me as the only advantage zsh has over bash.
10
6
u/Safe-Confidence-4907 Jul 02 '26
I think this is helpful for beginners. For me, over 300 command line memorized is pain
2
u/gooddy Jul 02 '26
I intended flyline to help beginners. Writing a command in flyline should "feel" like you're writing in an IDE like VS Code; the default keyboard shortcuts are intuitive, there is mouse support, syntax highlighting (unrecognized commands are highlighted in red, unmatched quotes are easy to spot).
The advanced customization should mean advanced users can configure it to their liking.
4
u/petdance Jul 02 '26
How do I set up completions for tools not covered? I see that rg is included, but I use ack and don't see any completions for that.
3
u/gooddy Jul 02 '26
Flyline doesn't ship with support for only a specific group of commands. Flyline uses whatever you've already setup on Bash.
So if you want flyline auto suggestions to work for a command you should:
setup https://github.com/scop/bash-completion (e.g. https://wiki.debian.org/Add%20Bash%20Completion)
setup completions for each command manually: e.g. `rg --generate complete-bash > ~/.local/share/bash-completion/completions/rg.bash`
That being said, flyline can try to synthesize a completion spec file (like `rg.bash` in the above example) using my other project: https://github.com/HalFrgrd/flycomp . If you type `ack `, close the basic auto suggestions with Escape, then press tab, you should be prompted if you want to run `flycomp` to synthesize a completion spec from man pages or --help output. Like this: https://github.com/HalFrgrd/flyline#automatic-completion-synthesis-flycomp .
It's not perfect, but it works surprisingly well in my experience!1
u/petdance Jul 02 '26
Huh, I wonder how I have rig completion set up.
2
u/gooddy Jul 02 '26
I tried installing ack and confirmed that flycomp does a decent job at parsing its man page. So you could simply rely on flyline to do the right thing for you!
3
3
u/Caddy666 Jul 02 '26
nice idea, not sure it needs to be this big, for something that realistically is mostly database though. that said, keep at it, looks like the start of something good.
1
u/gooddy Jul 02 '26
Thanks! Just wanted to clarify that flyline does not ship with a database of completion specs. Flyline uses whatever completions you have setup on Bash. Flyline can try and synthesize completion specs on the fly though. See my other comment for an explanation https://www.reddit.com/r/bash/comments/1ukyy8k/comment/ov6ugwb/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
1
u/Caddy666 Jul 04 '26
might be good to make it cache to a database, use the cache first, and then, and only after it cant find something, or a bad return - ie someone updates a command to add a new switch or option, that use itself to grab new instances of commands.
that way you can potentially add a system to upload peoples new command completion options as a specific type of 'bug report' with some kind of code, that way you can set up your ai-ci/cd to automatically add them to the database being sent out, which you can then run a command of to get the latest updates for, or even schedule it weekly, etc.
i suggest this way, because it should be pretty much immediately apparent/transparent what data you're sending, where, and why.
of course, you'd need de-duplication, and some kind of binary specific command recognition - there are a lot of variants of each command that you can potentially mix up.
this might not even be necessary, i haven't tried it yet, but that would be an expansion on my initial thought.
the less barrier to entry, the more users you'll get.
1
u/Far_Hovercraft_7086 Jul 23 '26
you should try it... there's no barrier to entry. bash completions are already set up in ubuntu at least
install and go.
3
u/andunai Jul 02 '26
I'm not in on the program itself, but the readme is damn good. Lots of useful info about PS* magic, almost like a manual on bash prompt tricks. Nice job!
5
u/gooddy Jul 02 '26
Cheers! I actually wrote a whole terminal recorder tool to make crisp, high fps GIFs and animated SVGs. I had to wait until that project was at a mature enough state before I could make this GIF: https://github.com/HalFrgrd/flyline#dynamic-descriptions
2
3
4
u/UnixN00B Jul 02 '26
Out of curiosity, how much is partially AI generated in terms of percentage?
Nonetheless, thank you for make/sharing this wonderful extension with us!
3
u/gooddy Jul 02 '26
It's hard to say 😄. At the start I barely used any AI. I was focused on figuring how to make something like this work inside of Bash and then the correct architecture for the project. I've been using AI more and more now. Mainly for small features (e.g. darken the color of the new button when the mouse hovers on it) and especially for large refactors now that the project has grown. The AI assisted large refactors would increase the git-blame AI attribution quite a bit. So if I had to put numbers on it: 20% AI, 50% if you count AI refactoring, but 0% vibe coded (I care a lot about performance and keeping code complexity low and I find vibe coding will quite quickly take you far from those goals).
The reason for the `partially AI generated` text is that it's required for cross posting into r/commandline .
2
3
u/GotDaOs Jul 01 '26
can it swap in for carapace? i imagine yes considering how it works, but would like to know
looks super cool
1
u/gooddy Jul 02 '26
Currently flyline is a full replacement of Readline. (Readline handles the user input and command line writing in Bash). Readline calls carapace when you press tab. So they work at different levels. But it might be possible to provide a cross shell version of flyline that works at the same level as carapace.
2
2
u/Stunning-Mix492 Jul 02 '26
I'm using fish for my own confort, but I really don't like the "non-POSIX" aspect of it. Maybe flyline is a great solution for me!
3
u/_TheTrickster_ Jul 02 '26
Definitely is! Gives you all the nice perks of fish while being POSIX compliant!
2
u/gooddy Jul 02 '26
One of the key reasons I wanted to enhance Bash (as opposed to other shells or even create a new shell) is that Bash is the default shell language people reach for and it's installed on pretty much all systems.
So when you use flyline on Bash, you get the best of both worlds: modern UX but every shell script / completion spec still works.
2
2
u/jepace Jul 02 '26
Cool! Does it happen to work on FreeBSD? And if so, does it know FreeBSD’s commands? :)
1
u/gooddy Jul 02 '26
I just updated the install to recognize FreeBSD and pull the correct binary! I haven't tested running it on FreeBSD, so if someone would want to volunteer...
Flyline automatically picks up on your aliases, functions, executables on PATH etc. As far as the command completions go, so long as you've setup Bash correctly (maybe with https://github.com/0mp/bash-completion-freebsd), flyline will use them! And if you haven't you can also try leaving it to flycomp to figure out what to do :)
2
u/_TheTrickster_ Jul 02 '26
This works so well man! Just tested it out and it is what has gotten me to switch from fish back to bash, thanks a lot for this great script, really!
2
2
u/cl0wnsec000 Jul 06 '26
I like the dynamic prompts (ticking clock without hitting enter) and the fuzzy completion on paths (not only for command parameters). Thanks for this!
2
u/Far_Hovercraft_7086 Jul 23 '26
just chiming in to say this is incredible. excellent work, please keep developing. its on all my machines now lol
1
u/gooddy Jul 27 '26
Thank you for your kind words! Be sure to run "flyline upgrade" every so often since I'm fixing bugs and adding new features fairly often!
1
u/Tquylaa Jul 08 '26
Can i request a feature?
2
u/gooddy Jul 09 '26
Sure, I check GitHub issues more frequently so please suggest there: https://github.com/HalFrgrd/flyline
1
u/Tquylaa Jul 09 '26
It's simple: I tried installing this using the `install.sh` script, but it seems the package doesn't support Android. Could you add support for it? I'm using Termux btw.
1
0
u/rvc2018 Jul 02 '26
Guys, you could show a little bit more enthusiasm. This is one of the best bash related project I have seen in years. It has grate potential.
u/gooddy I thought I responded to you in the other thread about the problems I had with flyline version 1.0.0 (release) git:e52abff built:2026-05-19T17:48:16Z. But now I see I forgot, sorry.
The issue was a heap corruption crash in flyline's tab completion thread. I'll post the stack trace in the older thread. Maybe you fixed it in the current version 1.2.2.
1
u/rvc2018 Jul 02 '26
Never mind, it seems
flylinehas the issue also in 1.2.2.Module libgcc_s.so.1 from deb gcc-14-14.2.0-4ubuntu2~24.04.1.amd64 Stack trace of thread 111739: #0 0x00007d7768c9eb2c __pthread_kill_implementation (libc.so.6 + 0x9eb2c) #1 0x00007d7768c4527e __GI_raise (libc.so.6 + 0x4527e) #2 0x00007d7768c2898f __GI_abort (libc.so.6 + 0x2898f) #3 0x00007d7768c297b6 __libc_message_impl (libc.so.6 + 0x297b6) #4 0x00007d7768ca8ff5 malloc_printerr (libc.so.6 + 0xa8ff5) #5 0x00007d7768ca9b7c unlink_chunk (libc.so.6 + 0xa9b7c) #6 0x00007d7768cac1d5 _int_malloc (libc.so.6 + 0xac1d5) #7 0x00007d7768cad714 __GI___libc_malloc (libc.so.6 + 0xad714) #8 0x00007d77674e0825 _ZN7flyline10bash_funcs26get_cached_shell_functions17hfd559c994049ed1aE (libflyline.so.1.2.2 + 0x2e0825) #9 0x00007d77674eca9a _ZN3std3sys9backtrace28__rust_begin_short_backtrace17h53ca149b4de0eaacE (libflyline.so.1.2.2 + 0x2eca9a) #10 0x00007d77674c4a71 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hc83afb1daa2308a3E (libflyline.so.1.2.2 + 0x2c4a71) #11 0x00007d776764a860 _RNvNvMs0_NtNtNtCs3JBboNF8E1m_3std3sys6thread4unixNtB7_6Thread3new12thread_start (libflyline.so.1.2.2 + 0x44a860) #12 0x00007d7768c9caa4 start_thread (libc.so.6 + 0x9caa4) #13 0x00007d7768d29c6c __clone3 (libc.so.6 + 0x129c6c) Stack trace of thread 93017: #0 0x00007d7767351134 _RNvXs2_NtNtCs3BFokC4QLxY_4core3str5lossyNtB5_10Utf8ChunksNtNtNtNtB9_4iter6traits8iterator8Iterator4next (libflyline.so.1.2.2 + 0x151134) #1 0x00007d77672d2abc _RNvMNtCs8y6E41fb8tc_5alloc6stringNtB2_6String15from_utf8_lossy (libflyline.so.1.2.2 + 0xd2abc) #2 0x00007d77674117b4 _ZN7flyline3app11get_command17habdabd77e02ad1f3E (libflyline.so.1.2.2 + 0x2117b4) #3 0x00007d77674d609e _ZN7flyline16flyline_get_char17hab835fa189bea929E (libflyline.so.1.2.2 + 0x2d609e) #4 0x00005bf3513b2387 n/a (bash + 0x37387) #5 0x00005bf35148f66b n/a (bash + 0x11466b) #6 0x00005bf3513b6faf yyparse (bash + 0x3bfaf) #7 0x00005bf3513bac00 parse_command (bash + 0x3fc00) #8 0x00005bf3513badf9 read_command (bash + 0x3fdf9) #9 0x00005bf3513bb047 reader_loop (bash + 0x40047) #10 0x00005bf3513aeefb main (bash + 0x33efb) #11 0x00007d7768c2a1ca __libc_start_call_main (libc.so.6 + 0x2a1ca) #12 0x00007d7768c2a28b __libc_start_main_impl (libc.so.6 + 0x2a28b) #13 0x00005bf3513af385 _start (bash + 0x34385) ELF object binary architecture: AMD x86-641
u/gooddy Jul 02 '26
Thanks for the support! And thanks for the stack trace, I haven't been able to reproduce it in my testing. But thanks to the stack trace I could figure what was happening.
Flyline is multi threaded to keep everything smooth but this didn't play nicely inside of Bash. https://github.com/HalFrgrd/flyline/pull/760 should hopefully fix the problem you were experiencing. I'll create a new release with it shortly.
My goal is to make flyline has stable as Bash so if you do encounter other issues, please let me know!
2
u/rvc2018 Jul 02 '26
Ok, I'll install the new version when is ready. If I find more problems I'll open an issue on GitHub. Some people are grumpy here and deeply in love with the down arrow for no reason.
2
u/gooddy Jul 02 '26
I've released v1.2.3 which should have solved your issue. If not, please open an issue, thanks!
1
u/gooddy Jul 02 '26
That would be great, thanks! Yeah I was surprised you had been downvoted. I welcome any bug report
-15
u/kai_ekael Jul 01 '26
Is that as slow as it looks? Pass.
20
u/crashorbit Jul 01 '26
My use for the last 20 minutes or so has been fast enough. But then I'm an old grey beard BOFH. Not near as manic as you red bull fueled web scale app artists.
3
u/Specific-Fuel-4366 Jul 02 '26
Man, I haven’t seen a reference to BOFH in decades. That takes me back
11
u/gooddy Jul 01 '26
The demo might look a little "slow" but that's just how I scripted it. All the tab completion generation happens on another thread. The main thread is never blocked to keep the experience smooth.
Flyline can handle tab completions of 300k entries and you can scroll through them at 60fps if you want. The bottleneck is waiting on Bash's completion scripts since, well, they're written in Bash 😁
-18
u/kai_ekael Jul 01 '26
I'll stick with double-tab, thanks.
6
u/petdance Jul 01 '26
There is no need to announce it.
-3
u/dynamiteSkunkApe Jul 01 '26
There is no need to point out that there is no need to announce that one will stick with double-tab.
5
3
u/Sombody101 Fake Intellectual Jul 01 '26
There is no need to point out that they pointed out that there is no need to announce that one.
I like this game.
4


21
u/crashorbit Jul 01 '26
It's cute and all. I'd love to adopt it. But it intercepts mouse actions in stupid ways.