aboutsummaryrefslogtreecommitdiff
path: root/tests/cli
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cli')
-rw-r--r--tests/cli/surface.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/cli/surface.rs b/tests/cli/surface.rs
index 2507804e..b48baf57 100644
--- a/tests/cli/surface.rs
+++ b/tests/cli/surface.rs
@@ -274,6 +274,33 @@ fn help_commands_exit_successfully() {
}
#[test]
+fn root_and_command_group_help_point_agents_to_plain_text_docs() {
+ for args in [&["--help"][..], &["agent", "--help"][..]] {
+ let output = Command::new(env!("CARGO_BIN_EXE_herdr"))
+ .args(args)
+ .env_remove("HERDR_SOCKET_PATH")
+ .env_remove("HERDR_CLIENT_SOCKET_PATH")
+ .env_remove("HERDR_ENV")
+ .output()
+ .unwrap();
+ assert!(output.status.success(), "herdr {} failed", args.join(" "));
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ for expected in [
+ "Are you an AI? Use these resources ONLY IF your task specifically asks you to:",
+ "https://herdr.dev/agent-guide.md",
+ "https://herdr.dev/llms.txt",
+ "herdr --skill",
+ ] {
+ assert!(
+ stdout.contains(expected),
+ "herdr {} help did not contain {expected:?}: {stdout}",
+ args.join(" ")
+ );
+ }
+ }
+}
+
+#[test]
fn subcommand_help_explains_automation_semantics_without_a_server() {
let cases: &[(&[&str], &str)] = &[
(&["agent", "wait", "--help"], "Without --until"),