| 78 | #[command(version = openshell_core::VERSION)] |
| 79 | #[command(about = "Process sandbox and monitor", long_about = None)] |
| 80 | struct Args { |
| 81 | /// Command to execute in the sandbox. |
| 82 | /// Can also be provided via `OPENSHELL_SANDBOX_COMMAND` environment variable. |
| 83 | /// Defaults to `/bin/bash` if neither is provided. |
| 84 | #[arg(trailing_var_arg = true)] |
| 85 | command: Vec<String>, |
| 86 | |
| 87 | /// Working directory for the sandboxed process. |
| 88 | #[arg(long, short)] |
| 89 | workdir: Option<String>, |
| 90 | |
| 91 | /// Timeout in seconds (0 = no timeout). |
| 92 | #[arg(long, short, default_value = "0")] |
| 93 | timeout: u64, |
| 94 | |
| 95 | /// Run in interactive mode (inherit process group for terminal control). |
| 96 | #[arg(long, short = 'i')] |
| 97 | interactive: bool, |
| 98 | |
| 99 | /// Sandbox ID for fetching policy via gRPC from `OpenShell` server. |
| 100 | /// Requires --openshell-endpoint to be set. |
| 101 | #[arg(long, env = openshell_core::sandbox_env::SANDBOX_ID)] |
| 102 | sandbox_id: Option<String>, |
| 103 | |
| 104 | /// Sandbox (used for policy sync when the sandbox discovers policy |
| 105 | /// from disk or falls back to the restrictive default). |
| 106 | #[arg(long, env = openshell_core::sandbox_env::SANDBOX)] |
| 107 | sandbox: Option<String>, |
| 108 | |
| 109 | /// `OpenShell` server gRPC endpoint for fetching policy. |
| 110 | /// Required when using --sandbox-id. |
| 111 | #[arg(long, env = openshell_core::sandbox_env::ENDPOINT)] |
| 112 | openshell_endpoint: Option<String>, |
| 113 | |
| 114 | /// Path to Rego policy file for OPA-based network access control. |
| 115 | /// Requires --policy-data to also be set. |
| 116 | #[arg(long, env = "OPENSHELL_POLICY_RULES")] |
| 117 | policy_rules: Option<String>, |
| 118 | |
| 119 | /// Path to YAML data file containing network policies and sandbox config. |
| 120 | /// Requires --policy-rules to also be set. |
| 121 | #[arg(long, env = "OPENSHELL_POLICY_DATA")] |
| 122 | policy_data: Option<String>, |
| 123 | |
| 124 | /// Log level (trace, debug, info, warn, error). |
| 125 | #[arg(long, default_value = "warn", env = openshell_core::sandbox_env::LOG_LEVEL)] |
| 126 | log_level: String, |
| 127 | |
| 128 | /// Filesystem path to the Unix socket the embedded SSH daemon binds. |
| 129 | /// The supervisor bridges `RelayStream` traffic from the gateway onto |
| 130 | /// this socket; nothing else should connect to it. |
| 131 | #[arg(long, env = openshell_core::sandbox_env::SSH_SOCKET_PATH)] |
| 132 | ssh_socket_path: Option<String>, |
| 133 | |
| 134 | /// Path to YAML inference routes for standalone routing. |
| 135 | /// When set, inference routes are loaded from this file instead of |
| 136 | /// fetching a bundle from the gateway. |
| 137 | #[arg(long, env = "OPENSHELL_INFERENCE_ROUTES")] |
nothing calls this directly
no outgoing calls
no test coverage detected