10 ms·
Show HN: Inshellisense – IDE style shell autocomplete
I built this terminal native runtime for Fig's autocomplete to support Windows and Linux. Would appreciate any feedback on it!
- 100k 3y agoThe name is terrific.
- exikyut 3y agoThe fact that it's coming from Microsoft is even crazier, because obviously you know they had to go through clearance - and made it. I half wonder if the author checked the name first, then started coding......
- keyle 3y agoI picture the first slide of the deck breaking the name down "in shell intellisense" and people nodding at the back...
- rewgs 3y agoFirst good name to ever come out of Microsoft. I'm sure it just barely succeeded over Visual Windows Subsystem for IntelliSense Core.
- Y_Y 3y agoYa, cool name, but worse privacy than gorilla, more awkward than llm.sh and why would I ever get the Microsoft version of something I can get elsewhere without the worry that I'm about to be devoured by a corporate anglerfish.
- smoldesu 3y agoDid you check the page? It's MIT-licensed and isn't about GPT or text generation. It's Intellisense, for the shell.
- hui-zheng 3y agothen what makes it better than withfig/autocomplete?
- boxed 3y agoI downloaded fig, then immediately deleted it after it requested way too much access to my github account to even start. So... that's a big thing.
- deleted 3y ago[deleted]
- all2 3y agoAnd this will deter me from ~~ever~~ trying Fig. :/
- cantSpellSober 3y ago> it requested way too much access to my github account Can you be more specific? Been a while since I installed it but I don't remember this part. It's not even listed as an "Authorized GitHub App"
- wrs 3y agoThat’s what it’s based on.
- Timon3 3y agoIt's available for Linux and Windows.
- strbean 3y agoIt is withfig/autocomplete. The only difference from their runtime is that this gives results directly in the console, instead of using a graphical overlay. I believe that means you could use this in an SSH session.
- deleted 3y ago[deleted]
- monkellipse 3y agoGreat idea! Also terrifying :) Given how often I accidentally commit the wrong text in vscode, I shudder to think of the damage I could do with this on my shell, hah! What safety measures are there/could there be?
- biellls 3y agoA simple approach might be that if the resulting exit code is not 0 it won't be used to complete in the future.
- Eavolution 3y agoThat'd have the problem of tools like grep returning nothing, having an exit code of 1, but being a perfectly valid thing to suggest in the future.
- starttoaster 3y agoWhen you're writing, building, and executing code, I would not expect a 0 exit code every time.
- KRAKRISMOTT 3y agoThe fish approach
- owlstuffing 3y agoGenerally, a destructive shell command prompts for approval. But I suppose overfumbly fingers could still cause grief. Type/command aware tooling is a night and day difference.
- mksybr 3y agoGenerally? Do you have examples in mind? The ones I think of are destroy first and ask questions only if told to do so: mv cp rm redirection tee
- owlstuffing 3y ago
- guessmyname 3y agoI wish they had written inShellisense in a more efficient programming language than TypeScript. I recall disabling bash_completion.sh on my computer some time ago due to its negative impact on the startup speed of each iTerm2 session and the delay it introduced when using the <TAB> key for autocompletion. Before I disabled this feature, I consistently experienced delays of over 300ms between triggering autocomplete and receiving the actual results. I must admit that this was on an Intel Core i7, so I assume the performance is much better with newer processors. However, even after more than two years without bash_completion.sh, I have already committed many command line tool flags to memory so I would only consider using a tool written in a compiled programming language that can provide autocomplete in 100ms or less, potentially requiring the inclusion of hardcoded information in the binary.
- deleted 3y ago[deleted]
- explaininjs 3y agoDon’t bring TypeScript into this. It is very possible to write sub 100ms procedures in TS, but an inelegant algorithm will be slow in any language, eventually.
- cassianoleal 3y ago100ms is a long time to wait for each completion suggestion.
- nu11ptr 3y agoI was going to say the same thing. In what world is 100ms fast on a computer? (for something not making a network round trip)
- explaininjs 3y agoThe claim isn’t that 100ms is fast, it’s that the blame for the latency lies in the engineering, not the language.
- HomeDeLaPot 3y agoAwesome! And it supports fish! Just the other day, I was wishing we had something like this.
- Night_Thastus 3y agoI'd be curious how this compares with Fish, which has autocomplete as well. It's worked fantastic for me so far. Once you have it, it's hard to go back!
- boxed 3y agoThis looks much cooler than fish autocompletes imo. But this replaces the nice fish stuff with `>` as a prompt, so I'll stick with fish.
- schmorptron 3y agoThe readme for this project states that it supports fish, does it replace the prompt?
- boxed 3y agoYep. I have no idea what "supports fish" means here. From what I can tell you start it and now you're in a totally different shell.
- deleted 3y ago[deleted]
- boxed 3y agoI wish I had something like this without it replacing the shell prompt with `>`.
- deleted 3y ago[deleted]
- all2 3y agoI'd guess you could source it and then override the PS1 env variable with whatever prompt formatting you wanted.
- filterfiber 3y agoIs this fully local? I glanced around and didn't see any mention of chatgpt/gpt/codex so I'm thinking it is?
- trey-jones 3y agoThere is really not much code to speak of, and a quick perusal didn't yield anything sus. Initial guess is that it's not very efficient, but I really didn't look that closely.
- dclowd9901 3y agoAutocomplete is fast but I/O is really crummy.
- Dudester230602 3y ago1980s... but like 2020s-style. Coming next: auto-complete for punch cards.
- leshenka 3y agocan you expand on this?
- askiiart 3y agoI think they meant "using the terminal (1980s)... but like 2020s-style (intellisense)" Y'know, because it's not like tons of people use the terminal on a daily basis in the modern era. /s
- Dudester230602 3y agoYeah, they claim because it's better but the reality is that they simply cannot build good cross-platform UIs on a budget / on time.
- deleted 3y ago[deleted]
- dang 3y agoCould you please stop posting unsubstantive comments and flamebait? You've unfortunately been doing it repeatedly. It's not what this site is for, and destroys what it is for. If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.
- mschrage 3y agoCo-founder of Fig here! Just want to say that I think this is awesome. It’s really cool to see alternative implementations of IDE-style autocomplete in the terminal. Nice work!
- trey-jones 3y agoI'm pretty sure this is just a wrapper for Fig.
- evilduck 3y agohttps://github.com/microsoft/inshellisense/blob/main/package.json#L36 https://github.com/microsoft/inshellisense/blob/main/package...
- alexlur 3y agoA wrapper for Fig that doesn’t require me to create an account in order to use my terminal. I’d say it’s a good thing.
- vladoski 3y agoalso because you cannot even create an account on Fig nowadays since the signups are currently disabled
- deleted 3y ago[deleted]
- curiousgal 3y agoLooking at the main author's gorhub profile, they forker Fig's repo.
- nextaccountic 3y agohttps://github.com/withfig/autocomplete https://github.com/withfig/autocomplete is it this?
- shrimpx 3y ago
- xnx 3y agoStarting to type "dir": "d[el /q /s .]" (press any key to accept)
- bestest 3y agook. can someone explain to me. I've been using ctrl+r for god knows how long and it solves all my shell completion needs. is inshellisense for average users like me or more advanced users?
- deleted 3y ago[deleted]
- serial_dev 3y agoI use zsh plugin, autosuggests, and ctrl r, too. Ctrl r is okay and it is a very convenient if you already typed the command. Inshellisense seems to help with knowing what subcommands, flags and file paths are available, and it even provides a small docs helper for the flags and commands. If you didn't try these tools, I'd encourage you take a look, it helped me a lot, especially when I work with tools whose commands I don't know by heart or used a while ago.
- fostware 3y agoIf you're more used to ctrl+r, you could try hiSHtory (https://github.com/ddworken/hishtory https://github.com/ddworken/hishtory)
- jss326 3y agoI get this error on zsh: Unsupported shell: '', supported shells: bash, powershell, pwsh, zsh, fish
- dclowd9901 3y agoYou need to run it with the —shell flag and provide “zsh” as the value
- jss326 3y agoThanks, that worked
- k8svet 3y agoBeyond the not-using-typescript for CLI tooling difference, it would be interesting for a comparison against carapace-bin, another shell agnostic completer: https://github.com/rsteube/carapace-bin https://github.com/rsteube/carapace-bin (written in Go, since this thread includes other discussion about the choice of typescript for Inshellisense). From a quick peek, carapace-bin supports more shells (including and powering the one I use, nushell).
- mongol 3y agoKnowing it is go I like it better already. Anything that does not require a runtime gets a head start in my book.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- ilc 3y agoFor those who haven't read the code: This reuses Fig.io's internal completion engine to actually get the job done. Because of that, it forces the language choice of Typescript, and the heavy lift is done by Fig's engine. I hope the OP continues with the work and improves it. I was looking forward to trying Fig on Linux. This sounds like a step towards that.
- jameslk 3y agoThis looks awesome! Is the next step something like a Copilot integration? There’s Copilot CLI coming soon[0] but I think something that autocompletes would feel more natural most of the time. 0. https://githubnext.com/projects/copilot-cli https://githubnext.com/projects/copilot-cli
- orliesaurus 3y agoi use warp's terminal and i love it, but I think im gonna love this more because its OSS
- pbbakkum 3y agoIf you're interested in GPT-powered shell autocomplete, check out https://butterfi.sh https://butterfi.sh This also enables shell-aware LLM prompting!
- efitz 3y agoSo I have to take a shell dependency on Node.js? Hard pass
- preciousoo 3y agoMaybe the users don’t care about their devices
- creatonez 3y agoI don't mind it, it's just another runtime that works on Linux and BSD. I have my neovim infected with extensions made in Node.js, Python, Lua, my weechat is infected with extensions made in Python, Perl, Node.js, and my zsh is infected with extensions with components made in Rust, C, and Python. Just make sure to pay attention to shell start times and RAM usage.
- pelagicAustral 3y agoHaha, I though the same... > npm install NEXT!
- kermatt 3y agoIDE style shell autocomplete for JavaScript or TypeScript programers Because otherwise requiring `npm` as a package manager for those of us who don't develop in either is silly. (Yes, I know npm also implies JavaScript as a runtime environment, still nope)
- deleted 3y ago[deleted]
- dolmen 3y agoThe implementation has obviously never been run on a Unix/Linux: * shell config is created with CRLF https://github.com/microsoft/inshellisense/issues/8 https://github.com/microsoft/inshellisense/issues/8 * changing directory doesn't work https://github.com/microsoft/inshellisense/issues/5 https://github.com/microsoft/inshellisense/issues/5
- suavesito 3y agoIt doesn't work on Windows either... at least by a comment in the issue. I don't have Windows.
- white_dragon88 3y ago[dead]
- egKYzyXeIL 3y agoTake your toxicity elsewhere, this is no place for this kind of comment.
- chrysoprace 3y agoIt's pretty cool but still seems a little rough around the edges. My simple test case was to launch into the shell and see if it loaded any of my normal shell configs like highlighting or auto-suggestions (based on my history) but it seems to just be its own shell entirely. It also doesn't seem to play nicely with `zsh` since I tried to do a `..` (which is a common `zsh` alias for "cd .." which got a `zsh:1: permission denied: ..` and then I tried to run `cd ..` it did nothing. Keen to see how this pans out though!
- dbtc 3y agostock macos zsh's `..` just gave me 'zsh: permission denied: ..' zsh 5.9 (x86_64-apple-darwin22.0)
- chrysoprace 3y agoYep it's not stock `zsh` alias, so that suggests to me then that Inteshellisense isn't reading my shell config at all.
- keyle 3y agoIs anyone else feeling off about typescript in the terminal emulator? I guess it's not worse than TCL or Perl.
- cpendery 3y agoThanks for everyone creating issues. I'm working on addressing all the issues and they'll be included in the next release.
- theusus 3y agoNot up to the mark with https://github.com/marlonrichert/zsh-autocomplete https://github.com/marlonrichert/zsh-autocomplete which works contextually.
- Too 3y agoThis is cool. What is sad is that it has to rely on a library of completion specs. It shows what kind of stone age foundations we are building on top of. The world would have been a much better place if CLIs themselves defined strict interfaces using standard data structures. Not only for auto completion, also gives much more accurate error checking of bash scripts. Same goes for data piped in and out of command.
- runeks 3y ago> The world would have been a much better place if CLIs themselves defined strict interfaces using standard data structures. Well it's not too late just yet. How about if all CLI exes had an option, say --dump-cli-options, that wrote out a spec of the supported commands/flags/options? Something like e.g. Python's argparse should be able to effortlessly spit out this info (and the same for other similar argument parsing libraries).
- runeks 3y agoAnd we would also need an options that does CLI argument parsing only, and either returns an error related to parsing one or more options or "ok". This could be used to do "form validation" of CLI args as they're typed in the shell.
- hahn-kev 3y agoLots do it's called help. But then they would all have to use the same spec, which we know would never happen.
- erezsh 3y agoIt's sad. If the world of software had better coordination and cooperation, we would be able to get so much more done. Instead we're constantly dumping and re-parsing the same data, re-implementing the same protocols and algorithms in dozens of different languages, each time with different quirks. Fixing the same bugs again and again.
- Eisenstein 3y ago
- hiAndrewQuinn 3y agoAlternatively, if you simply wish to occasionally bring Copilot into your shell, you should know that Ctrl+X Ctrl+E (on bash) / Alt+E (on fish) will open your current shell line up in $EDITOR, which you may set to Vim or Neovim. From there, :wq will drop the text back into your command line. If you have Copilot set up in either of those, then it will also work here. I know from working on https://github.com/hiAndrewQuinn/shell-bling-ubuntu https://github.com/hiAndrewQuinn/shell-bling-ubuntu that Neovim's LazyVim setup now supports Copilot out of the box now. I never had much trouble setting up the Vim plugin either. YMMV.
- lloeki 3y agoIf using bash in vi mode instead of emacs mode: ESC v. zsh starts minimal, so one needs the following for such a feature to be operational: # enable autoload edit-command-line zle -N edit-command-line # bash-like emacs mode shortcut bindkey "^X^E" edit-command-line # bash-like vi mode shortcut bindkey -M vicmd v edit-command-line
- ssijak 3y agoI use Fig which also has this and it seems to be better at it
- ghqst 3y agoThis is using the same library as Fig for autocomplete, but cross -platform and without requiring an account.
- cvak 3y agoFig.io with no account and calling home, count me in.
- classified 3y agoConnecting NPM-powered software directly to my shell? Over my dead body.
- nikolay 3y agoShells and Node.js don't mix well.
- pseudo_meta 3y agoAwesome in principle, but it appears that it has to take over your prompt to work. Any custom prompt (starship) is replaced, zsh-syntax-highlighting does not work anymore etc. Too bad…