Skip to content

Instantly share code, notes, and snippets.

@tindzk
Created May 3, 2025 10:14
Show Gist options
  • Save tindzk/abedfe3251c01ab72b21b56410655d27 to your computer and use it in GitHub Desktop.
Save tindzk/abedfe3251c01ab72b21b56410655d27 to your computer and use it in GitHub Desktop.
Import Atuin history into Nushell
# 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