19 ms·
Fly through your shell history
- daxdev 3y agoloving the name of this, super useful thx
- paulrouget 3y agoHow does it compare to https://atuin.sh/ https://atuin.sh/ ?
- bongobingo1 3y agoSome discussion about cross pollination https://github.com/cantino/mcfly/issues/373 https://github.com/cantino/mcfly/issues/373
- nindalf 3y agoAtuin has encrypted sync, that'll be a big difference. I've used mcfly for years and I appreciate the hard work cantino has put into it, but mcfly is currently looking for a maintainer while the maintainer of Atuin has recently committed to doing so full time (https://ellie.wtf/posts/i-quit-my-job-to-work-full-time-on-my-open-source-project https://ellie.wtf/posts/i-quit-my-job-to-work-full-time-on-m...). That may make a difference to some people considering which one to pick. Both are implemented in Rust and use SQLite as storage, so both should be equally performant in terms of startup latency and storage capacity. The ctrl+R UI of each is different but that comes down to personal taste.
- munro 3y agoI just tried to use atuin... I have to login, but I don't want to :( I tried to run a search locally... but I have to run a PostgreSQL server??? Why isn't it just allowing embedded DB like mcfly? I know this isn't the place for support, but I give up trying to get it to work :(
- ellieh 3y agoYou don’t have to! Only if you want to sync your history. For pure offline usage that’s not required I’ll clarify in the docs
- internetter 3y ago> I just tried to use atuin... I have to login, but I don't want to It didn't ask me to login... > I tried to run a search locally... but I have to run a PostgreSQL server PostgreSQL is for the server? You don't need a server. It uses sqlite, verifiable by running $ sqlite3 ~/.local/share/atuin/history.db $ SELECT * FROM history LIMIT 10; Did you actually try it? I don't know where you got all this from.
- deleted 3y ago[deleted]
- ddworken 3y agoI'll also plug my project [0] as another alternative that supports syncing (similar to Autumn) and also has a number of powerful customization features (e.g. custom columns to collect arbitrary metadata with each command, like the git remote) and an AI shell command generator. [0]: https://github.com/ddworken/hishtory https://github.com/ddworken/hishtory
- freedomben 3y agoTo me, this is the biggest difference: > The key feature of McFly is smart command prioritization powered by a small neural network that runs in real time. The goal is for the command you want to run to always be one of the top suggestions.
- carlmr 3y agoThis looks really nice. You say you record the number of times a command was executed. I'm currently using FZF for ctrl-r search, and it's amazing, but one thing that bothers me is that I have some commands that I search for and use quite often, but then I don't need them for a while, they vanish from my history, and then I need them again. Would the internal database of McFly keep often searched for commands from the past, even though they're out of the bash history?
- petepete 3y agoIf you set your HISTFILESIZE to -1 Bash will keep your history indefinitely. > Non-numeric values and numeric values less than zero inhibit truncation.
- bnprks 3y agoI believe McFly hangs on to all history in the database, though you can limit the UI to only return the most recent entries (MCFLY_HISTORY_LIMIT). One side note -- I made a small tool to integrate the McFly database with the fzf UI, which might be of interest to you [1]. Overall I've been a happy user of McFly for a few years, and it's 100% an upgrade over bash's command history (properly storing commands from multiple terminal windows; collecting working directory + exit status info, etc.) [1] https://github.com/bnprks/mcfly-fzf https://github.com/bnprks/mcfly-fzf
- helsinkiandrew 3y agoIf any one has tried this, can you confirm whether it copes with having multiple shells overwriting the history files There is nothing more disappointing than not being able to find the cool command line I used a week ago because the shell I opened briefly and forgot about has overwritten it - maybe that's my poor setup though
- loa_in_ 3y agoThis is my least favourite thing about shell history as well. It fails at being shell history log, because it's dropping more than it retains.
- hnlmorg 3y agoI hate that too but it’s worth noting that this is a bashism. It’s not a problem with some other alternative shells.
- jraph 3y agoYep, zsh, and most likely fish and other shells manage to keep all your commands in the history, no matter how many sessions you open.
- calmoo 3y agoI find this can be a bit messy because VS code runs lots of commands in the background that pollute the history with extremely verbose commands.
- deleted 3y ago[deleted]
- wruza 3y agoWhy does it run them in interactive shells? Not surpising given it’s Microsoft, but still worth reporting an issue.
- deleted 3y ago[deleted]
- devnonymous 3y agoThis looks good and I'm sure it was created to scratch a particular itch but a simple approach to this (in bash) is changing the $HISTFILE depending on 'context'. I personally have a custom shell function inspired by virtualenvwrapper's 'workon' that sets the stage, so to speak, based on its arguments. One of the things it does is export various env variables including HISTFILE. For me this is a more flexible way to introduce customisation (for instance one of the last thing my function does is look for a project specific function (name of which is env derived) and execute it ...and then it's turtules all the way down )
- Mizza 3y agoI've been using Mcfly, Autojump (j), and Ag (a) for so long I'm basically useless on systems where I don't have them. Wouldn't change it for the world.
- clot27 3y agoI use https://github.com/atuinsh/atuin https://github.com/atuinsh/atuin
- block_dagger 3y agoWas expecting a 3d flying simulation featuring shell history as content. Oh well.
- unwind 3y agoIt made me think of the Jurassic park quote, once again [1]. [1]: https://www.siliconbunny.com/fsn-the-irix-3d-file-system-tool-from-jurassic-park/ https://www.siliconbunny.com/fsn-the-irix-3d-file-system-too...
- itslennysfault 3y agoSame. I thought we were finally making Hackers (the movie) a reality.
- gumby 3y agoI wonder if having the search use context like cwd is a win in practice or not. I’ll have to try this out to see. I’ve been using `history | grep` since forever (usually `history | grep foo | tail -n 5` which has been a single-character alias for more than 30 years). Hard to beat. Since history gives you the line number you can just `!12345` — no need to copy/paste, and works through an ssh connection!
- TacticalCoder 3y ago> I’ve been using `history | grep` since forever... which has been a single-character alias for more than 30 years... I have "history | grep" basically aliased to "h?"
- IggleSniggle 3y agoOk? Sounds like the person you're replying to said they did too? Why are we ending our statements in question marks.
- oops 3y agoMy understanding is that the question mark is part of the alias name.
- IggleSniggle 3y agoOh that makes sense. I never am completely sure how to deal with the interaction of quote marks at the intersection of code and English
- TacticalCoder 3y agoYup: that's why I put in quotes... I'm literally using "h?" as a Bash alias, as GP said. It may be a bit weird to use a question mark as part of a Bash alias that said: sorry for the confusion!
- berliner 3y agoLove the name :)
- malablaster 3y agoI find it annoying that the tl;dr summarizes two sentences.
- reportgunner 3y agoLost me at 'neural network'
- iFreilicht 3y agoIt's actually quite neat, doesn't have to do anything with the current AI hype: https://github.com/cantino/mcfly/blob/master/src/network.rs https://github.com/cantino/mcfly/blob/master/src/network.rs Just a few nodes, hardcoded weights. I wonder how it was trained.
- Grimburger 3y agoFor something more rustic, an .inputrc file with this: # history-search-backward / history-search-forward bound to the up and down arrows "\e[A": history-search-backward "\e[B": history-search-forward "\e[C": forward-char "\e[D": backward-char set show-all-if-ambiguous on set completion-ignore-case on Will search through anything matching what you've already entered. Type something like "gr" and scroll up or down to see all your previously used grep commands. Saw this long ago on here and it's on every machine I use now, can't live without it. Thankyou to whoever originally posted it.
- YoooThere 3y agoMagic! Thank you, now in my .bashrc files.
- bogwog 3y agoThis is something I can't live without either. I'd recommend people try this before trying to incorporate fzf, ctrl+r, etc into their workflows since it's simpler and probably covers 99% of your needs.
- BeetleB 3y agoWhile I agree one should have these keybindings, fzf + ctrl+r is a lot more powerful, and many a time I was on a system with those keybindings, and it would suck I did not have ctrl+r + fz. I'd say it covers perhaps 70-80% - not 99%.
- victor106 3y agodoes this work on a mac?
- syntaxing 3y agoJust tested, it does
- lamontcg 3y agoI just use this for quick history search of typically my last few commands in .zshrc: # tsch-style history search esc-n/esc-p bindkey '\ep' history-beginning-search-backward bindkey '\en' history-beginning-search-forward If I need substrings or searching for something further back in time I just use `history -99999 | rg` Tried ctrl-r bash style for about a month back when I was switching off of tcsh and hated it.
- dejj 3y agoI hoped for literal flying, like in the Jurassic Park operating system: https://m.youtube.com/watch?v=JOeY07qKU9c https://m.youtube.com/watch?v=JOeY07qKU9c
- localtoast 3y agoI'm enjoying this immensely. Thanks a bunch.
- zitterbewegung 3y agoWhat neural network is being used I think it would be better if you told us the neural network that is doing the prediction.
- iFreilicht 3y agoIt is a custom pretrained NN with very few nodes, the full source code is here: https://github.com/cantino/mcfly/blob/master/src/network.rs https://github.com/cantino/mcfly/blob/master/src/network.rs
- lxe 3y agoI've been using fzf ctrl+r for a while now, but i'll give ethis a try. Also didn't realize homebrew for linux exists!
- ajitid 3y agoAs a non-Mac user I really want to know why one would prefer Homebrew on Linux. My assumption is OS package manager would always have more packages compared to Homebrew, and I don't know if Homebrew on Linux even supports GUI packages or not.
- lopkeny12ko 3y agoFor the last 5 years, after being fed up with losing or overwriting my bash history, I've installed a daemon on all of my machines that tails ~/.bash_history and uploads every new line to a hosted time series database. I wrote some simple tools to query and search through this DB for commands. It's a super simple solution but works wonders, especially for digging up a command I ran on a different machine.
- bfors 3y agoFor any of the shell history solutions out there (myfly, atuin, fzf) is there a way to filter out commands that failed or had incorrect syntax? In my history there are ... a lot of those. Not that useful to have them hanging around.
- itslennysfault 3y agoI was today years old when I learned about CTRL+R. I've always just done history | grep Also, I use zsh which filters history when using up/down arrows to whatever you typed. So you can do "git" [up] [up] [up] to cycle through all recent git commands which is super useful.
- ludsan 3y agonow try it with fzf. You will have two birthdays
- sushiburps 3y ago+1 for fzf, never leave home without it
- bobbob1921 3y agoAs a back up to my large shell history, and using atuin w a self hosted atuin server), on most of my frequently used machines, I have a spunkUF running anyway, so I also have it logging/indexing .bash_history (to my offsite spunk server.). (so I have powerful search and timestamps for any of my commands, forever)
- SoftTalker 3y agoSurprised to see such heavy reliance on shell history. I view shell history as a liability. Too much chance of capturing passwords or other secrets and shell history files are the first place an intruder will look for those. My shell history has a limit of 25 commands and is not saved after logout. I very rarely find that to be too short. In almost every case, if I want to repeat a command it's either the previous one or no more than a few prior than that. Anything I need to do repeatedly I put in an alias or script or function.