From 97b5a6c3247299e6863b17bf0b6e125692d33766 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Tue, 31 Mar 2026 04:18:29 +0100 Subject: feat: opt-in to sharing last command with ai (#3367) This enables it to perform more effectively and give better suggestions. Same as send_cwd, disabled by default, opt in. ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing --- crates/atuin-client/src/settings.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'crates/atuin-client/src') diff --git a/crates/atuin-client/src/settings.rs b/crates/atuin-client/src/settings.rs index 5b18d9ea..b3359d19 100644 --- a/crates/atuin-client/src/settings.rs +++ b/crates/atuin-client/src/settings.rs @@ -664,8 +664,22 @@ pub struct Ai { /// Only necessary for custom AI endpoints. pub api_token: Option, + /// Deprecated: use opening.send_cwd instead. Kept for backwards compatibility. + #[serde(default)] + pub send_cwd: Option, + + /// Configuration for what context is sent in the opening AI request. + #[serde(default)] + pub opening: AiOpening, +} + +#[derive(Default, Clone, Debug, Deserialize, Serialize)] +pub struct AiOpening { /// Whether or not to send the current working directory to the AI endpoint. - pub send_cwd: bool, + pub send_cwd: Option, + + /// Whether or not to send the last command as context in the opening AI request. + pub send_last_command: Option, } impl Default for Preview { @@ -1524,6 +1538,8 @@ impl Settings { .set_default("search.frecency_score_multiplier", 1.0)? .set_default("meta.db_path", meta_path.to_str())? .set_default("ai.send_cwd", false)? + .set_default("ai.opening.send_cwd", false)? + .set_default("ai.opening.send_last_command", false)? .set_default( "search.filters", vec![ -- cgit v1.3.1