aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 00:54:30 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 00:54:30 +0200
commit5c39e7cf284a1f6e9a1657f2deb44e359fc47eb8 (patch)
treec64baa8d5866c8e339eaf660dd3f94f30a3f7d8a /crates/atuin-client
parentchore: Somewhat simplify sync code (diff)
downloadatuin-5c39e7cf284a1f6e9a1657f2deb44e359fc47eb8.zip
chore: Move everything into one big crate
That helps remove duplicated code and rustc/cargo will now also show dead code correctly.
Diffstat (limited to '')
-rw-r--r--crates/atuin-client/Cargo.toml82
-rw-r--r--crates/atuin-client/config.toml371
-rw-r--r--crates/atuin-client/meta-migrations/20260203030924_create_meta.sql5
-rw-r--r--crates/atuin-client/migrations/20210422143411_create_history.sql16
-rw-r--r--crates/atuin-client/migrations/20220505083406_create-events.sql11
-rw-r--r--crates/atuin-client/migrations/20220806155627_interactive_search_index.sql6
-rw-r--r--crates/atuin-client/migrations/20230315220114_drop-events.sql2
-rw-r--r--crates/atuin-client/migrations/20230319185725_deleted_at.sql2
-rw-r--r--crates/atuin-client/migrations/20260224000100_history_author_intent.sql2
-rw-r--r--crates/atuin-client/record-migrations/20230531212437_create-records.sql16
-rw-r--r--crates/atuin-client/record-migrations/20231127090831_create-store.sql15
-rw-r--r--crates/atuin-client/tests/data/xonsh-history.sqlitebin12288 -> 0 bytes
-rw-r--r--crates/atuin-client/tests/data/xonsh/xonsh-82eafbf5-9f43-489a-80d2-61c7dc6ef542.json12
-rw-r--r--crates/atuin-client/tests/data/xonsh/xonsh-de16af90-9148-4461-8df3-5b5659c6420d.json12
-rw-r--r--crates/turtle/src/atuin_client/api_client.rs (renamed from crates/atuin-client/src/api_client.rs)7
-rw-r--r--crates/turtle/src/atuin_client/auth.rs (renamed from crates/atuin-client/src/auth.rs)29
-rw-r--r--crates/turtle/src/atuin_client/database.rs (renamed from crates/atuin-client/src/database.rs)9
-rw-r--r--crates/turtle/src/atuin_client/distro.rs (renamed from crates/atuin-client/src/distro.rs)0
-rw-r--r--crates/turtle/src/atuin_client/encryption.rs (renamed from crates/atuin-client/src/encryption.rs)2
-rw-r--r--crates/turtle/src/atuin_client/history.rs (renamed from crates/atuin-client/src/history.rs)26
-rw-r--r--crates/turtle/src/atuin_client/history/builder.rs (renamed from crates/atuin-client/src/history/builder.rs)0
-rw-r--r--crates/turtle/src/atuin_client/history/store.rs (renamed from crates/atuin-client/src/history/store.rs)9
-rw-r--r--crates/turtle/src/atuin_client/import/bash.rs (renamed from crates/atuin-client/src/import/bash.rs)9
-rw-r--r--crates/turtle/src/atuin_client/import/fish.rs (renamed from crates/atuin-client/src/import/fish.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/mod.rs (renamed from crates/atuin-client/src/import/mod.rs)2
-rw-r--r--crates/turtle/src/atuin_client/import/nu.rs (renamed from crates/atuin-client/src/import/nu.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/nu_histdb.rs (renamed from crates/atuin-client/src/import/nu_histdb.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/powershell.rs (renamed from crates/atuin-client/src/import/powershell.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/replxx.rs (renamed from crates/atuin-client/src/import/replxx.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/resh.rs (renamed from crates/atuin-client/src/import/resh.rs)6
-rw-r--r--crates/turtle/src/atuin_client/import/xonsh.rs (renamed from crates/atuin-client/src/import/xonsh.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/xonsh_sqlite.rs (renamed from crates/atuin-client/src/import/xonsh_sqlite.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/zsh.rs (renamed from crates/atuin-client/src/import/zsh.rs)4
-rw-r--r--crates/turtle/src/atuin_client/import/zsh_histdb.rs (renamed from crates/atuin-client/src/import/zsh_histdb.rs)8
-rw-r--r--crates/turtle/src/atuin_client/login.rs (renamed from crates/atuin-client/src/login.rs)4
-rw-r--r--crates/turtle/src/atuin_client/logout.rs (renamed from crates/atuin-client/src/logout.rs)2
-rw-r--r--crates/turtle/src/atuin_client/meta.rs (renamed from crates/atuin-client/src/meta.rs)7
-rw-r--r--crates/turtle/src/atuin_client/mod.rs (renamed from crates/atuin-client/src/lib.rs)5
-rw-r--r--crates/turtle/src/atuin_client/ordering.rs (renamed from crates/atuin-client/src/ordering.rs)0
-rw-r--r--crates/turtle/src/atuin_client/plugin.rs (renamed from crates/atuin-client/src/plugin.rs)0
-rw-r--r--crates/turtle/src/atuin_client/record/encryption.rs (renamed from crates/atuin-client/src/record/encryption.rs)4
-rw-r--r--crates/turtle/src/atuin_client/record/mod.rs (renamed from crates/atuin-client/src/record/mod.rs)0
-rw-r--r--crates/turtle/src/atuin_client/record/sqlite_store.rs (renamed from crates/atuin-client/src/record/sqlite_store.rs)7
-rw-r--r--crates/turtle/src/atuin_client/record/store.rs (renamed from crates/atuin-client/src/record/store.rs)2
-rw-r--r--crates/turtle/src/atuin_client/record/sync.rs (renamed from crates/atuin-client/src/record/sync.rs)15
-rw-r--r--crates/turtle/src/atuin_client/register.rs (renamed from crates/atuin-client/src/register.rs)4
-rw-r--r--crates/turtle/src/atuin_client/secrets.rs (renamed from crates/atuin-client/src/secrets.rs)0
-rw-r--r--crates/turtle/src/atuin_client/settings.rs (renamed from crates/atuin-client/src/settings.rs)46
-rw-r--r--crates/turtle/src/atuin_client/settings/meta.rs (renamed from crates/atuin-client/src/settings/meta.rs)2
-rw-r--r--crates/turtle/src/atuin_client/settings/watcher.rs (renamed from crates/atuin-client/src/settings/watcher.rs)4
-rw-r--r--crates/turtle/src/atuin_client/sync.rs (renamed from crates/atuin-client/src/sync.rs)5
-rw-r--r--crates/turtle/src/atuin_client/theme.rs (renamed from crates/atuin-client/src/theme.rs)4
-rw-r--r--crates/turtle/src/atuin_client/utils.rs (renamed from crates/atuin-client/src/utils.rs)0
53 files changed, 121 insertions, 681 deletions
diff --git a/crates/atuin-client/Cargo.toml b/crates/atuin-client/Cargo.toml
deleted file mode 100644
index c6a0f261..00000000
--- a/crates/atuin-client/Cargo.toml
+++ /dev/null
@@ -1,82 +0,0 @@
-[package]
-name = "atuin-client"
-edition = "2024"
-description = "client library for atuin"
-
-rust-version = { workspace = true }
-version = { workspace = true }
-authors = { workspace = true }
-license = { workspace = true }
-homepage = { workspace = true }
-repository = { workspace = true }
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[features]
-default = ["sync", "daemon"]
-sync = ["urlencoding", "reqwest", "sha2", "hex"]
-daemon = []
-check-update = []
-
-[dependencies]
-atuin-common = { path = "../atuin-common", version = "18.16.1" }
-
-log = { workspace = true }
-base64 = { workspace = true }
-time = { workspace = true, features = ["macros", "formatting", "parsing"] }
-clap = { workspace = true }
-eyre = { workspace = true }
-directories = { workspace = true }
-uuid = { workspace = true }
-whoami = { workspace = true }
-interim = { workspace = true }
-config = { workspace = true }
-serde = { workspace = true }
-serde_json = { workspace = true }
-humantime = "2.1.0"
-async-trait = { workspace = true }
-itertools = { workspace = true }
-rand = { workspace = true }
-shellexpand = { workspace = true }
-sqlx = { workspace = true, features = ["sqlite", "regexp"] }
-minspan = "0.1.5"
-regex = { workspace = true }
-serde_regex = "1.1.0"
-fs-err = { workspace = true }
-sql-builder = { workspace = true }
-memchr = "2.7"
-rmp = { version = "0.8.14" }
-typed-builder = { workspace = true }
-tokio = { workspace = true }
-semver = { workspace = true }
-thiserror = { workspace = true }
-futures = "0.3"
-notify = "7"
-crypto_secretbox = "0.1.1"
-generic-array = { version = "0.14", features = ["serde"] }
-serde_with = "3.8.1"
-
-# encryption
-rusty_paseto = { version = "0.8.0", default-features = false }
-rusty_paserk = { version = "0.5.0", default-features = false, features = [
- "v4",
- "serde",
-] }
-
-# sync
-urlencoding = { version = "2.1.0", optional = true }
-reqwest = { workspace = true, optional = true }
-hex = { version = "0.4", optional = true }
-sha2 = { version = "0.10", optional = true }
-indicatif = "0.18.0"
-
-# theme
-crossterm = { workspace = true, features = ["serde"] }
-palette = { version = "0.7.5", features = ["serializing"] }
-strum_macros = "0.27"
-strum = { version = "0.27", features = ["strum_macros"] }
-
-[dev-dependencies]
-tokio = { version = "1", features = ["full"] }
-pretty_assertions = { workspace = true }
-testing_logger = "0.1.1"
diff --git a/crates/atuin-client/config.toml b/crates/atuin-client/config.toml
deleted file mode 100644
index 0d0672bf..00000000
--- a/crates/atuin-client/config.toml
+++ /dev/null
@@ -1,371 +0,0 @@
-## Base directory for Atuin data files (databases, keys, session, etc.)
-## All data file paths default to being relative to this directory.
-## linux/mac: ~/.local/share/atuin (or XDG_DATA_HOME/atuin)
-## windows: %USERPROFILE%/.local/share/atuin
-# data_dir = "~/.local/share/atuin"
-
-## where to store your database, default is your system data directory
-## linux/mac: ~/.local/share/atuin/history.db
-## windows: %USERPROFILE%/.local/share/atuin/history.db
-# db_path = "~/.history.db"
-
-## where to store your encryption key, default is your system data directory
-## linux/mac: ~/.local/share/atuin/key
-## windows: %USERPROFILE%/.local/share/atuin/key
-# key_path = "~/.key"
-
-## where to store your auth session token, default is your system data directory
-## linux/mac: ~/.local/share/atuin/session
-## windows: %USERPROFILE%/.local/share/atuin/session
-# session_path = "~/.session"
-
-## date format used, either "us" or "uk"
-# dialect = "us"
-
-## default timezone to use when displaying time
-## either "l", "local" to use the system's current local timezone, or an offset
-## from UTC in the format of "<+|->H[H][:M[M][:S[S]]]"
-## for example: "+9", "-05", "+03:30", "-01:23:45", etc.
-# timezone = "local"
-
-## enable or disable automatic sync
-# auto_sync = true
-
-## enable or disable automatic update checks
-# update_check = true
-
-## address of the sync server
-# sync_address = "https://api.atuin.sh"
-
-## how often to sync history. note that this is only triggered when a command
-## is ran, so sync intervals may well be longer
-## set it to 0 to sync after every command
-# sync_frequency = "10m"
-
-## which search mode to use
-## possible values: prefix, fulltext, fuzzy, skim
-# search_mode = "fuzzy"
-
-## which filter mode to use by default
-## possible values: "global", "host", "session", "session-preload", "directory", "workspace"
-## consider using search.filters to customize the enablement and order of filter modes
-# filter_mode = "global"
-
-## With workspace filtering enabled, Atuin will filter for commands executed
-## in any directory within a git repository tree (default: false).
-##
-## To use workspace mode by default when available, set this to true and
-## set filter_mode to "workspace" or leave it unspecified and
-## set search.filters to include "workspace" before other filter modes.
-# workspaces = false
-
-## which filter mode to use when atuin is invoked from a shell up-key binding
-## the accepted values are identical to those of "filter_mode"
-## leave unspecified to use same mode set in "filter_mode"
-# filter_mode_shell_up_key_binding = "global"
-
-## which search mode to use when atuin is invoked from a shell up-key binding
-## the accepted values are identical to those of "search_mode"
-## leave unspecified to use same mode set in "search_mode"
-# search_mode_shell_up_key_binding = "fuzzy"
-
-## which style to use
-## possible values: auto, full, compact
-# style = "auto"
-
-## the maximum number of lines the interface should take up
-## set it to 0 to always go full screen
-# inline_height = 0
-
-## the maximum number of lines the interface should take up
-## when atuin is invoked from a shell up-key binding
-## the accepted values are identical to those of "inline_height"
-# inline_height_shell_up_key_binding = 0
-
-## Invert the UI - put the search bar at the top , Default to `false`
-# invert = false
-
-## enable or disable showing a preview of the selected command
-## useful when the command is longer than the terminal width and is cut off
-# show_preview = true
-
-## what to do when the escape key is pressed when searching
-## possible values: return-original, return-query
-# exit_mode = "return-original"
-
-## possible values: emacs, subl
-# word_jump_mode = "emacs"
-
-## characters that count as a part of a word
-# word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-
-## number of context lines to show when scrolling by pages
-# scroll_context_lines = 1
-
-## use ctrl instead of alt as the shortcut modifier key for numerical UI shortcuts
-## alt-0 .. alt-9
-# ctrl_n_shortcuts = false
-
-## Show numeric shortcuts (1..9) beside list items in the TUI
-## set to false to hide the moving numbers if you find them distracting
-# show_numeric_shortcuts = true
-
-## default history list format - can also be specified with the --format arg
-# history_format = "{time}\t{command}\t{duration}"
-
-## Defaults to true. If enabled, strip trailing spaces and tabs from commands
-## before saving them to history.
-## Escaped trailing spaces (for example `printf foo\\ `) are preserved.
-# strip_trailing_whitespace = true
-
-## prevent commands matching any of these regexes from being written to history.
-## Note that these regular expressions are unanchored, i.e. if they don't start
-## with ^ or end with $, they'll match anywhere in the command.
-## For details on the supported regular expression syntax, see
-## https://docs.rs/regex/latest/regex/#syntax
-# history_filter = [
-# "^secret-cmd",
-# "^innocuous-cmd .*--secret=.+",
-# ]
-
-## prevent commands run with cwd matching any of these regexes from being written
-## to history. Note that these regular expressions are unanchored, i.e. if they don't
-## start with ^ or end with $, they'll match anywhere in CWD.
-## For details on the supported regular expression syntax, see
-## https://docs.rs/regex/latest/regex/#syntax
-# cwd_filter = [
-# "^/very/secret/area",
-# ]
-
-## Configure the maximum height of the preview to show.
-## Useful when you have long scripts in your history that you want to distinguish
-## by more than the first few lines.
-# max_preview_height = 4
-
-## Configure whether or not to show the help row, which includes the current Atuin
-## version (and whether an update is available), a keymap hint, and the total
-## amount of commands in your history.
-# show_help = true
-
-## Configure whether or not to show tabs for search and inspect
-# show_tabs = true
-
-## Configure whether or not the tabs row may be auto-hidden, which includes the current Atuin
-## tab, such as Search or Inspector, and other tabs you may wish to see. This will
-## only be hidden if there are fewer than this count of lines available, and does not affect the use
-## of keyboard shortcuts to switch tab. 0 to never auto-hide, default is 8 (lines).
-## This is ignored except in `compact` mode.
-# auto_hide_height = 8
-
-## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include
-## 1. AWS key id
-## 2. Github pat (old and new)
-## 3. Slack oauth tokens (bot, user)
-## 4. Slack webhooks
-## 5. Stripe live/test keys
-# secrets_filter = true
-
-## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command,
-## whereas tab will put the command in the prompt for editing.
-## If set to false, both enter and tab will place the command in the prompt for editing.
-## This applies for new installs. Old installs will keep the old behaviour unless configured otherwise.
-enter_accept = true
-
-## Defaults to false. If enabled, when triggered after &&, || or |, Atuin will complete commands to chain rather than replace the current line.
-# command_chaining = false
-
-## Defaults to "emacs". This specifies the keymap on the startup of `atuin
-## search`. If this is set to "auto", the startup keymap mode in the Atuin
-## search is automatically selected based on the shell's keymap where the
-## keybinding is defined. If this is set to "emacs", "vim-insert", or
-## "vim-normal", the startup keymap mode in the Atuin search is forced to be
-## the specified one.
-# keymap_mode = "auto"
-
-## Cursor style in each keymap mode. If specified, the cursor style is changed
-## in entering the cursor shape. Available values are "default" and
-## "{blink,steady}-{block,underline,bar}".
-# keymap_cursor = { emacs = "blink-block", vim_insert = "blink-block", vim_normal = "steady-block" }
-
-# network_connect_timeout = 5
-# network_timeout = 5
-
-## Timeout (in seconds) for acquiring a local database connection (sqlite)
-# local_timeout = 5
-
-## Set this to true and Atuin will minimize motion in the UI - timers will not update live, etc.
-## Alternatively, set env NO_MOTION=true
-# prefers_reduced_motion = false
-
-[stats]
-## Set commands where we should consider the subcommand for statistics. Eg, kubectl get vs just kubectl
-# common_subcommands = [
-# "apt",
-# "cargo",
-# "composer",
-# "dnf",
-# "docker",
-# "dotnet",
-# "git",
-# "go",
-# "ip",
-# "jj",
-# "kubectl",
-# "nix",
-# "nmcli",
-# "npm",
-# "pecl",
-# "pnpm",
-# "podman",
-# "port",
-# "systemctl",
-# "tmux",
-# "yarn",
-# ]
-
-## Set commands that should be totally stripped and ignored from stats
-# common_prefix = ["sudo"]
-
-## Set commands that will be completely ignored from stats
-# ignored_commands = [
-# "cd",
-# "ls",
-# "vi"
-# ]
-
-[keys]
-# Defaults to true. If disabled, using the up/down key won't exit the TUI when scrolled past the first/last entry.
-# scroll_exits = true
-
-# Defaults to true. The left arrow key will exit the TUI when scrolling before the first character
-# exit_past_line_start = true
-
-# Defaults to true. The right arrow key performs the same functionality as Tab and copies the selected line to the command line to be modified.
-# accept_past_line_end = true
-
-# Defaults to false. The left arrow key performs the same functionality as Tab and copies the selected line to the command line to be modified.
-# accept_past_line_start = false
-
-# Defaults to false. The backspace key performs the same functionality as Tab and copies the selected line to the command line to be modified when at the start of the line.
-# accept_with_backspace = false
-
-[sync]
-# Enable sync v2 by default
-# This ensures that sync v2 is enabled for new installs only
-# In a later release it will become the default across the board
-records = true
-
-[preview]
-## which preview strategy to use to calculate the preview height (respects max_preview_height).
-## possible values: auto, static
-## auto: length of the selected command.
-## static: length of the longest command stored in the history.
-## fixed: use max_preview_height as fixed height.
-# strategy = "auto"
-
-[daemon]
-## Enables using the daemon to sync.
-# enabled = false
-
-## Automatically start and manage the daemon when needed.
-## Not compatible with `systemd_socket = true`.
-# autostart = false
-
-## How often the daemon should sync in seconds
-# sync_frequency = 300
-
-## The path to the unix socket used by the daemon (on unix systems)
-## linux/mac: ~/.local/share/atuin/atuin.sock
-## windows: Not Supported
-# socket_path = "~/.local/share/atuin/atuin.sock"
-
-## The daemon pidfile used for lifecycle management.
-## Defaults to the Atuin data directory.
-# pidfile_path = "~/.local/share/atuin/atuin-daemon.pid"
-
-## Use systemd socket activation rather than opening the given path (the path must still be correct for the client)
-## linux: false
-## mac/windows: Not Supported
-# systemd_socket = false
-
-## The port that should be used for TCP on non unix systems
-# tcp_port = 8889
-
-# [theme]
-## Color theme to use for rendering in the terminal.
-## There are some built-in themes, including the base theme ("default"),
-## "autumn" and "marine". You can add your own themes to the "./themes" subdirectory of your
-## Atuin config (or ATUIN_THEME_DIR, if provided) as TOML files whose keys should be one or
-## more of AlertInfo, AlertWarn, AlertError, Annotation, Base, Guidance, Important, and
-## the string values as lowercase entries from this list:
-## https://ogeon.github.io/docs/palette/master/palette/named/index.html
-## If you provide a custom theme file, it should be called "NAME.toml" and the theme below
-## should be the stem, i.e. `theme = "NAME"` for your chosen NAME.
-# name = "autumn"
-
-## Whether the theme manager should output normal or extra information to help fix themes.
-## Boolean, true or false. If unset, left up to the theme manager.
-# debug = true
-
-[search]
-## The list of enabled filter modes, in order of priority.
-## The "workspace" mode is skipped when not in a workspace or workspaces = false.
-## Default filter mode can be overridden with the filter_mode setting.
-# filters = [ "global", "host", "session", "session-preload", "workspace", "directory" ]
-
-[tmux]
-## Enable using atuin with tmux popup (requires tmux >= 3.2)
-## When enabled and running inside tmux, Atuin will use a popup window for interactive search.
-## Set to false to disable the popup.
-## This can also be controlled with the ATUIN_TMUX_POPUP environment variable.
-## Note: The tmux popup is currently supported in zsh, bash, and fish shells. This currently doesn't work with iTerm native tmux integration.
-# enabled = false
-
-## Width of the tmux popup window
-## Can be a percentage, or integer (e.g. "100" means 100 characters wide)
-# width = "80%"
-
-## Height of the tmux popup window
-## Can be a percentage, or integer (e.g. "100" means 100 lines tall)
-# height = "60%"
-
-[ui]
-## Columns to display in the interactive search, from left to right.
-## The selection indicator (" > ") is always shown first implicitly.
-##
-## Each column can be specified as a simple string (uses default width)
-## or as an object with type, width, and expand:
-## { type = "directory", width = 30, expand = true }
-##
-## Available column types (with default widths):
-## duration (5) - Command execution duration (e.g., "123ms")
-## time (8) - Relative time since execution (e.g., "59m ago")
-## datetime (16) - Absolute timestamp (e.g., "2025-01-22 14:35")
-## directory (20) - Working directory (truncated if too long)
-## host (15) - Hostname where command was run
-## user (10) - Username
-## exit (3) - Exit code (colored by success/failure)
-## command (*) - The command itself (expands by default)
-##
-## The "expand" option (default: true for command, false for others) makes a
-## column fill remaining space. Only one column should have expand = true.
-##
-## Default:
-# columns = ["duration", "time", "command"]
-##
-## Examples:
-##
-## Minimal - more space for commands:
-# columns = ["duration", "command"]
-##
-## With wider directory column:
-# columns = ["duration", { type = "directory", width = 30 }, "command"]
-##
-## Show host for multi-machine sync users:
-# columns = ["duration", "time", "host", "command"]
-##
-## Show exit codes prominently:
-# columns = ["exit", "duration", "command"]
-##
-## Make directory expand instead of command:
-# columns = ["duration", "time", { type = "directory", expand = true }, { type = "command", expand = false }]
diff --git a/crates/atuin-client/meta-migrations/20260203030924_create_meta.sql b/crates/atuin-client/meta-migrations/20260203030924_create_meta.sql
deleted file mode 100644
index 26c3c142..00000000
--- a/crates/atuin-client/meta-migrations/20260203030924_create_meta.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-create table if not exists meta (
- key text not null primary key,
- value text not null,
- updated_at integer not null default (strftime('%s', 'now'))
-);
diff --git a/crates/atuin-client/migrations/20210422143411_create_history.sql b/crates/atuin-client/migrations/20210422143411_create_history.sql
deleted file mode 100644
index 1f3f8686..00000000
--- a/crates/atuin-client/migrations/20210422143411_create_history.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- Add migration script here
-create table if not exists history (
- id text primary key,
- timestamp integer not null,
- duration integer not null,
- exit integer not null,
- command text not null,
- cwd text not null,
- session text not null,
- hostname text not null,
-
- unique(timestamp, cwd, command)
-);
-
-create index if not exists idx_history_timestamp on history(timestamp);
-create index if not exists idx_history_command on history(command);
diff --git a/crates/atuin-client/migrations/20220505083406_create-events.sql b/crates/atuin-client/migrations/20220505083406_create-events.sql
deleted file mode 100644
index f6cafeba..00000000
--- a/crates/atuin-client/migrations/20220505083406_create-events.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-create table if not exists events (
- id text primary key,
- timestamp integer not null,
- hostname text not null,
- event_type text not null,
-
- history_id text not null
-);
-
--- Ensure there is only ever one of each event type per history item
-create unique index history_event_idx ON events(event_type, history_id);
diff --git a/crates/atuin-client/migrations/20220806155627_interactive_search_index.sql b/crates/atuin-client/migrations/20220806155627_interactive_search_index.sql
deleted file mode 100644
index b5770e62..00000000
--- a/crates/atuin-client/migrations/20220806155627_interactive_search_index.sql
+++ /dev/null
@@ -1,6 +0,0 @@
--- Interactive search filters by command then by the max(timestamp) for that
--- command. Create an index that covers those
-create index if not exists idx_history_command_timestamp on history(
- command,
- timestamp
-);
diff --git a/crates/atuin-client/migrations/20230315220114_drop-events.sql b/crates/atuin-client/migrations/20230315220114_drop-events.sql
deleted file mode 100644
index fe3cae17..00000000
--- a/crates/atuin-client/migrations/20230315220114_drop-events.sql
+++ /dev/null
@@ -1,2 +0,0 @@
--- Add migration script here
-drop table events;
diff --git a/crates/atuin-client/migrations/20230319185725_deleted_at.sql b/crates/atuin-client/migrations/20230319185725_deleted_at.sql
deleted file mode 100644
index 6c422abc..00000000
--- a/crates/atuin-client/migrations/20230319185725_deleted_at.sql
+++ /dev/null
@@ -1,2 +0,0 @@
--- Add migration script here
-alter table history add column deleted_at integer;
diff --git a/crates/atuin-client/migrations/20260224000100_history_author_intent.sql b/crates/atuin-client/migrations/20260224000100_history_author_intent.sql
deleted file mode 100644
index 2bed17e9..00000000
--- a/crates/atuin-client/migrations/20260224000100_history_author_intent.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-alter table history add column author text;
-alter table history add column intent text;
diff --git a/crates/atuin-client/record-migrations/20230531212437_create-records.sql b/crates/atuin-client/record-migrations/20230531212437_create-records.sql
deleted file mode 100644
index 4f4b304a..00000000
--- a/crates/atuin-client/record-migrations/20230531212437_create-records.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- Add migration script here
-create table if not exists records (
- id text primary key,
- parent text unique, -- null if this is the first one
- host text not null,
-
- timestamp integer not null,
- tag text not null,
- version text not null,
- data blob not null,
- cek blob not null
-);
-
-create index host_idx on records (host);
-create index tag_idx on records (tag);
-create index host_tag_idx on records (host, tag);
diff --git a/crates/atuin-client/record-migrations/20231127090831_create-store.sql b/crates/atuin-client/record-migrations/20231127090831_create-store.sql
deleted file mode 100644
index 53d78860..00000000
--- a/crates/atuin-client/record-migrations/20231127090831_create-store.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- Add migration script here
-create table if not exists store (
- id text primary key, -- globally unique ID
-
- idx integer, -- incrementing integer ID unique per (host, tag)
- host text not null, -- references the host row
- tag text not null,
-
- timestamp integer not null,
- version text not null,
- data blob not null,
- cek blob not null
-);
-
-create unique index record_uniq ON store(host, tag, idx);
diff --git a/crates/atuin-client/tests/data/xonsh-history.sqlite b/crates/atuin-client/tests/data/xonsh-history.sqlite
deleted file mode 100644
index 744fcf86..00000000
--- a/crates/atuin-client/tests/data/xonsh-history.sqlite
+++ /dev/null
Binary files differ
diff --git a/crates/atuin-client/tests/data/xonsh/xonsh-82eafbf5-9f43-489a-80d2-61c7dc6ef542.json b/crates/atuin-client/tests/data/xonsh/xonsh-82eafbf5-9f43-489a-80d2-61c7dc6ef542.json
deleted file mode 100644
index 339a09f1..00000000
--- a/crates/atuin-client/tests/data/xonsh/xonsh-82eafbf5-9f43-489a-80d2-61c7dc6ef542.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{"locs": [ 69, 3371, 3451, 3978],
- "index": {"offsets":{"__total__":0,"cmds":[{"__total__":10,"cwd":18,"inp":78,"rtn":96,"ts":[106,125,105]},{"__total__":149,"cwd":157,"inp":217,"rtn":234,"ts":[244,263,243]},9],"env":{"ATUIN_SESSION":314,"BASH_COMPLETIONS":370,"COLORTERM":433,"DBUS_SESSION_BUS_ADDRESS":474,"DESKTOP_SESSION":529,"DISPLAY":550,"GDMSESSION":570,"GIO_LAUNCHED_DESKTOP_FILE":609,"GIO_LAUNCHED_DESKTOP_FILE_PID":704,"GJS_DEBUG_OUTPUT":734,"GJS_DEBUG_TOPICS":764,"GNOME_DESKTOP_SESSION_ID":811,"GNOME_SETUP_DISPLAY":856,"GNOME_SHELL_SESSION_MODE":890,"GTK_MODULES":915,"HOME":942,"IM_CONFIG_PHASE":976,"INVOCATION_ID":998,"JOURNAL_STREAM":1052,"LANG":1071,"LOGNAME":1097,"MANAGERPID":1118,"MOZ_ENABLE_WAYLAND":1148,"PATH":1161,"PWD":1736,"PYENV_DIR":1802,"PYENV_HOOK_PATH":1874,"PYENV_ROOT":2048,"PYENV_SHELL":2086,"PYENV_VERSION":2111,"QT_ACCESSIBILITY":2141,"QT_IM_MODULE":2162,"SESSION_MANAGER":2189,"SHELL":2279,"SHLVL":2303,"SSH_AGENT_LAUNCHER":2330,"SSH_AUTH_SOCK":2364,"SSL_CERT_DIR":2415,"SSL_CERT_FILE":2458,"SYSTEMD_EXEC_PID":2525,"TERM":2541,"TERM_PROGRAM":2575,"TERM_PROGRAM_VERSION":2610,"THREAD_SUBPROCS":2657,"USER":2670,"USERNAME":2689,"WAYLAND_DISPLAY":2715,"WEZTERM_CONFIG_DIR":2750,"WEZTERM_CONFIG_FILE":2806,"WEZTERM_EXECUTABLE":2874,"WEZTERM_EXECUTABLE_DIR":2927,"WEZTERM_PANE":2957,"WEZTERM_UNIX_SOCKET":2986,"XAUTHORITY":3047,"XDG_CONFIG_DIRS":3116,"XDG_CURRENT_DESKTOP":3176,"XDG_DATA_DIRS":3209,"XDG_MENU_PREFIX":3316,"XDG_RUNTIME_DIR":3345,"XDG_SESSION_CLASS":3387,"XDG_SESSION_DESKTOP":3418,"XDG_SESSION_TYPE":3448,"XMODIFIERS":3473,"XONSHRC":3496,"XONSHRC_DIR":3594,"XONSH_CAPTURE_ALWAYS":3674,"XONSH_CONFIG_DIR":3698,"XONSH_DATA_DIR":3747,"XONSH_INTERACTIVE":3805,"XONSH_LOGIN":3825,"XONSH_VERSION":3847,"__total__":296},"locked":3869,"sessionid":3889,"ts":[3936,3956,3935]},"sizes":{"__total__":3978,"cmds":[{"__total__":137,"cwd":51,"inp":9,"rtn":1,"ts":[17,18,40]},{"__total__":136,"cwd":51,"inp":8,"rtn":1,"ts":[17,18,40]},278],"env":{"ATUIN_SESSION":34,"BASH_COMPLETIONS":48,"COLORTERM":11,"DBUS_SESSION_BUS_ADDRESS":34,"DESKTOP_SESSION":8,"DISPLAY":4,"GDMSESSION":8,"GIO_LAUNCHED_DESKTOP_FILE":60,"GIO_LAUNCHED_DESKTOP_FILE_PID":8,"GJS_DEBUG_OUTPUT":8,"GJS_DEBUG_TOPICS":17,"GNOME_DESKTOP_SESSION_ID":20,"GNOME_SETUP_DISPLAY":4,"GNOME_SHELL_SESSION_MODE":8,"GTK_MODULES":17,"HOME":13,"IM_CONFIG_PHASE":3,"INVOCATION_ID":34,"JOURNAL_STREAM":9,"LANG":13,"LOGNAME":5,"MANAGERPID":6,"MOZ_ENABLE_WAYLAND":3,"PATH":566,"PWD":51,"PYENV_DIR":51,"PYENV_HOOK_PATH":158,"PYENV_ROOT":21,"PYENV_SHELL":6,"PYENV_VERSION":8,"QT_ACCESSIBILITY":3,"QT_IM_MODULE":6,"SESSION_MANAGER":79,"SHELL":13,"SHLVL":3,"SSH_AGENT_LAUNCHER":15,"SSH_AUTH_SOCK":33,"SSL_CERT_DIR":24,"SSL_CERT_FILE":45,"SYSTEMD_EXEC_PID":6,"TERM":16,"TERM_PROGRAM":9,"TERM_PROGRAM_VERSION":26,"THREAD_SUBPROCS":3,"USER":5,"USERNAME":5,"WAYLAND_DISPLAY":11,"WEZTERM_CONFIG_DIR":31,"WEZTERM_CONFIG_FILE":44,"WEZTERM_EXECUTABLE":25,"WEZTERM_EXECUTABLE_DIR":12,"WEZTERM_PANE":4,"WEZTERM_UNIX_SOCKET":45,"XAUTHORITY":48,"XDG_CONFIG_DIRS":35,"XDG_CURRENT_DESKTOP":14,"XDG_DATA_DIRS":86,"XDG_MENU_PREFIX":8,"XDG_RUNTIME_DIR":19,"XDG_SESSION_CLASS":6,"XDG_SESSION_DESKTOP":8,"XDG_SESSION_TYPE":9,"XMODIFIERS":10,"XONSHRC":81,"XONSHRC_DIR":54,"XONSH_CAPTURE_ALWAYS":2,"XONSH_CONFIG_DIR":29,"XONSH_DATA_DIR":35,"XONSH_INTERACTIVE":3,"XONSH_LOGIN":3,"XONSH_VERSION":8,"__total__":3561},"locked":5,"sessionid":38,"ts":[18,18,41]}},
- "data": {"cmds": [{"cwd": "\/home\/user\/Documents\/code\/atuin\/atuin-client", "inp": "false\n", "rtn": 1, "ts": [1707241291.142516, 1707241291.1527853]
-}
-, {"cwd": "\/home\/user\/Documents\/code\/atuin\/atuin-client", "inp": "exit\n", "rtn": 0, "ts": [1707241292.271584, 1707241292.2758434]
-}
-]
-, "env": {"ATUIN_SESSION": "018d7f82ad167dc4888ca0bf294d2bfd", "BASH_COMPLETIONS": "\/usr\/share\/bash-completion\/bash_completion", "COLORTERM": "truecolor", "DBUS_SESSION_BUS_ADDRESS": "unix:path=\/run\/user\/1000\/bus", "DESKTOP_SESSION": "ubuntu", "DISPLAY": ":0", "GDMSESSION": "ubuntu", "GIO_LAUNCHED_DESKTOP_FILE": "\/usr\/share\/applications\/org.wezfurlong.wezterm.desktop", "GIO_LAUNCHED_DESKTOP_FILE_PID": "196859", "GJS_DEBUG_OUTPUT": "stderr", "GJS_DEBUG_TOPICS": "JS ERROR;JS LOG", "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated", "GNOME_SETUP_DISPLAY": ":1", "GNOME_SHELL_SESSION_MODE": "ubuntu", "GTK_MODULES": "gail:atk-bridge", "HOME": "\/home\/user", "IM_CONFIG_PHASE": "1", "INVOCATION_ID": "4f121e7ad56c41a6b84aa3cbe1ad61fa", "JOURNAL_STREAM": "8:37187", "LANG": "en_US.UTF-8", "LOGNAME": "user", "MANAGERPID": "2118", "MOZ_ENABLE_WAYLAND": "1", "PATH": "\/home\/user\/.pyenv\/versions\/3.12.0\/bin:\/home\/user\/.pyenv\/libexec:\/home\/user\/.pyenv\/plugins\/python-build\/bin:\/home\/user\/.pyenv\/plugins\/pyenv-virtualenv\/bin:\/home\/user\/.pyenv\/plugins\/pyenv-update\/bin:\/home\/user\/.pyenv\/plugins\/pyenv-doctor\/bin:\/home\/user\/.cargo\/bin:\/home\/user\/.pyenv\/shims:\/home\/user\/.pyenv\/bin:\/home\/user\/bin:\/home\/user\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games:\/snap\/bin:\/snap\/bin:\/home\/user\/.local\/share\/JetBrains\/Toolbox\/scripts", "PWD": "\/home\/user\/Documents\/code\/atuin\/atuin-client", "PYENV_DIR": "\/home\/user\/Documents\/code\/atuin\/atuin-client", "PYENV_HOOK_PATH": "\/home\/user\/.pyenv\/pyenv.d:\/usr\/local\/etc\/pyenv.d:\/etc\/pyenv.d:\/usr\/lib\/pyenv\/hooks:\/home\/user\/.pyenv\/plugins\/pyenv-virtualenv\/etc\/pyenv.d", "PYENV_ROOT": "\/home\/user\/.pyenv", "PYENV_SHELL": "bash", "PYENV_VERSION": "3.12.0", "QT_ACCESSIBILITY": "1", "QT_IM_MODULE": "ibus", "SESSION_MANAGER": "local\/box:@\/tmp\/.ICE-unix\/2452,unix\/box:\/tmp\/.ICE-unix\/2452", "SHELL": "\/bin\/bash", "SHLVL": "1", "SSH_AGENT_LAUNCHER": "gnome-keyring", "SSH_AUTH_SOCK": "\/run\/user\/1000\/keyring\/ssh", "SSL_CERT_DIR": "\/usr\/lib\/ssl\/certs", "SSL_CERT_FILE": "\/usr\/lib\/ssl\/certs\/ca-certificates.crt", "SYSTEMD_EXEC_PID": "2470", "TERM": "xterm-256color", "TERM_PROGRAM": "WezTerm", "TERM_PROGRAM_VERSION": "20240127-113634-bbcac864", "THREAD_SUBPROCS": "1", "USER": "user", "USERNAME": "user", "WAYLAND_DISPLAY": "wayland-0", "WEZTERM_CONFIG_DIR": "\/home\/user\/.config\/wezterm", "WEZTERM_CONFIG_FILE": "\/home\/user\/.config\/wezterm\/wezterm.lua", "WEZTERM_EXECUTABLE": "\/usr\/bin\/wezterm-gui", "WEZTERM_EXECUTABLE_DIR": "\/usr\/bin", "WEZTERM_PANE": "41", "WEZTERM_UNIX_SOCKET": "\/run\/user\/1000\/wezterm\/gui-sock-196859", "XAUTHORITY": "\/run\/user\/1000\/.mutter-Xwaylandauth.T986H2", "XDG_CONFIG_DIRS": "\/etc\/xdg\/xdg-ubuntu:\/etc\/xdg", "XDG_CURRENT_DESKTOP": "ubuntu:GNOME", "XDG_DATA_DIRS": "\/usr\/share\/ubuntu:\/usr\/local\/share\/:\/usr\/share\/:\/var\/lib\/snapd\/desktop", "XDG_MENU_PREFIX": "gnome-", "XDG_RUNTIME_DIR": "\/run\/user\/1000", "XDG_SESSION_CLASS": "user", "XDG_SESSION_DESKTOP": "ubuntu", "XDG_SESSION_TYPE": "wayland", "XMODIFIERS": "@im=ibus", "XONSHRC": "\/etc\/xonsh\/xonshrc:\/home\/user\/.config\/xonsh\/rc.xsh:\/home\/user\/.xonshrc", "XONSHRC_DIR": "\/etc\/xonsh\/rc.d:\/home\/user\/.config\/xonsh\/rc.d", "XONSH_CAPTURE_ALWAYS": "", "XONSH_CONFIG_DIR": "\/home\/user\/.config\/xonsh", "XONSH_DATA_DIR": "\/home\/user\/.local\/share\/xonsh", "XONSH_INTERACTIVE": "1", "XONSH_LOGIN": "1", "XONSH_VERSION": "0.14.2"}
-, "locked": false, "sessionid": "82eafbf5-9f43-489a-80d2-61c7dc6ef542", "ts": [1707241286.9361255, 1707241292.3081477]
-}
-
-}
diff --git a/crates/atuin-client/tests/data/xonsh/xonsh-de16af90-9148-4461-8df3-5b5659c6420d.json b/crates/atuin-client/tests/data/xonsh/xonsh-de16af90-9148-4461-8df3-5b5659c6420d.json
deleted file mode 100644
index 72694f04..00000000
--- a/crates/atuin-client/tests/data/xonsh/xonsh-de16af90-9148-4461-8df3-5b5659c6420d.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{"locs": [ 69, 3372, 3452, 3936],
- "index": {"offsets":{"__total__":0,"cmds":[{"__total__":10,"cwd":18,"inp":64,"rtn":94,"ts":[104,124,103]},{"__total__":148,"cwd":156,"inp":202,"rtn":220,"ts":[230,250,229]},9],"env":{"ATUIN_SESSION":300,"BASH_COMPLETIONS":356,"COLORTERM":419,"DBUS_SESSION_BUS_ADDRESS":460,"DESKTOP_SESSION":515,"DISPLAY":536,"GDMSESSION":556,"GIO_LAUNCHED_DESKTOP_FILE":595,"GIO_LAUNCHED_DESKTOP_FILE_PID":690,"GJS_DEBUG_OUTPUT":720,"GJS_DEBUG_TOPICS":750,"GNOME_DESKTOP_SESSION_ID":797,"GNOME_SETUP_DISPLAY":842,"GNOME_SHELL_SESSION_MODE":876,"GTK_MODULES":901,"HOME":928,"IM_CONFIG_PHASE":962,"INVOCATION_ID":984,"JOURNAL_STREAM":1038,"LANG":1057,"LOGNAME":1083,"MANAGERPID":1104,"MOZ_ENABLE_WAYLAND":1134,"PATH":1147,"PWD":1722,"PYENV_DIR":1774,"PYENV_HOOK_PATH":1832,"PYENV_ROOT":2006,"PYENV_SHELL":2044,"PYENV_VERSION":2069,"QT_ACCESSIBILITY":2099,"QT_IM_MODULE":2120,"SESSION_MANAGER":2147,"SHELL":2237,"SHLVL":2261,"SSH_AGENT_LAUNCHER":2288,"SSH_AUTH_SOCK":2322,"SSL_CERT_DIR":2373,"SSL_CERT_FILE":2416,"SYSTEMD_EXEC_PID":2483,"TERM":2499,"TERM_PROGRAM":2533,"TERM_PROGRAM_VERSION":2568,"THREAD_SUBPROCS":2615,"USER":2628,"USERNAME":2647,"WAYLAND_DISPLAY":2673,"WEZTERM_CONFIG_DIR":2708,"WEZTERM_CONFIG_FILE":2764,"WEZTERM_EXECUTABLE":2832,"WEZTERM_EXECUTABLE_DIR":2885,"WEZTERM_PANE":2915,"WEZTERM_UNIX_SOCKET":2944,"XAUTHORITY":3005,"XDG_CONFIG_DIRS":3074,"XDG_CURRENT_DESKTOP":3134,"XDG_DATA_DIRS":3167,"XDG_MENU_PREFIX":3274,"XDG_RUNTIME_DIR":3303,"XDG_SESSION_CLASS":3345,"XDG_SESSION_DESKTOP":3376,"XDG_SESSION_TYPE":3406,"XMODIFIERS":3431,"XONSHRC":3454,"XONSHRC_DIR":3552,"XONSH_CAPTURE_ALWAYS":3632,"XONSH_CONFIG_DIR":3656,"XONSH_DATA_DIR":3705,"XONSH_INTERACTIVE":3763,"XONSH_LOGIN":3783,"XONSH_VERSION":3805,"__total__":282},"locked":3827,"sessionid":3847,"ts":[3894,3914,3893]},"sizes":{"__total__":3936,"cmds":[{"__total__":136,"cwd":37,"inp":21,"rtn":1,"ts":[18,18,41]},{"__total__":123,"cwd":37,"inp":9,"rtn":1,"ts":[18,17,40]},264],"env":{"ATUIN_SESSION":34,"BASH_COMPLETIONS":48,"COLORTERM":11,"DBUS_SESSION_BUS_ADDRESS":34,"DESKTOP_SESSION":8,"DISPLAY":4,"GDMSESSION":8,"GIO_LAUNCHED_DESKTOP_FILE":60,"GIO_LAUNCHED_DESKTOP_FILE_PID":8,"GJS_DEBUG_OUTPUT":8,"GJS_DEBUG_TOPICS":17,"GNOME_DESKTOP_SESSION_ID":20,"GNOME_SETUP_DISPLAY":4,"GNOME_SHELL_SESSION_MODE":8,"GTK_MODULES":17,"HOME":13,"IM_CONFIG_PHASE":3,"INVOCATION_ID":34,"JOURNAL_STREAM":9,"LANG":13,"LOGNAME":5,"MANAGERPID":6,"MOZ_ENABLE_WAYLAND":3,"PATH":566,"PWD":37,"PYENV_DIR":37,"PYENV_HOOK_PATH":158,"PYENV_ROOT":21,"PYENV_SHELL":6,"PYENV_VERSION":8,"QT_ACCESSIBILITY":3,"QT_IM_MODULE":6,"SESSION_MANAGER":79,"SHELL":13,"SHLVL":3,"SSH_AGENT_LAUNCHER":15,"SSH_AUTH_SOCK":33,"SSL_CERT_DIR":24,"SSL_CERT_FILE":45,"SYSTEMD_EXEC_PID":6,"TERM":16,"TERM_PROGRAM":9,"TERM_PROGRAM_VERSION":26,"THREAD_SUBPROCS":3,"USER":5,"USERNAME":5,"WAYLAND_DISPLAY":11,"WEZTERM_CONFIG_DIR":31,"WEZTERM_CONFIG_FILE":44,"WEZTERM_EXECUTABLE":25,"WEZTERM_EXECUTABLE_DIR":12,"WEZTERM_PANE":4,"WEZTERM_UNIX_SOCKET":45,"XAUTHORITY":48,"XDG_CONFIG_DIRS":35,"XDG_CURRENT_DESKTOP":14,"XDG_DATA_DIRS":86,"XDG_MENU_PREFIX":8,"XDG_RUNTIME_DIR":19,"XDG_SESSION_CLASS":6,"XDG_SESSION_DESKTOP":8,"XDG_SESSION_TYPE":9,"XMODIFIERS":10,"XONSHRC":81,"XONSHRC_DIR":54,"XONSH_CAPTURE_ALWAYS":2,"XONSH_CONFIG_DIR":29,"XONSH_DATA_DIR":35,"XONSH_INTERACTIVE":3,"XONSH_LOGIN":3,"XONSH_VERSION":8,"__total__":3533},"locked":5,"sessionid":38,"ts":[18,18,41]}},
- "data": {"cmds": [{"cwd": "\/home\/user\/Documents\/code\/atuin", "inp": "echo hello world!\n", "rtn": 0, "ts": [1707193079.4782722, 1707193079.4829233]
-}
-, {"cwd": "\/home\/user\/Documents\/code\/atuin", "inp": "ls -l\n", "rtn": 0, "ts": [1707193081.7063284, 1707193081.727617]
-}
-]
-, "env": {"ATUIN_SESSION": "018d7ca2e953742e9826012f30115040", "BASH_COMPLETIONS": "\/usr\/share\/bash-completion\/bash_completion", "COLORTERM": "truecolor", "DBUS_SESSION_BUS_ADDRESS": "unix:path=\/run\/user\/1000\/bus", "DESKTOP_SESSION": "ubuntu", "DISPLAY": ":0", "GDMSESSION": "ubuntu", "GIO_LAUNCHED_DESKTOP_FILE": "\/usr\/share\/applications\/org.wezfurlong.wezterm.desktop", "GIO_LAUNCHED_DESKTOP_FILE_PID": "196859", "GJS_DEBUG_OUTPUT": "stderr", "GJS_DEBUG_TOPICS": "JS ERROR;JS LOG", "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated", "GNOME_SETUP_DISPLAY": ":1", "GNOME_SHELL_SESSION_MODE": "ubuntu", "GTK_MODULES": "gail:atk-bridge", "HOME": "\/home\/user", "IM_CONFIG_PHASE": "1", "INVOCATION_ID": "4f121e7ad56c41a6b84aa3cbe1ad61fa", "JOURNAL_STREAM": "8:37187", "LANG": "en_US.UTF-8", "LOGNAME": "user", "MANAGERPID": "2118", "MOZ_ENABLE_WAYLAND": "1", "PATH": "\/home\/user\/.pyenv\/versions\/3.12.0\/bin:\/home\/user\/.pyenv\/libexec:\/home\/user\/.pyenv\/plugins\/python-build\/bin:\/home\/user\/.pyenv\/plugins\/pyenv-virtualenv\/bin:\/home\/user\/.pyenv\/plugins\/pyenv-update\/bin:\/home\/user\/.pyenv\/plugins\/pyenv-doctor\/bin:\/home\/user\/.cargo\/bin:\/home\/user\/.pyenv\/shims:\/home\/user\/.pyenv\/bin:\/home\/user\/bin:\/home\/user\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games:\/snap\/bin:\/snap\/bin:\/home\/user\/.local\/share\/JetBrains\/Toolbox\/scripts", "PWD": "\/home\/user\/Documents\/code\/atuin", "PYENV_DIR": "\/home\/user\/Documents\/code\/atuin", "PYENV_HOOK_PATH": "\/home\/user\/.pyenv\/pyenv.d:\/usr\/local\/etc\/pyenv.d:\/etc\/pyenv.d:\/usr\/lib\/pyenv\/hooks:\/home\/user\/.pyenv\/plugins\/pyenv-virtualenv\/etc\/pyenv.d", "PYENV_ROOT": "\/home\/user\/.pyenv", "PYENV_SHELL": "bash", "PYENV_VERSION": "3.12.0", "QT_ACCESSIBILITY": "1", "QT_IM_MODULE": "ibus", "SESSION_MANAGER": "local\/box:@\/tmp\/.ICE-unix\/2452,unix\/box:\/tmp\/.ICE-unix\/2452", "SHELL": "\/bin\/bash", "SHLVL": "1", "SSH_AGENT_LAUNCHER": "gnome-keyring", "SSH_AUTH_SOCK": "\/run\/user\/1000\/keyring\/ssh", "SSL_CERT_DIR": "\/usr\/lib\/ssl\/certs", "SSL_CERT_FILE": "\/usr\/lib\/ssl\/certs\/ca-certificates.crt", "SYSTEMD_EXEC_PID": "2470", "TERM": "xterm-256color", "TERM_PROGRAM": "WezTerm", "TERM_PROGRAM_VERSION": "20240127-113634-bbcac864", "THREAD_SUBPROCS": "1", "USER": "user", "USERNAME": "user", "WAYLAND_DISPLAY": "wayland-0", "WEZTERM_CONFIG_DIR": "\/home\/user\/.config\/wezterm", "WEZTERM_CONFIG_FILE": "\/home\/user\/.config\/wezterm\/wezterm.lua", "WEZTERM_EXECUTABLE": "\/usr\/bin\/wezterm-gui", "WEZTERM_EXECUTABLE_DIR": "\/usr\/bin", "WEZTERM_PANE": "38", "WEZTERM_UNIX_SOCKET": "\/run\/user\/1000\/wezterm\/gui-sock-196859", "XAUTHORITY": "\/run\/user\/1000\/.mutter-Xwaylandauth.T986H2", "XDG_CONFIG_DIRS": "\/etc\/xdg\/xdg-ubuntu:\/etc\/xdg", "XDG_CURRENT_DESKTOP": "ubuntu:GNOME", "XDG_DATA_DIRS": "\/usr\/share\/ubuntu:\/usr\/local\/share\/:\/usr\/share\/:\/var\/lib\/snapd\/desktop", "XDG_MENU_PREFIX": "gnome-", "XDG_RUNTIME_DIR": "\/run\/user\/1000", "XDG_SESSION_CLASS": "user", "XDG_SESSION_DESKTOP": "ubuntu", "XDG_SESSION_TYPE": "wayland", "XMODIFIERS": "@im=ibus", "XONSHRC": "\/etc\/xonsh\/xonshrc:\/home\/user\/.config\/xonsh\/rc.xsh:\/home\/user\/.xonshrc", "XONSHRC_DIR": "\/etc\/xonsh\/rc.d:\/home\/user\/.config\/xonsh\/rc.d", "XONSH_CAPTURE_ALWAYS": "", "XONSH_CONFIG_DIR": "\/home\/user\/.config\/xonsh", "XONSH_DATA_DIR": "\/home\/user\/.local\/share\/xonsh", "XONSH_INTERACTIVE": "1", "XONSH_LOGIN": "1", "XONSH_VERSION": "0.14.2"}
-, "locked": false, "sessionid": "de16af90-9148-4461-8df3-5b5659c6420d", "ts": [1707193067.8615997, 1707193089.2513068]
-}
-
-}
diff --git a/crates/atuin-client/src/api_client.rs b/crates/turtle/src/atuin_client/api_client.rs
index ca2fc661..7955c2da 100644
--- a/crates/atuin-client/src/api_client.rs
+++ b/crates/turtle/src/atuin_client/api_client.rs
@@ -7,13 +7,14 @@ use reqwest::{
Response, StatusCode, Url,
header::{AUTHORIZATION, HeaderMap, USER_AGENT},
};
+use tracing::debug;
-use atuin_common::{
+use crate::atuin_common::{
api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ATUIN_VERSION},
record::{EncryptedData, HostId, Record, RecordIdx},
tls::ensure_crypto_provider,
};
-use atuin_common::{
+use crate::atuin_common::{
api::{
AddHistoryRequest, ChangePasswordRequest, CountResponse, DeleteHistoryRequest,
ErrorResponse, LoginRequest, LoginResponse, MeResponse, RegisterResponse, StatusResponse,
@@ -26,7 +27,7 @@ use semver::Version;
use time::OffsetDateTime;
use time::format_description::well_known::Rfc3339;
-use crate::{history::History, sync::hash_str, utils::get_host_user};
+use crate::atuin_client::{history::History, sync::hash_str, utils::get_host_user};
static APP_USER_AGENT: &str = concat!("atuin/", env!("CARGO_PKG_VERSION"),);
diff --git a/crates/atuin-client/src/auth.rs b/crates/turtle/src/atuin_client/auth.rs
index 1031c11f..b770c488 100644
--- a/crates/atuin-client/src/auth.rs
+++ b/crates/turtle/src/atuin_client/auth.rs
@@ -2,12 +2,15 @@ use async_trait::async_trait;
use eyre::{Context, Result, bail};
use reqwest::{Url, header::USER_AGENT};
-use atuin_common::{
- api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ChangePasswordRequest, LoginRequest},
- tls::ensure_crypto_provider,
+use crate::{
+ atuin_client::api_client,
+ atuin_common::{
+ api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ChangePasswordRequest, LoginRequest},
+ tls::ensure_crypto_provider,
+ },
};
-use crate::settings::Settings;
+use crate::atuin_client::settings::Settings;
static APP_USER_AGENT: &str = concat!("atuin/", env!("CARGO_PKG_VERSION"));
@@ -42,12 +45,7 @@ pub enum MutateResponse {
#[async_trait]
pub trait AuthClient: Send + Sync {
/// Log in with username + password, optionally providing a TOTP code.
- async fn login(
- &self,
- username: &str,
- password: &str,
- totp_code: Option<&str>,
- ) -> Result<AuthResponse>;
+ async fn login(&self, username: &str, password: &str) -> Result<AuthResponse>;
/// Register a new account.
async fn register(&self, username: &str, email: &str, password: &str) -> Result<AuthResponse>;
@@ -129,14 +127,9 @@ impl LegacyAuthClient {
#[async_trait]
impl AuthClient for LegacyAuthClient {
- async fn login(
- &self,
- username: &str,
- password: &str,
- _totp_code: Option<&str>,
- ) -> Result<AuthResponse> {
+ async fn login(&self, username: &str, password: &str) -> Result<AuthResponse> {
// The legacy server has no 2FA support; totp_code is ignored.
- let resp = crate::api_client::login(
+ let resp = api_client::login(
&self.address,
LoginRequest {
username: username.to_string(),
@@ -152,7 +145,7 @@ impl AuthClient for LegacyAuthClient {
}
async fn register(&self, username: &str, email: &str, password: &str) -> Result<AuthResponse> {
- let resp = crate::api_client::register(&self.address, username, email, password).await?;
+ let resp = api_client::register(&self.address, username, email, password).await?;
Ok(AuthResponse::Success {
session: resp.session,
auth_type: resp.auth.or(Some("cli".into())),
diff --git a/crates/atuin-client/src/database.rs b/crates/turtle/src/atuin_client/database.rs
index 946c1eb0..75b1200c 100644
--- a/crates/atuin-client/src/database.rs
+++ b/crates/turtle/src/atuin_client/database.rs
@@ -5,9 +5,9 @@ use std::{
time::Duration,
};
-use crate::history::{AUTHOR_FILTER_ALL_AGENT, AUTHOR_FILTER_ALL_USER, KNOWN_AGENTS};
+use crate::atuin_client::history::{AUTHOR_FILTER_ALL_AGENT, AUTHOR_FILTER_ALL_USER, KNOWN_AGENTS};
+use crate::atuin_common::utils;
use async_trait::async_trait;
-use atuin_common::utils;
use fs_err as fs;
use itertools::Itertools;
use rand::{Rng, distributions::Alphanumeric};
@@ -20,9 +20,10 @@ use sqlx::{
},
};
use time::OffsetDateTime;
+use tracing::debug;
use uuid::Uuid;
-use crate::{
+use crate::atuin_client::{
history::{HistoryId, HistoryStats},
utils::get_host_user,
};
@@ -969,7 +970,7 @@ impl SqlBuilderExt for SqlBuilder {
#[cfg(test)]
mod test {
- use crate::settings::test_local_timeout;
+ use crate::atuin_client::settings::test_local_timeout;
use super::*;
use std::time::{Duration, Instant};
diff --git a/crates/atuin-client/src/distro.rs b/crates/turtle/src/atuin_client/distro.rs
index dead8355..dead8355 100644
--- a/crates/atuin-client/src/distro.rs
+++ b/crates/turtle/src/atuin_client/distro.rs
diff --git a/crates/atuin-client/src/encryption.rs b/crates/turtle/src/atuin_client/encryption.rs
index f2032482..20a0cd90 100644
--- a/crates/atuin-client/src/encryption.rs
+++ b/crates/turtle/src/atuin_client/encryption.rs
@@ -22,7 +22,7 @@ use rmp::{Marker, decode::Bytes};
use serde::{Deserialize, Serialize};
use time::{OffsetDateTime, format_description::well_known::Rfc3339, macros::format_description};
-use crate::{history::History, settings::Settings};
+use crate::atuin_client::{history::History, settings::Settings};
#[derive(Debug, Serialize, Deserialize)]
pub struct EncryptedHistory {
diff --git a/crates/atuin-client/src/history.rs b/crates/turtle/src/atuin_client/history.rs
index aa0d84d5..cef65115 100644
--- a/crates/atuin-client/src/history.rs
+++ b/crates/turtle/src/atuin_client/history.rs
@@ -5,14 +5,14 @@ use rmp::{Marker, decode::Bytes};
use std::env;
use std::fmt::Display;
-use atuin_common::record::DecryptedData;
-use atuin_common::utils::uuid_v7;
+use crate::atuin_common::record::DecryptedData;
+use crate::atuin_common::utils::uuid_v7;
use eyre::{Result, bail, eyre};
-use crate::secrets::SECRET_PATTERNS_RE;
-use crate::settings::Settings;
-use crate::utils::get_host_user;
+use crate::atuin_client::secrets::SECRET_PATTERNS_RE;
+use crate::atuin_client::settings::Settings;
+use crate::atuin_client::utils::get_host_user;
use time::OffsetDateTime;
mod builder;
@@ -381,7 +381,7 @@ impl History {
///
/// ## Examples
/// ```
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// let history: History = History::import()
/// .timestamp(time::OffsetDateTime::now_utc())
@@ -392,7 +392,7 @@ impl History {
///
/// If shell history contains more information, it can be added to the builder:
/// ```
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// let history: History = History::import()
/// .timestamp(time::OffsetDateTime::now_utc())
@@ -408,7 +408,7 @@ impl History {
/// is forced at compile time:
///
/// ```compile_fail
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// // this will not compile because timestamp is missing
/// let history: History = History::import()
@@ -428,7 +428,7 @@ impl History {
///
/// ## Examples
/// ```rust
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// let history: History = History::capture()
/// .timestamp(time::OffsetDateTime::now_utc())
@@ -441,7 +441,7 @@ impl History {
/// Command without any required info cannot be captured, which is forced at compile time:
///
/// ```compile_fail
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// // this will not compile because `cwd` is missing
/// let history: History = History::capture()
@@ -466,7 +466,7 @@ impl History {
///
/// ## Examples
/// ```rust
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// let history: History = History::daemon()
/// .timestamp(time::OffsetDateTime::now_utc())
@@ -481,7 +481,7 @@ impl History {
/// Command without any required info cannot be captured, which is forced at compile time:
///
/// ```compile_fail
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// // this will not compile because `hostname` is missing
/// let history: History = History::daemon()
@@ -501,7 +501,7 @@ impl History {
/// All fields are required, as they are all present in the database.
///
/// ```compile_fail
- /// use atuin_client::history::History;
+ /// use crate::atuin_client::history::History;
///
/// // this will not compile because `id` field is missing
/// let history: History = History::from_db()
diff --git a/crates/atuin-client/src/history/builder.rs b/crates/turtle/src/atuin_client/history/builder.rs
index 72a505fd..72a505fd 100644
--- a/crates/atuin-client/src/history/builder.rs
+++ b/crates/turtle/src/atuin_client/history/builder.rs
diff --git a/crates/atuin-client/src/history/store.rs b/crates/turtle/src/atuin_client/history/store.rs
index ce7b43a1..66d9db47 100644
--- a/crates/atuin-client/src/history/store.rs
+++ b/crates/turtle/src/atuin_client/history/store.rs
@@ -3,12 +3,13 @@ use std::{collections::HashSet, fmt::Write, time::Duration};
use eyre::{Result, bail, eyre};
use indicatif::{ProgressBar, ProgressState, ProgressStyle};
use rmp::decode::Bytes;
+use tracing::debug;
-use crate::{
+use crate::atuin_client::{
database::{Database, current_context},
record::{encryption::PASETO_V4, sqlite_store::SqliteStore, store::Store},
};
-use atuin_common::record::{DecryptedData, Host, HostId, Record, RecordId, RecordIdx};
+use crate::atuin_common::record::{DecryptedData, Host, HostId, Record, RecordId, RecordIdx};
use super::{HISTORY_TAG, HISTORY_VERSION, HISTORY_VERSION_V0, History, HistoryId};
@@ -361,10 +362,10 @@ impl HistoryStore {
#[cfg(test)]
mod tests {
- use atuin_common::record::DecryptedData;
+ use crate::atuin_common::record::DecryptedData;
use time::macros::datetime;
- use crate::history::{HISTORY_VERSION, store::HistoryRecord};
+ use crate::atuin_client::history::{HISTORY_VERSION, store::HistoryRecord};
use super::History;
diff --git a/crates/atuin-client/src/import/bash.rs b/crates/turtle/src/atuin_client/import/bash.rs
index 99a44a58..d92fdfa0 100644
--- a/crates/atuin-client/src/import/bash.rs
+++ b/crates/turtle/src/atuin_client/import/bash.rs
@@ -5,10 +5,11 @@ use directories::UserDirs;
use eyre::{Result, eyre};
use itertools::Itertools;
use time::{Duration, OffsetDateTime};
+use tracing::warn;
use super::{Importer, Loader, get_histfile_path, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Debug)]
pub struct Bash {
@@ -130,7 +131,7 @@ mod test {
use itertools::{Itertools, assert_equal};
- use crate::import::{Importer, tests::TestLoader};
+ use crate::atuin_client::import::{Importer, tests::TestLoader};
use super::Bash;
@@ -183,7 +184,7 @@ cd ../
);
assert_equal(
loader.buf.iter().map(|h| h.timestamp.unix_timestamp()),
- [1672918999, 1672919006, 1672919020],
+ [1_672_918_999, 1_672_919_006, 1_672_919_020],
)
}
diff --git a/crates/atuin-client/src/import/fish.rs b/crates/turtle/src/atuin_client/import/fish.rs
index 9fcf624c..1375bdd6 100644
--- a/crates/atuin-client/src/import/fish.rs
+++ b/crates/turtle/src/atuin_client/import/fish.rs
@@ -9,8 +9,8 @@ use eyre::{Result, eyre};
use time::OffsetDateTime;
use super::{Importer, Loader, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Debug)]
pub struct Fish {
diff --git a/crates/atuin-client/src/import/mod.rs b/crates/turtle/src/atuin_client/import/mod.rs
index 4a1c6af6..7726ead7 100644
--- a/crates/atuin-client/src/import/mod.rs
+++ b/crates/turtle/src/atuin_client/import/mod.rs
@@ -6,7 +6,7 @@ use async_trait::async_trait;
use eyre::{Result, bail};
use memchr::Memchr;
-use crate::history::History;
+use crate::atuin_client::history::History;
pub mod bash;
pub mod fish;
diff --git a/crates/atuin-client/src/import/nu.rs b/crates/turtle/src/atuin_client/import/nu.rs
index cae90ac4..c93789b8 100644
--- a/crates/atuin-client/src/import/nu.rs
+++ b/crates/turtle/src/atuin_client/import/nu.rs
@@ -9,8 +9,8 @@ use eyre::{Result, eyre};
use time::OffsetDateTime;
use super::{Importer, Loader, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Debug)]
pub struct Nu {
diff --git a/crates/atuin-client/src/import/nu_histdb.rs b/crates/turtle/src/atuin_client/import/nu_histdb.rs
index a13cb2b4..7de18369 100644
--- a/crates/atuin-client/src/import/nu_histdb.rs
+++ b/crates/turtle/src/atuin_client/import/nu_histdb.rs
@@ -10,8 +10,8 @@ use sqlx::{Pool, sqlite::SqlitePool};
use time::{Duration, OffsetDateTime};
use super::Importer;
-use crate::history::History;
-use crate::import::Loader;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::Loader;
#[derive(sqlx::FromRow, Debug)]
pub struct HistDbEntry {
diff --git a/crates/atuin-client/src/import/powershell.rs b/crates/turtle/src/atuin_client/import/powershell.rs
index 86fd007d..8adcc850 100644
--- a/crates/atuin-client/src/import/powershell.rs
+++ b/crates/turtle/src/atuin_client/import/powershell.rs
@@ -5,8 +5,8 @@ use std::path::PathBuf;
use time::{Duration, OffsetDateTime};
use super::{Importer, Loader, count_lines, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Debug)]
pub struct PowerShell {
diff --git a/crates/atuin-client/src/import/replxx.rs b/crates/turtle/src/atuin_client/import/replxx.rs
index 47d566cf..42f84df5 100644
--- a/crates/atuin-client/src/import/replxx.rs
+++ b/crates/turtle/src/atuin_client/import/replxx.rs
@@ -6,8 +6,8 @@ use eyre::{Result, eyre};
use time::{OffsetDateTime, PrimitiveDateTime, macros::format_description};
use super::{Importer, Loader, get_histfile_path, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Debug)]
pub struct Replxx {
diff --git a/crates/atuin-client/src/import/resh.rs b/crates/turtle/src/atuin_client/import/resh.rs
index df15f5b4..c5980c44 100644
--- a/crates/atuin-client/src/import/resh.rs
+++ b/crates/turtle/src/atuin_client/import/resh.rs
@@ -5,12 +5,12 @@ use directories::UserDirs;
use eyre::{Result, eyre};
use serde::Deserialize;
-use atuin_common::utils::uuid_v7;
+use crate::atuin_common::utils::uuid_v7;
use time::OffsetDateTime;
use super::{Importer, Loader, get_histfile_path, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
diff --git a/crates/atuin-client/src/import/xonsh.rs b/crates/turtle/src/atuin_client/import/xonsh.rs
index 6f38de68..a7217826 100644
--- a/crates/atuin-client/src/import/xonsh.rs
+++ b/crates/turtle/src/atuin_client/import/xonsh.rs
@@ -11,8 +11,8 @@ use uuid::Uuid;
use uuid::timestamp::{Timestamp, context::NoContext};
use super::{Importer, Loader, get_histdir_path};
-use crate::history::History;
-use crate::utils::get_host_user;
+use crate::atuin_client::history::History;
+use crate::atuin_client::utils::get_host_user;
// Note: both HistoryFile and HistoryData have other keys present in the JSON, we don't
// care about them so we leave them unspecified so as to avoid deserializing unnecessarily.
diff --git a/crates/atuin-client/src/import/xonsh_sqlite.rs b/crates/turtle/src/atuin_client/import/xonsh_sqlite.rs
index 7d50ac84..ceedf7e9 100644
--- a/crates/atuin-client/src/import/xonsh_sqlite.rs
+++ b/crates/turtle/src/atuin_client/import/xonsh_sqlite.rs
@@ -11,8 +11,8 @@ use uuid::Uuid;
use uuid::timestamp::{Timestamp, context::NoContext};
use super::{Importer, Loader, get_histfile_path};
-use crate::history::History;
-use crate::utils::get_host_user;
+use crate::atuin_client::history::History;
+use crate::atuin_client::utils::get_host_user;
#[derive(Debug, FromRow)]
struct HistDbEntry {
diff --git a/crates/atuin-client/src/import/zsh.rs b/crates/turtle/src/atuin_client/import/zsh.rs
index 11e2f371..e1fd813a 100644
--- a/crates/atuin-client/src/import/zsh.rs
+++ b/crates/turtle/src/atuin_client/import/zsh.rs
@@ -10,8 +10,8 @@ use eyre::{Result, eyre};
use time::OffsetDateTime;
use super::{Importer, Loader, get_histfile_path, unix_byte_lines};
-use crate::history::History;
-use crate::import::read_to_end;
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::read_to_end;
#[derive(Debug)]
pub struct Zsh {
diff --git a/crates/atuin-client/src/import/zsh_histdb.rs b/crates/turtle/src/atuin_client/import/zsh_histdb.rs
index bf44c3ad..f61bb74f 100644
--- a/crates/atuin-client/src/import/zsh_histdb.rs
+++ b/crates/turtle/src/atuin_client/import/zsh_histdb.rs
@@ -36,16 +36,16 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};
use async_trait::async_trait;
-use atuin_common::utils::uuid_v7;
+use crate::atuin_common::utils::uuid_v7;
use directories::UserDirs;
use eyre::{Result, eyre};
use sqlx::{Pool, sqlite::SqlitePool};
use time::PrimitiveDateTime;
use super::Importer;
-use crate::history::History;
-use crate::import::Loader;
-use crate::utils::{get_hostname, get_username};
+use crate::atuin_client::history::History;
+use crate::atuin_client::import::Loader;
+use crate::atuin_client::utils::{get_hostname, get_username};
#[derive(sqlx::FromRow, Debug)]
pub struct HistDbEntryCount {
diff --git a/crates/atuin-client/src/login.rs b/crates/turtle/src/atuin_client/login.rs
index 2545e890..ca4e16fe 100644
--- a/crates/atuin-client/src/login.rs
+++ b/crates/turtle/src/atuin_client/login.rs
@@ -1,11 +1,11 @@
use std::path::PathBuf;
-use atuin_common::api::LoginRequest;
+use crate::atuin_common::api::LoginRequest;
use eyre::{Context, Result, bail};
use tokio::fs::File;
use tokio::io::AsyncWriteExt;
-use crate::{
+use crate::atuin_client::{
api_client,
encryption::{decode_key, load_key},
record::{sqlite_store::SqliteStore, store::Store},
diff --git a/crates/atuin-client/src/logout.rs b/crates/turtle/src/atuin_client/logout.rs
index f720b302..343934b9 100644
--- a/crates/atuin-client/src/logout.rs
+++ b/crates/turtle/src/atuin_client/logout.rs
@@ -1,6 +1,6 @@
use eyre::Result;
-use crate::settings::Settings;
+use crate::atuin_client::settings::Settings;
pub async fn logout() -> Result<()> {
let meta = Settings::meta_store().await?;
diff --git a/crates/atuin-client/src/meta.rs b/crates/turtle/src/atuin_client/meta.rs
index 870f36d0..1eea7061 100644
--- a/crates/atuin-client/src/meta.rs
+++ b/crates/turtle/src/atuin_client/meta.rs
@@ -2,11 +2,12 @@ use std::path::Path;
use std::str::FromStr;
use std::time::Duration;
-use atuin_common::record::HostId;
+use crate::atuin_common::record::HostId;
use eyre::{Result, eyre};
use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePool, SqlitePoolOptions};
use time::{OffsetDateTime, format_description::well_known::Rfc3339};
use tokio::sync::OnceCell;
+use tracing::{debug, warn};
use uuid::Uuid;
// Filenames for the legacy plain-text files that we migrate from.
@@ -125,7 +126,7 @@ impl MetaStore {
return Ok(HostId(parsed));
}
- let uuid = atuin_common::utils::uuid_v7();
+ let uuid = crate::atuin_common::utils::uuid_v7();
self.set(KEY_HOST_ID, uuid.as_simple().to_string().as_ref())
.await?;
@@ -197,7 +198,7 @@ impl MetaStore {
return Ok(());
}
- let data_dir = crate::settings::Settings::effective_data_dir();
+ let data_dir = crate::atuin_client::settings::Settings::effective_data_dir();
// host_id — validate as UUID
let host_id_path = data_dir.join(LEGACY_HOST_ID_FILENAME);
diff --git a/crates/atuin-client/src/lib.rs b/crates/turtle/src/atuin_client/mod.rs
index cd7785e1..7f07f2e2 100644
--- a/crates/atuin-client/src/lib.rs
+++ b/crates/turtle/src/atuin_client/mod.rs
@@ -1,8 +1,3 @@
-#![deny(unsafe_code)]
-
-#[macro_use]
-extern crate log;
-
#[cfg(feature = "sync")]
pub mod api_client;
#[cfg(feature = "sync")]
diff --git a/crates/atuin-client/src/ordering.rs b/crates/turtle/src/atuin_client/ordering.rs
index 4e5ec84c..4e5ec84c 100644
--- a/crates/atuin-client/src/ordering.rs
+++ b/crates/turtle/src/atuin_client/ordering.rs
diff --git a/crates/atuin-client/src/plugin.rs b/crates/turtle/src/atuin_client/plugin.rs
index 6f351bf1..6f351bf1 100644
--- a/crates/atuin-client/src/plugin.rs
+++ b/crates/turtle/src/atuin_client/plugin.rs
diff --git a/crates/atuin-client/src/record/encryption.rs b/crates/turtle/src/atuin_client/record/encryption.rs
index 1e94d967..22dcdec3 100644
--- a/crates/atuin-client/src/record/encryption.rs
+++ b/crates/turtle/src/atuin_client/record/encryption.rs
@@ -1,4 +1,4 @@
-use atuin_common::record::{
+use crate::atuin_common::record::{
AdditionalData, DecryptedData, EncryptedData, Encryption, HostId, RecordId, RecordIdx,
};
use base64::{Engine, engine::general_purpose};
@@ -197,7 +197,7 @@ impl Assertions<'_> {
#[cfg(test)]
mod tests {
- use atuin_common::{
+ use crate::atuin_common::{
record::{Host, Record},
utils::uuid_v7,
};
diff --git a/crates/atuin-client/src/record/mod.rs b/crates/turtle/src/atuin_client/record/mod.rs
index c40fd395..c40fd395 100644
--- a/crates/atuin-client/src/record/mod.rs
+++ b/crates/turtle/src/atuin_client/record/mod.rs
diff --git a/crates/atuin-client/src/record/sqlite_store.rs b/crates/turtle/src/atuin_client/record/sqlite_store.rs
index ed51f3fd..5fab999d 100644
--- a/crates/atuin-client/src/record/sqlite_store.rs
+++ b/crates/turtle/src/atuin_client/record/sqlite_store.rs
@@ -13,11 +13,12 @@ use sqlx::{
Row,
sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePool, SqlitePoolOptions, SqliteRow},
};
+use tracing::debug;
-use atuin_common::record::{
+use crate::atuin_common::record::{
EncryptedData, Host, HostId, Record, RecordId, RecordIdx, RecordStatus,
};
-use atuin_common::utils;
+use crate::atuin_common::utils;
use uuid::Uuid;
use super::encryption::PASETO_V4;
@@ -371,7 +372,7 @@ impl Store for SqliteStore {
#[cfg(test)]
mod tests {
- use atuin_common::{
+ use crate::atuin_common::{
record::{DecryptedData, EncryptedData, Host, HostId, Record},
utils::uuid_v7,
};
diff --git a/crates/atuin-client/src/record/store.rs b/crates/turtle/src/atuin_client/record/store.rs
index 49ca4968..f99085d0 100644
--- a/crates/atuin-client/src/record/store.rs
+++ b/crates/turtle/src/atuin_client/record/store.rs
@@ -1,7 +1,7 @@
use async_trait::async_trait;
use eyre::Result;
-use atuin_common::record::{EncryptedData, HostId, Record, RecordId, RecordIdx, RecordStatus};
+use crate::atuin_common::record::{EncryptedData, HostId, Record, RecordId, RecordIdx, RecordStatus};
/// A record store stores records
/// In more detail - we tend to need to process this into _another_ format to actually query it.
diff --git a/crates/atuin-client/src/record/sync.rs b/crates/turtle/src/atuin_client/record/sync.rs
index b785b5dc..f831570b 100644
--- a/crates/atuin-client/src/record/sync.rs
+++ b/crates/turtle/src/atuin_client/record/sync.rs
@@ -3,11 +3,12 @@ use std::{cmp::Ordering, fmt::Write};
use eyre::Result;
use thiserror::Error;
+use tracing::error;
use super::{encryption::PASETO_V4, store::Store};
-use crate::{api_client::Client, settings::Settings};
+use crate::atuin_client::{api_client::Client, settings::Settings};
-use atuin_common::record::{Diff, HostId, RecordId, RecordIdx, RecordStatus};
+use crate::atuin_common::record::{Diff, HostId, RecordId, RecordIdx, RecordStatus};
use indicatif::{ProgressBar, ProgressState, ProgressStyle};
#[derive(Error, Debug)]
@@ -372,10 +373,10 @@ pub async fn sync(
#[cfg(test)]
mod tests {
- use atuin_common::record::{Diff, EncryptedData, HostId, Record};
+ use crate::atuin_common::record::{Diff, EncryptedData, HostId, Record};
use pretty_assertions::assert_eq;
- use crate::{
+ use crate::atuin_client::{
record::{
encryption::PASETO_V4,
sqlite_store::SqliteStore,
@@ -387,11 +388,11 @@ mod tests {
fn test_record() -> Record<EncryptedData> {
Record::builder()
- .host(atuin_common::record::Host::new(HostId(
- atuin_common::utils::uuid_v7(),
+ .host(crate::atuin_common::record::Host::new(HostId(
+ crate::atuin_common::utils::uuid_v7(),
)))
.version("v1".into())
- .tag(atuin_common::utils::uuid_v7().simple().to_string())
+ .tag(crate::atuin_common::utils::uuid_v7().simple().to_string())
.data(EncryptedData {
data: String::new(),
content_encryption_key: String::new(),
diff --git a/crates/atuin-client/src/register.rs b/crates/turtle/src/atuin_client/register.rs
index ad077dd1..4b14c233 100644
--- a/crates/atuin-client/src/register.rs
+++ b/crates/turtle/src/atuin_client/register.rs
@@ -1,6 +1,6 @@
use eyre::Result;
-use crate::{api_client, settings::Settings};
+use crate::atuin_client::{api_client, settings::Settings};
pub async fn register_classic(
settings: &Settings,
@@ -14,7 +14,7 @@ pub async fn register_classic(
let meta = Settings::meta_store().await?;
meta.save_session(&session.session).await?;
- let _key = crate::encryption::load_key(settings)?;
+ let _key = crate::atuin_client::encryption::load_key(settings)?;
Ok(session.session)
}
diff --git a/crates/atuin-client/src/secrets.rs b/crates/turtle/src/atuin_client/secrets.rs
index e8a6ab62..e8a6ab62 100644
--- a/crates/atuin-client/src/secrets.rs
+++ b/crates/turtle/src/atuin_client/secrets.rs
diff --git a/crates/atuin-client/src/settings.rs b/crates/turtle/src/atuin_client/settings.rs
index 5fb65c17..b0ffc7c1 100644
--- a/crates/atuin-client/src/settings.rs
+++ b/crates/turtle/src/atuin_client/settings.rs
@@ -1,8 +1,8 @@
use std::{collections::HashMap, fmt, io::prelude::*, path::PathBuf, str::FromStr, sync::OnceLock};
use tokio::sync::OnceCell;
-use atuin_common::record::HostId;
-use atuin_common::utils;
+use crate::atuin_common::record::HostId;
+use crate::atuin_common::utils;
use clap::ValueEnum;
use config::{
Config, ConfigBuilder, Environment, File as ConfigFile, FileFormat, builder::DefaultState,
@@ -16,11 +16,10 @@ use serde_with::DeserializeFromStr;
use time::{OffsetDateTime, UtcOffset, format_description::FormatItem, macros::format_description};
pub const HISTORY_PAGE_SIZE: i64 = 100;
-static EXAMPLE_CONFIG: &str = include_str!("../config.toml");
static DATA_DIR: OnceLock<PathBuf> = OnceLock::new();
static META_CONFIG: OnceLock<(String, f64)> = OnceLock::new();
-static META_STORE: OnceCell<crate::meta::MetaStore> = OnceCell::const_new();
+static META_STORE: OnceCell<crate::atuin_client::meta::MetaStore> = OnceCell::const_new();
pub(crate) mod meta;
pub mod watcher;
@@ -374,8 +373,8 @@ impl SyncAuth {
/// Convert into the auth token type used by the API client.
///
/// Returns an error with an actionable message for `NotLoggedIn`.
- pub fn into_auth_token(self) -> Result<crate::api_client::AuthToken> {
- use crate::api_client::AuthToken;
+ pub fn into_auth_token(self) -> Result<crate::atuin_client::api_client::AuthToken> {
+ use crate::atuin_client::api_client::AuthToken;
match self {
SyncAuth::Legacy { token } => Ok(AuthToken::Token(token)),
SyncAuth::NotLoggedIn { reason } => Err(eyre!(reason)),
@@ -1038,7 +1037,6 @@ pub struct Settings {
pub timezone: Timezone,
pub style: Style,
pub auto_sync: bool,
- pub update_check: bool,
/// The sync address for atuin.
pub sync_address: String,
@@ -1144,18 +1142,18 @@ impl Settings {
DATA_DIR
.get()
.cloned()
- .unwrap_or_else(atuin_common::utils::data_dir)
+ .unwrap_or_else(crate::atuin_common::utils::data_dir)
}
// -- Meta store: lazily initialized on first access --
- pub async fn meta_store() -> Result<&'static crate::meta::MetaStore> {
+ pub async fn meta_store() -> Result<&'static crate::atuin_client::meta::MetaStore> {
META_STORE
.get_or_try_init(|| async {
let (db_path, timeout) = META_CONFIG.get().ok_or_else(|| {
eyre!("meta store config not set — Settings::new() has not been called")
})?;
- crate::meta::MetaStore::new(db_path, *timeout).await
+ crate::atuin_client::meta::MetaStore::new(db_path, *timeout).await
})
.await
}
@@ -1240,7 +1238,7 @@ impl Settings {
/// `AuthToken`. Callers that need to distinguish between auth states
/// (e.g. to show different UI) should call `resolve_sync_auth` directly.
#[cfg(feature = "sync")]
- pub async fn sync_auth_token(&self) -> Result<crate::api_client::AuthToken> {
+ pub async fn sync_auth_token(&self) -> Result<crate::atuin_client::api_client::AuthToken> {
self.resolve_sync_auth().await.into_auth_token()
}
@@ -1262,7 +1260,7 @@ impl Settings {
}
pub fn builder() -> Result<ConfigBuilder<DefaultState>> {
- Self::builder_with_data_dir(&atuin_common::utils::data_dir())
+ Self::builder_with_data_dir(&crate::atuin_common::utils::data_dir())
}
fn builder_with_data_dir(data_dir: &std::path::Path) -> Result<ConfigBuilder<DefaultState>> {
@@ -1271,9 +1269,9 @@ impl Settings {
let kv_path = data_dir.join("kv.db");
let scripts_path = data_dir.join("scripts.db");
let ai_sessions_path = data_dir.join("ai_sessions.db");
- let socket_path = atuin_common::utils::runtime_dir().join("atuin.sock");
+ let socket_path = crate::atuin_common::utils::runtime_dir().join("atuin.sock");
let pidfile_path = data_dir.join("atuin-daemon.pid");
- let logs_dir = atuin_common::utils::logs_dir();
+ let logs_dir = crate::atuin_common::utils::logs_dir();
let key_path = data_dir.join("key");
let meta_path = data_dir.join("meta.db");
@@ -1286,7 +1284,6 @@ impl Settings {
.set_default("dialect", "us")?
.set_default("timezone", "local")?
.set_default("auto_sync", true)?
- .set_default("update_check", cfg!(feature = "check-update"))?
.set_default("sync_address", "https://api.atuin.sh")?
.set_default("sync_frequency", "5m")?
.set_default("search_mode", "fuzzy")?
@@ -1390,7 +1387,7 @@ impl Settings {
}
pub fn get_config_path() -> Result<PathBuf> {
- let config_dir = atuin_common::utils::config_dir();
+ let config_dir = crate::atuin_common::utils::config_dir();
create_dir_all(&config_dir)
.wrap_err_with(|| format!("could not create dir {config_dir:?}"))?;
@@ -1447,10 +1444,10 @@ impl Settings {
.map_err(|e| eyre!("failed to expand data_dir path: {}", e))?;
PathBuf::from(expanded.as_ref())
}
- None => atuin_common::utils::data_dir(),
+ None => crate::atuin_common::utils::data_dir(),
}
} else {
- atuin_common::utils::data_dir()
+ crate::atuin_common::utils::data_dir()
};
DATA_DIR.set(effective_data_dir.clone()).ok();
@@ -1467,7 +1464,10 @@ impl Settings {
config_builder.add_source(ConfigFile::new(config_file_str, FileFormat::Toml))
} else {
let mut file = File::create(config_file).wrap_err("could not create config file")?;
- file.write_all(EXAMPLE_CONFIG.as_bytes())
+
+ let config = config_builder.build_cloned()?;
+ // TODO(@bpeetz): Not so sure about this <2026-06-10>
+ file.write_all(config.cache.to_string().as_bytes())
.wrap_err("could not write default config file")?;
config_builder
@@ -1590,10 +1590,6 @@ impl Settings {
.map_err(|e| eyre!("failed to expand path: {}", e))
}
- pub fn example_config() -> &'static str {
- EXAMPLE_CONFIG
- }
-
pub fn paths_ok(&self) -> bool {
let paths = [
&self.db_path,
@@ -1766,7 +1762,7 @@ mod tests {
assert_eq!(meta_db_path, custom_dir.join("meta.db").to_str().unwrap());
assert_eq!(
daemon_socket_path,
- atuin_common::utils::runtime_dir()
+ crate::atuin_common::utils::runtime_dir()
.join("atuin.sock")
.to_str()
.unwrap()
@@ -1783,7 +1779,7 @@ mod tests {
#[test]
fn effective_data_dir_returns_default_when_not_set() {
let effective = super::Settings::effective_data_dir();
- let default = atuin_common::utils::data_dir();
+ let default = crate::atuin_common::utils::data_dir();
assert!(effective.to_str().is_some());
assert!(effective.ends_with("atuin") || effective == default);
diff --git a/crates/atuin-client/src/settings/meta.rs b/crates/turtle/src/atuin_client/settings/meta.rs
index 108d74ec..450d0432 100644
--- a/crates/atuin-client/src/settings/meta.rs
+++ b/crates/turtle/src/atuin_client/settings/meta.rs
@@ -7,7 +7,7 @@ pub struct Settings {
impl Default for Settings {
fn default() -> Self {
- let dir = atuin_common::utils::data_dir();
+ let dir = crate::atuin_common::utils::data_dir();
let path = dir.join("meta.db");
Self {
diff --git a/crates/atuin-client/src/settings/watcher.rs b/crates/turtle/src/atuin_client/settings/watcher.rs
index 740b8d12..7548573e 100644
--- a/crates/atuin-client/src/settings/watcher.rs
+++ b/crates/turtle/src/atuin_client/settings/watcher.rs
@@ -6,7 +6,7 @@
//! # Example
//!
//! ```no_run
-//! use atuin_client::settings::watcher::global_settings_watcher;
+//! use crate::atuin_client::settings::watcher::global_settings_watcher;
//!
//! async fn example() -> eyre::Result<()> {
//! let watcher = global_settings_watcher()?;
@@ -103,7 +103,7 @@ impl SettingsWatcher {
let config_dir = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") {
PathBuf::from(p)
} else {
- atuin_common::utils::config_dir()
+ crate::atuin_common::utils::config_dir()
};
config_dir.join("config.toml")
}
diff --git a/crates/atuin-client/src/sync.rs b/crates/turtle/src/atuin_client/sync.rs
index 2c902794..361b6636 100644
--- a/crates/atuin-client/src/sync.rs
+++ b/crates/turtle/src/atuin_client/sync.rs
@@ -2,12 +2,13 @@ use std::collections::HashSet;
use std::iter::FromIterator;
use eyre::Result;
+use tracing::{debug, info};
-use atuin_common::api::AddHistoryRequest;
+use crate::atuin_common::api::AddHistoryRequest;
use crypto_secretbox::Key;
use time::OffsetDateTime;
-use crate::{
+use crate::atuin_client::{
api_client,
database::Database,
encryption::{decrypt, encrypt, load_key},
diff --git a/crates/atuin-client/src/theme.rs b/crates/turtle/src/atuin_client/theme.rs
index a277ac13..1d9c0b9e 100644
--- a/crates/atuin-client/src/theme.rs
+++ b/crates/turtle/src/atuin_client/theme.rs
@@ -395,7 +395,7 @@ impl ThemeManager {
}
PathBuf::from(p)
} else {
- let config_dir = atuin_common::utils::config_dir();
+ let config_dir = crate::atuin_common::utils::config_dir();
let mut theme_file = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") {
PathBuf::from(p)
} else {
@@ -407,7 +407,7 @@ impl ThemeManager {
theme_file
};
- let theme_toml = format!["{name}.toml"];
+ let theme_toml = format!("{name}.toml");
theme_file.push(theme_toml);
let mut config_builder = Config::builder();
diff --git a/crates/atuin-client/src/utils.rs b/crates/turtle/src/atuin_client/utils.rs
index 35d7db26..35d7db26 100644
--- a/crates/atuin-client/src/utils.rs
+++ b/crates/turtle/src/atuin_client/utils.rs