aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 3f1f7930..65dc7c11 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -424,6 +424,9 @@ pane_history = false
# scrollback_limit_bytes = 10000000
"##;
+// Bundled at build time so the printed skill always matches this binary's release.
+const SKILL: &str = include_str!("../SKILL.md");
+
fn should_block_nested(config: &config::Config) -> bool {
should_block_nested_for_env(config, std::env::var(HERDR_ENV_VAR).ok().as_deref())
}
@@ -477,7 +480,7 @@ fn main() -> io::Result<()> {
&& !args.iter().any(|a| {
matches!(
a.as_str(),
- "--help" | "-h" | "--version" | "-V" | "--default-config"
+ "--help" | "-h" | "--version" | "-V" | "--default-config" | "--skill"
)
})
{
@@ -637,6 +640,7 @@ fn main() -> io::Result<()> {
println!(" Keybindings for --remote app attach (default: local)");
println!(" --handoff Opt into live handoff for update or remote attach");
println!(" --default-config Print default configuration and exit");
+ println!(" --skill Print the agent skill file and exit");
println!(" --version, -V Print version and exit");
println!(" --help, -h Show this help");
println!();
@@ -644,6 +648,7 @@ fn main() -> io::Result<()> {
println!("Logs: {}", logging::help_log_paths_summary());
println!("Env: HERDR_CONFIG_PATH overrides config file path");
println!("Home: https://herdr.dev");
+ println!("Skill: herdr --skill prints agent instructions for driving herdr from a pane");
return Ok(());
}
@@ -657,6 +662,11 @@ fn main() -> io::Result<()> {
return Ok(());
}
+ if args.iter().any(|a| a == "--skill") {
+ print!("{SKILL}");
+ return Ok(());
+ }
+
// Reject unknown flags
let known_flags = [
"--no-session",
@@ -666,6 +676,7 @@ fn main() -> io::Result<()> {
"--version",
"-V",
"--default-config",
+ "--skill",
"--help",
"-h",
];