Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is this compatible with atuin #22

Open
igor-krawczuk opened this issue Nov 26, 2023 · 4 comments
Open

Question: Is this compatible with atuin #22

igor-krawczuk opened this issue Nov 26, 2023 · 4 comments

Comments

@igor-krawczuk
Copy link

In the docs it says that butterfish "manages my shell history". I'm using https://github.com/atuinsh/atuin to sync my shell history (actually discovered it via the llmshellautocomplete project which leverages it to do something that appears much hackier than your project).

Atuins main "magic" is in storing the shell history in a sqlite library and then implementing search, sync etc. on top of that. I quite like it since I'm often server hopping.

It it possible to use the two concurrently? And if not, off the top of your head, what would be the main steps I'd have to do to contribute compatibility?

@bakks
Copy link
Owner

bakks commented Nov 26, 2023

Hey @igor-krawczuk, good question, I wasn't aware of atuin but its a very cool project! Here are some notes:

  • When I say in the readme that butterfish "manages your shell history", this is actually pretty basic. Butterfish just keeps track of the commands, outputs, prompts, and LLM outputs in memory while you're using Butterfish, and sends those to the LLM as context. It doesn't save-to-disk or load older stuff.
  • I don't think atuin will conflict with butterfish (which is designed to be a layer on top of things that doesn't break customizations like this) but i'm not certain, I'll give it a try when I get a chance. I use something with fzf for my ctrl-r and it works fine.
  • That being said there's probably opportunity to make butterfish more compatible with atuin. Some potential features I can think of are:
    • Load older history when you start butterfish shell. One reason I don't do this with bash_history is that it doesn't store the outputs, it seems like maybe atuin does but I'm not clear. See this code: https://github.com/bakks/butterfish/blob/main/butterfish/shell.go#L163-L303
    • Use butterfish to generate sql to search the database
    • etc., probably you'll have to judge what's useful for you based on how you use it.

So please give it a try, my guess is butterfish and atuin don't conflict but sometimes there are weird incompatibilities, please let me know if so. And feel free to send pull requests if you want to make them more compatible! I'm happy to help you get those working well.

cc @ellie just as FYI

@ellie
Copy link

ellie commented Nov 26, 2023

This looks cool! Thanks for the @ 😄

I also don't see any reason why this wouldn't work.

One reason I don't do this with bash_history is that it doesn't store the outputs

Do you mean output as in stdout, or output as in "did this exit successfully?"

Use butterfish to generate sql to search the database

It'd be preferable to use atuin search so we don't break any possible integration with future database migrations!

I'm happy to help you get those working well.

Likewise

@bakks
Copy link
Owner

bakks commented Nov 26, 2023

Thanks for your response!

Do you mean output as in stdout, or output as in "did this exit successfully?"

stdout/stderr, butterfish sends everything as part of the llm conversation context. There's probably value loading just the old commands into history, but i haven't implemented.

Anyway @igor-krawczuk feel free to experiment with integration!

@igor-krawczuk
Copy link
Author

Okay, I will try this when I'm procrastinating the next time, currently in a deadline crunch so will probably be a while but I'll make a PR or leave a comment here once I had the chance to play a bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants