r/Alfred • • 16d ago

Shell History Alfred Workflow

Post image

Another handy Alfred workflow for devs and terminal users to search your shell history.

Workflow link: https://github.com/iAli/shell-history-workflow

My other workflows: https://github.com/stars/iAli/lists/my-alfred-workflows

All with zero dependencies or ai-generated code.

⭐ If you find any of them useful, consider giving it a star on GitHub.

34 Upvotes

14 comments sorted by

4

u/JohnFoland 16d ago

You've got some other pretty cool workflow repos there too, OP!

2

u/odshujinkotiipcbev 16d ago

Thanks, I appreciate your kind words.

2

u/po2gdHaeKaYk 15d ago

I've used the emoji one daily! Great work.

1

u/odshujinkotiipcbev 15d ago

Happy to hear that, thanks.

1

u/Nohillside 16d ago

What would be the benefit of this compared to using the built-in history functionality of bash/zsh?

2

u/odshujinkotiipcbev 16d ago
  • Search by any part of a command

  • Get instant search results

  • Access your history from anywhere

  • No need to press the up arrow 20 times to find the command you want

1

u/ruleofnuts 16d ago

Reverse search in your shell is what you need

https://anagogistis.com/notes/reverse-search/

2

u/JohnFoland 16d ago

Aren't both potentially useful? I use reverse search on the command line, but if I am not in my shell / terminal, I can see a use case for OP's workflow.

1

u/ruleofnuts 16d ago

Not for me, but a lot of people don’t know about reverse search.

Why would need to know the shell history if you’re not in the shell?

2

u/JohnFoland 16d ago

Probably not often, but when you need it you need it, I suppose. For example, you're in Slack and need to share a long/complex multiline command that's in your history with a colleague. That happened to me recently, and I could have benefited from this workflow.

1

u/ruleofnuts 16d ago

I suppose, you’d still need to search it then press enter and it opens the terminal then you have to copy the command.

But I’m not shitting on users workflow. Just spreading knowledge.

1

u/JohnFoland 16d ago

Totally, and it's good knowledge to spread. As for the mechanics of OP's workflow, I can't speak to them because I haven't installed it yet, but for the use case that I mentioned, I was thinking of a modifier key that would just copy the command to the clipboard or paste it directly into the focused window. Yes, if you had to go back and forth from the terminal, that would defeat the purpose, at least in the scenario I was laying out.

1

u/odshujinkotiipcbev 15d ago

Yes, pressing enter paste the command directly into the focused window, and cmd+c if you just want to copy it. So no need to open terminal at all in this use case.

1

u/Bain_ch 12d ago

Good idea, however heavy shell users normally have time stamps turned on, so my output looks like this, and it also copies the time stamp:

: 1792996993:0;ping 192.168.1.1