Created
May 3, 2025 10:14
-
-
Save tindzk/abedfe3251c01ab72b21b56410655d27 to your computer and use it in GitHub Desktop.
Import Atuin history into Nushell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change history file format to SQLite in ~/.config/nushell/config.nu | |
$env.config.history.file_format = 'sqlite' | |
# Import Atuin history | |
open ~/.local/share/atuin/history.db | |
| query db "SELECT * FROM history" | |
| each {|row| { | |
command: $row.command, | |
start_timestamp: ($row.timestamp | into datetime), | |
duration: ([$row.duration, 0] | math max | into duration), | |
exit_status: $row.exit, | |
cwd: $row.cwd, | |
hostname: $row.hostname | |
} } | |
| history import |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment