atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.78k stars 564 forks source link

Add history export (and re-import) option, machine-readable #816

Open shoffmeister opened 1 year ago

shoffmeister commented 1 year ago

It could be a useful addition to atuin to offer history export, reimport/merge in a machine-readable, open, stable format.

I did find the SQLite database in ~/.local/share/atuin, but that's "locked away" in a sense, IMHO, requiring SQLite tooling.

Using JSON as data exchange format, it would be possible to

This would be particularly useful in scenarios where there is no Atuin server around, only sneakernet.

Disclaimer: I only just installed atuin, with one major attraction being the global shell history across bash sessions (something that fzf does not / cannot offer).

conradludgate commented 1 year ago
  • backup transparently the history - e.g. atuin history list --json, sitting next to the --format option
  • merge / append existing history, e.g. atuin history append --json < my-history.json

You might know we already have a sync service. This uses JSON already, but the payloads are encrypted.

In theory we could have a cli version too. But it needs a proper design. We have some ideas on the roadmap. I'll see if we can fit this in with our new ideas too.

Thanks for the suggestion