From fbd20ad6e488fb3b9efc1612fdffee6e672976c1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 14 Jun 2026 02:43:45 +0300 Subject: feat: add plugin v1 system Add manifest-driven plugin actions, event hooks, pane entrypoints, link handlers, and host APIs. Support plugin link, GitHub install, build commands, installed plugin registry, pane movement, runtime context, and plugin docs. --- src/cli/agent.rs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/cli/agent.rs') diff --git a/src/cli/agent.rs b/src/cli/agent.rs index 8c3c907b..80148046 100644 --- a/src/cli/agent.rs +++ b/src/cli/agent.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use crate::api::schema::{ AgentReadParams, AgentRenameParams, AgentSendParams, AgentStartParams, AgentStatus, AgentTarget, EmptyParams, Method, ReadFormat, ReadSource, Request, Subscription, @@ -267,12 +269,12 @@ fn matched_rule_region_preview<'a>( fn agent_start(args: &[String]) -> std::io::Result { let Some(name) = args.first() else { - eprintln!("usage: herdr agent start [--cwd PATH] [--workspace ID] [--tab ID] [--split right|down] [--focus|--no-focus] -- "); + eprintln!("usage: herdr agent start [--cwd PATH] [--workspace ID] [--tab ID] [--split right|down] [--env KEY=VALUE] [--focus|--no-focus] -- "); return Ok(2); }; let Some(separator) = args.iter().position(|arg| arg == "--") else { - eprintln!("usage: herdr agent start [--cwd PATH] [--workspace ID] [--tab ID] [--split right|down] [--focus|--no-focus] -- "); + eprintln!("usage: herdr agent start [--cwd PATH] [--workspace ID] [--tab ID] [--split right|down] [--env KEY=VALUE] [--focus|--no-focus] -- "); return Ok(2); }; if separator == args.len() - 1 { @@ -285,6 +287,7 @@ fn agent_start(args: &[String]) -> std::io::Result { let mut tab_id = None; let mut split = None; let mut focus = false; + let mut env = HashMap::new(); let mut index = 1; while index < separator { @@ -329,6 +332,21 @@ fn agent_start(args: &[String]) -> std::io::Result { focus = false; index += 1; } + "--env" => { + let Some(value) = args.get(index + 1).filter(|_| index + 1 < separator) else { + eprintln!("missing value for --env"); + return Ok(2); + }; + let (key, value) = match super::parse_env_assignment(value) { + Ok(pair) => pair, + Err(err) => { + eprintln!("{err}"); + return Ok(2); + } + }; + env.insert(key, value); + index += 2; + } other => { eprintln!("unknown option: {other}"); return Ok(2); @@ -346,6 +364,7 @@ fn agent_start(args: &[String]) -> std::io::Result { split, focus, argv: args[separator + 1..].to_vec(), + env, }), })?) } @@ -656,7 +675,7 @@ fn print_agent_help() { eprintln!(" herdr agent focus "); eprintln!(" herdr agent wait --status [--timeout MS]"); eprintln!(" herdr agent attach [--takeover]"); - eprintln!(" herdr agent start [--cwd PATH] [--workspace ID] [--tab ID] [--split right|down] [--focus|--no-focus] -- "); + eprintln!(" herdr agent start [--cwd PATH] [--workspace ID] [--tab ID] [--split right|down] [--env KEY=VALUE] [--focus|--no-focus] -- "); eprintln!(" herdr agent explain [--json]"); eprintln!(" herdr agent explain --file PATH --agent LABEL [--json]"); eprintln!(" targets accept terminal ids, unique agent names, detected/reported agent labels, and legacy pane ids"); -- cgit v1.2.3