diff options
| author | Ellie Huxtable <ellie@atuin.sh> | 2026-03-31 04:18:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-31 04:18:29 +0100 |
| commit | 97b5a6c3247299e6863b17bf0b6e125692d33766 (patch) | |
| tree | 4f452be07c75202c6b0b81cb981a083895dc5c01 /crates/atuin-client | |
| parent | fix(ui): make preview line breaking algorithm aware of CJK double-width chara... (diff) | |
| download | atuin-97b5a6c3247299e6863b17bf0b6e125692d33766.zip | |
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
Diffstat (limited to 'crates/atuin-client')
| -rw-r--r-- | crates/atuin-client/src/settings.rs | 18 |
1 files changed, 17 insertions, 1 deletions
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<String>, + /// Deprecated: use opening.send_cwd instead. Kept for backwards compatibility. + #[serde(default)] + pub send_cwd: Option<bool>, + + /// 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<bool>, + + /// Whether or not to send the last command as context in the opening AI request. + pub send_last_command: Option<bool>, } 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