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/workspace.rs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/cli/workspace.rs') diff --git a/src/cli/workspace.rs b/src/cli/workspace.rs index ae29792c..8149d55d 100644 --- a/src/cli/workspace.rs +++ b/src/cli/workspace.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use crate::api::schema::{ EmptyParams, Method, Request, WorkspaceCreateParams, WorkspaceRenameParams, WorkspaceTarget, }; @@ -42,6 +44,7 @@ fn workspace_create(args: &[String]) -> std::io::Result { let mut cwd = None; let mut focus = false; let mut label = None; + let mut env = HashMap::new(); let mut index = 0; while index < args.len() { @@ -70,6 +73,21 @@ fn workspace_create(args: &[String]) -> std::io::Result { focus = false; index += 1; } + "--env" => { + let Some(value) = args.get(index + 1) 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); @@ -79,7 +97,12 @@ fn workspace_create(args: &[String]) -> std::io::Result { super::print_response(&super::send_request(&Request { id: "cli:workspace:create".into(), - method: Method::WorkspaceCreate(WorkspaceCreateParams { cwd, focus, label }), + method: Method::WorkspaceCreate(WorkspaceCreateParams { + cwd, + focus, + label, + env, + }), })?) } @@ -155,7 +178,7 @@ fn workspace_close(args: &[String]) -> std::io::Result { fn print_workspace_help() { eprintln!("herdr workspace commands:"); eprintln!(" herdr workspace list"); - eprintln!(" herdr workspace create [--cwd PATH] [--label TEXT] [--focus] [--no-focus]"); + eprintln!(" herdr workspace create [--cwd PATH] [--label TEXT] [--env KEY=VALUE] [--focus] [--no-focus]"); eprintln!(" herdr workspace get "); eprintln!(" herdr workspace focus "); eprintln!(" herdr workspace rename