aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client/src/history.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-04-13 20:41:30 +0100
committerGitHub <noreply@github.com>2026-04-13 20:41:30 +0100
commit129ad222d2ea2896a06ed29cbce5faa0b0d7399e (patch)
tree06eca765ff80c62581ec69a23a631bdf64aaedfb /crates/atuin-client/src/history.rs
parentfeat: remove agent search from tui (#3397) (diff)
downloadatuin-129ad222d2ea2896a06ed29cbce5faa0b0d7399e.zip
feat: add pi hook installer (#3398)
Support installing the pi extension via `atuin hook install pi`. Bundle the extension in the binary and update the docs. <!-- 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 - [ ] 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/src/history.rs')
-rw-r--r--crates/atuin-client/src/history.rs22
1 files changed, 19 insertions, 3 deletions
diff --git a/crates/atuin-client/src/history.rs b/crates/atuin-client/src/history.rs
index 996208d9..16f7d85a 100644
--- a/crates/atuin-client/src/history.rs
+++ b/crates/atuin-client/src/history.rs
@@ -19,7 +19,7 @@ mod builder;
pub mod store;
/// Known AI agent author values. Used to expand `$all-agent` and `$all-user` filters.
-pub const KNOWN_AGENTS: &[&str] = &["claude-code", "codex", "copilot"];
+pub const KNOWN_AGENTS: &[&str] = &["claude-code", "codex", "copilot", "pi"];
pub const AUTHOR_FILTER_ALL_USER: &str = "$all-user";
pub const AUTHOR_FILTER_ALL_AGENT: &str = "$all-agent";
@@ -540,9 +540,12 @@ mod tests {
use regex::RegexSet;
use time::macros::datetime;
- use crate::{history::HISTORY_VERSION, settings::Settings};
+ use crate::{
+ history::{AUTHOR_FILTER_ALL_AGENT, AUTHOR_FILTER_ALL_USER, HISTORY_VERSION},
+ settings::Settings,
+ };
- use super::History;
+ use super::{History, author_matches_filters, is_known_agent};
// Test that we don't save history where necessary
#[test]
@@ -604,6 +607,19 @@ mod tests {
}
#[test]
+ fn known_agents_include_pi() {
+ assert!(is_known_agent("pi"));
+ assert!(author_matches_filters(
+ "pi",
+ &[AUTHOR_FILTER_ALL_AGENT.to_string()]
+ ));
+ assert!(!author_matches_filters(
+ "pi",
+ &[AUTHOR_FILTER_ALL_USER.to_string()]
+ ));
+ }
+
+ #[test]
fn disable_secrets() {
let settings = Settings {
secrets_filter: false,