summaryrefslogtreecommitdiff
path: root/src/cli/workspace.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-14 02:43:45 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-14 03:47:07 +0300
commitfbd20ad6e488fb3b9efc1612fdffee6e672976c1 (patch)
treed21daf93241786f8aa6fde23b41cdb9e15182b79 /src/cli/workspace.rs
parentd35c642ef36ee5ac2afe7c1b18ad5a717bc807d8 (diff)
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.
Diffstat (limited to 'src/cli/workspace.rs')
-rw-r--r--src/cli/workspace.rs27
1 files changed, 25 insertions, 2 deletions
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<i32> {
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<i32> {
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<i32> {
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<i32> {
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 <workspace_id>");
eprintln!(" herdr workspace focus <workspace_id>");
eprintln!(" herdr workspace rename <workspace_id> <label>");