#Why is there no tool/search function for getting prompts while searching up terminal commands?

39 messages · Page 1 of 1 (latest)

heady heart
#

The title. I have been searching for a tool that'll help with my terminal commands like if I type

"Regex", I want the tool to be able to show me all the commands that uses regular expressions as input.

Is there something like that?

visual plank
#

you mean auto suggestion like in fish?

heady heart
#

Not just that.

When you type in ">something" in VS code, it'll show the relevant settings and functions that exist with that word.

Is there nothing like that? I'm tired of having to search online

silk willow
#

I don't know if it's specific to certain shells

#

I use zsh, if I type the beginning of a command and press tab it will show every command that begin with the part I typed

#

That's not as powerful as what you want, but still similar

visual plank
silk willow
#

Another way would be to show every commands and grep an expression in it

heady heart
silk willow
deep vortex
#

Press tab?

#

Tab will autocomplete a lot of things, if they exist

#

Ah that was already said lol, but I think that is what you want really

silk willow
deep vortex
#

Ah, sounds fancy 🤔

heady heart
#

Like atleast to show relevant commands so I can next look at manual of those

deep vortex
#

Sounds what you're looking for some kind of typing system on the commands and their arguments

#

That's not a thing, everything on the commandline are just strings

#

I'm not sure how you could determine between a regex string or a normal string

heady heart
#

Ok found it

#

It's called apropos

#

This makes the most sense to me

#

Credit to The Linux Command Line book

deep vortex
#

I wondered about apropos but it wasn't very useful when I tried it

#

grep, sed, awk, and even pacman accept regex, none of which turn up there

#

Expanding the search to "regular expression" fills my terminal with garbage

heady heart
#

Ohh

deep vortex
#

I think what you really need is some kind of metadata database, like

{
  "sed" : {
    "features": ["regex", "text manipulation", "other features sed has"]
  },
  "grep" : { 
    "features": ["regex", "text filtering", "blah blah blah"]
  },
  // etc etc
}
``` then you could `metadataSearch regex` and it'd spit out "sed" and "grep"
#

To my knowledge that doesn't exist. I wondered if tldr would have that info but sadly not

#

Might be a useful little tool if you fancy a project 😄

heady heart
#

I do fancy a project! But I'm still learning to code and use the terminal so 😅

#

Some kind of a natural language processing that can interpret the input different ways and categorise them based on that?

cyan dock
surreal canyon
# heady heart I do fancy a project! But I'm still learning to code and use the terminal so 😅

just use fish and configure autocompletions in the config folder, many programs come with fish autocompletions too, as for a manual just use curl cht.sh/command-name and tldr command from the terminal, this is as far as you can go really, other stuff will just fill ur terminal with nonsense, look at cht.sh especially its very good since it aggregates documentation from many sources and needs just curl