aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-daemon/src
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-02-25 19:10:58 -0800
committerGitHub <noreply@github.com>2026-02-25 19:10:58 -0800
commit9fe7d10fcf73570767ba7b4eabaa95f65958821b (patch)
treeed9705225db8e5bbe2f3c689ba5d1c9908b75eb1 /crates/atuin-daemon/src
parentfeat: Generate commands or ask questions with `atuin ai` (#3199) (diff)
downloadatuin-9fe7d10fcf73570767ba7b4eabaa95f65958821b.zip
feat: Add history author/intent metadata and v1 record version (#3205)
<!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing Adds `author` and `intent` to client history records and DB persistence, including migration/backfill and CLI/daemon propagation. Introduces V2 record-store history version `v1` while retaining read compatibility for legacy `v0` records. Adds `--author` and `--intent` flags to `atuin history start`, plus `{author}` and `{intent}` format keys for listing/history output. Updates shell-integration docs for `ATUIN_HISTORY_AUTHOR` and `ATUIN_HISTORY_INTENT`, and updates related tests/fixtures. Validated with `cargo test -p atuin-client --lib`, `cargo test -p atuin-daemon --tests`, `cargo test -p atuin search::inspector`, and `cargo fmt --check`.
Diffstat (limited to 'crates/atuin-daemon/src')
-rw-r--r--crates/atuin-daemon/src/client.rs2
-rw-r--r--crates/atuin-daemon/src/server.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/crates/atuin-daemon/src/client.rs b/crates/atuin-daemon/src/client.rs
index 05067bda..3b76a680 100644
--- a/crates/atuin-daemon/src/client.rs
+++ b/crates/atuin-daemon/src/client.rs
@@ -103,6 +103,8 @@ impl HistoryClient {
hostname: h.hostname,
session: h.session,
timestamp: h.timestamp.unix_timestamp_nanos() as u64,
+ author: h.author,
+ intent: h.intent.unwrap_or_default(),
};
Ok(self.client.start_history(req).await?.into_inner())
diff --git a/crates/atuin-daemon/src/server.rs b/crates/atuin-daemon/src/server.rs
index 9622d2b6..826d6191 100644
--- a/crates/atuin-daemon/src/server.rs
+++ b/crates/atuin-daemon/src/server.rs
@@ -69,7 +69,7 @@ impl HistorySvc for HistoryService {
)
})?;
- let h: History = History::daemon()
+ let mut h: History = History::daemon()
.timestamp(timestamp)
.command(req.command)
.cwd(req.cwd)
@@ -77,6 +77,12 @@ impl HistorySvc for HistoryService {
.hostname(req.hostname)
.build()
.into();
+ if !req.author.trim().is_empty() {
+ h.author = req.author;
+ }
+ if !req.intent.trim().is_empty() {
+ h.intent = Some(req.intent);
+ }
// The old behaviour had us inserting half-finished history records into the database
// The new behaviour no longer allows that.