Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .agents/skills/build-openshell-mxc-windows/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ crypto dependency builds.
| `windows:build:arm64` | Release-builds `openshell-gateway.exe` and `openshell.exe` for ARM64. |
| `windows:test:x64` | Runs native x64 workspace tests with `--no-fail-fast`, excluding unsupported Windows packages as top-level workspace targets. |
| `windows:test:arm64` | Runs native ARM64 workspace tests with `--no-fail-fast` and the same package exclusions. Rejects non-ARM64 hosts. |
| `windows:test:unsupported:x64` | Re-runs focused `openshell-server` tests for unsupported Windows driver behavior. |
| `windows:test:unsupported:x64` | Re-runs focused `openshell-gateway` tests for unsupported Windows driver behavior. |
| `windows:test:unsupported:arm64` | Re-runs the same focused contracts natively on ARM64. Rejects non-ARM64 hosts. |
| `windows:artifacts` | Reports size and SHA256 for release artifacts that exist. |
| `windows:ci` | Runs the full ordered x64-host Windows CI lane, plus ARM64 check/build when not skipped. |
Expand All @@ -248,10 +248,10 @@ Windows must continue to reject unsupported compute drivers clearly.

| Driver | Windows build behavior | Runtime behavior |
|---|---|---|
| Docker | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
| Kubernetes | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
| Podman | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
| VM | Driver crate excluded from workspace validation. | Gateway construction returns unsupported. |
| Docker | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
| Kubernetes | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
| Podman | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
| VM | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |

The focused contract tasks for either native architecture run:

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/build-openshell-mxc-windows/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Windows is a build target only. These runtimes remain unsupported:

Rules:

- Keep config/library stubs where the gateway needs them.
- Keep registration stubs in the gateway composition crate where the gateway needs them.
- Return clear unsupported errors at runtime.
- Do not build standalone Windows driver binaries.
- Do not add Docker Desktop, WSL, Hyper-V, Podman machine, Podman Desktop, or
Expand Down Expand Up @@ -180,7 +180,7 @@ blocked dependency.
### Focused tests report many filtered-out tests

This is expected for `windows:test:unsupported:x64`. Cargo runs one named test
and filters the other `openshell-server` tests. Report these as filtered, not
and filters the other `openshell-gateway` tests. Report these as filtered, not
ignored.

## Reporting Counts
Expand Down
25 changes: 23 additions & 2 deletions .agents/skills/debug-openshell-cluster/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ The target deployment flow is:
4. The CLI registers a reachable gateway endpoint with `openshell gateway add`.
5. The gateway creates sandboxes through the selected compute driver.

The standard gateway binary explicitly installs its compiled Docker, Podman,
Kubernetes, and VM registrations at startup. With no configured driver, the
The `openshell-gateway` composition crate explicitly installs its compiled
Docker, Podman, Kubernetes, and VM registrations at startup; `openshell-server`
does not link compute-driver crates. With no configured driver, the
gateway probes only installed registrations in priority order (Kubernetes,
Podman, then Docker); VM has no probe and remains opt-in. A custom gateway
binary may install a different set, so confirm the binary's registered drivers
Expand Down Expand Up @@ -475,6 +476,26 @@ helm -n openshell get values openshell | grep sandboxNamespace

Then inspect sandbox resources in that namespace.

For a split release, the gateway values should have
`workspaceResources.enabled=false`, and the target namespace should contain a
separate `openshell-workspace` release:

```bash
helm -n openshell get values openshell | grep -A2 workspaceResources
helm -n <sandbox-namespace> status openshell-workspace
kubectl -n <sandbox-namespace> get serviceaccount,role,rolebinding,networkpolicy \
-l app.kubernetes.io/instance=openshell-workspace
kubectl auth can-i create sandboxes.agents.x-k8s.io \
--namespace <sandbox-namespace> \
--as system:serviceaccount:openshell:openshell
```

If the gateway cannot create or watch sandboxes, verify the workspace
RoleBinding subject matches the gateway ServiceAccount name and namespace.
If SSH relay connections fail, verify the workspace NetworkPolicy selects the
gateway's actual `app.kubernetes.io/name` and
`app.kubernetes.io/instance` labels.

Check the configured sandbox service account when TokenReview bootstrap or
sandbox registration fails. Helm creates a dedicated sandbox service account by
default and writes it to `[openshell.drivers.kubernetes].service_account_name`;
Expand Down
48 changes: 45 additions & 3 deletions .agents/skills/openshell-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ Key flags:
- `--gpu [COUNT]`: Request the driver's default GPU selection or a specific GPU count
- `--cpu`, `--memory`: Set per-sandbox compute sizing. Docker/Podman apply limits; Kubernetes applies matching requests and limits.
- `--driver-config-json`: Pass experimental driver-specific sandbox configuration
- `--template NAME`: Create from a named sandbox workload template. Conflicts with inline workload flags such as `--from`, `--gpu`, `--cpu`, `--memory`, `--env`, and `--driver-config-json`.
- `--label KEY=VALUE`: Add labels for later selection (repeatable)
- `--env KEY=VALUE`: Set non-secret sandbox environment variables (repeatable); use `--provider` for credentials
- `--tty`: Allocate a retained PTY for the canonical main process
Expand All @@ -262,6 +263,45 @@ Do not combine `--upload` with a trailing main command. Uploads currently finish
after the canonical process starts; create a scratch sandbox and use
`sandbox exec`, or build the files into the image.

Create from a reusable workload template when several sandboxes should share
image, environment, sizing, or driver-specific configuration:

```bash
openshell sandbox template create gpu-kata \
--image ghcr.io/nvidia/openshell-community/sandboxes/python:latest \
--cpu 2 \
--memory 4Gi \
--gpu 1 \
--driver-config-json '{"kubernetes":{"pod":{"node_selector":{"pool":"gpu"}}}}'

openshell sandbox create --name my-sandbox --template gpu-kata --provider my-github -- claude
```

Direct `sandbox create --driver-config-json` remains valid for one-off
creates. Put driver config on a template only when it should be reused.

### Manage sandbox workload templates

```bash
openshell sandbox template create gpu-kata \
--image ghcr.io/nvidia/openshell-community/sandboxes/python:latest \
--cpu 2 \
--memory 4Gi \
--gpu 1 \
--label team=runtime \
--env FEATURE_FLAG=on
openshell sandbox template list
openshell sandbox template list --label-selector team=runtime
openshell sandbox template list --all-workspaces --output json
openshell sandbox template get gpu-kata
openshell sandbox template delete gpu-kata
```

Template `--image` accepts an OCI image reference. If omitted, the gateway
applies its default sandbox image when creating a sandbox from the template.
Create-time policy, providers, labels, uploads, forwarding, editor launch, and
the initial command stay on `sandbox create`.

### List and inspect sandboxes

```bash
Expand Down Expand Up @@ -384,7 +424,7 @@ the operation that removes retained state.

This is the most important multi-step workflow. It enables a tight feedback cycle where sandbox policy is refined based on observed activity.

**Key concept**: Policies have static fields (immutable after creation: `filesystem_policy`, `landlock`, `process`) and two dynamic fields: `network_policies` and `network_middlewares`. Both dynamic fields can be updated without recreating the sandbox when the selected compute driver supports live policy updates. MXC rejects live policy replacement and merge updates; delete and recreate an MXC sandbox instead.
**Key concept**: Policies have static fields (immutable after creation: `filesystem_policy`, `landlock`, `process`) and two dynamic fields: `network_policies` and `network_middlewares`. Both dynamic fields can be updated without recreating the sandbox when the selected compute driver supports live policy updates. Drivers without the standard supervisor fetch revisions through the sandbox configuration API and report whether they loaded them.

An endpoint with omitted `protocol` retains explicit-proxy behavior. Explicit
`protocol: tcp` requests policy DNS and transparent TCP and currently requires
Expand Down Expand Up @@ -454,7 +494,7 @@ Edit `current-policy.yaml` to allow the blocked actions. **For policy content au
- Binary matching patterns
- Ordered `network_middlewares`, host selection, HTTP and WebSocket bindings, and `fail_open` or `fail_closed` behavior

`network_policies` and `network_middlewares` can be modified at runtime when the selected compute driver supports live policy updates. MXC rejects live policy replacement and merge updates; delete and recreate an MXC sandbox instead. If `filesystem_policy`, `landlock`, or `process` need changes, the sandbox must be recreated. Built-in middleware such as `openshell/regex` needs no gateway registration. An operator-run middleware must already be registered under `[[openshell.supervisor.middleware]]`; changing that static registration requires a gateway restart.
`network_policies` and `network_middlewares` can be modified at runtime when the selected compute driver supports live policy updates. Use `--wait` to verify that the active runtime loaded the revision; do not infer enforcement from the gateway accepting the update. If `filesystem_policy`, `landlock`, or `process` need changes, the sandbox must be recreated. Built-in middleware such as `openshell/regex` needs no gateway registration. An operator-run middleware must already be registered under `[[openshell.supervisor.middleware]]`; changing that static registration requires a gateway restart.

Middleware can inspect parsed HTTP request bodies and complete client-to-upstream WebSocket text messages over both `ws://` and `wss://` when the implementation advertises the matching binding. The built-in `openshell/regex` advertises both bindings and applies its fixed patterns to UTF-8 text. A host-matched HTTP-only attachment can inspect the upgrade GET but does not join the WebSocket chain; look for `binding_not_selected` coverage. Binary messages pass under both `on_error` modes and active stages emit `unsupported_message_type` coverage; upstream-to-client messages remain uninspected. A broken fail-open WebSocket stage is disabled for the rest of that connection; inspect sandbox OCSF logs for `openshell.middleware.websocket_stage_disabled`.

Expand Down Expand Up @@ -772,7 +812,7 @@ The CLI help is always authoritative. If the help output contradicts this skill,

```bash
$ openshell sandbox --help
# Shows: create, get, list, stop, start, delete, exec, connect, upload, download, ssh-config, provider
# Shows: create, get, list, stop, start, delete, exec, connect, upload, download, ssh-config, provider, template

$ openshell sandbox upload --help
# Shows: positional arguments (name, path, dest), usage examples
Expand All @@ -793,6 +833,8 @@ $ openshell sandbox upload --help
| Create sandbox with tool | `openshell sandbox create -- claude` |
| Create sandbox with GPUs | `openshell sandbox create --gpu 1` |
| Create with custom policy | `openshell sandbox create --policy ./p.yaml` |
| Create from template | `openshell sandbox create --template gpu-kata` |
| Create workload template | `openshell sandbox template create gpu-kata --image python:3.12` |
| Connect to sandbox | `openshell sandbox connect <name>` |
| Stop sandbox compute | `openshell sandbox stop [name]` |
| Start sandbox compute | `openshell sandbox start [name]` |
Expand Down
73 changes: 67 additions & 6 deletions .agents/skills/openshell-cli/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Quick-reference for the `openshell` command-line interface. For workflow guidanc
| `-g`, `--gateway <NAME>` | Gateway to operate on. Also settable via `OPENSHELL_GATEWAY` env var. Falls back to active gateway in `~/.config/openshell/active_gateway`. |
| `--gateway-endpoint <URL>` | Connect directly to a gateway endpoint without looking up stored metadata. Also settable via `OPENSHELL_GATEWAY_ENDPOINT`. |
| `--gateway-insecure` | Skip TLS certificate verification. Also settable via `OPENSHELL_GATEWAY_INSECURE`; use only for trusted development endpoints. |
| `--color <WHEN>` | `auto` (default), `always`, or `never`. `auto` decides per stream, so a redirected stream is plain text while a stream still on the terminal stays styled. Covers tables, `-v` log lines, progress spinners, prompts, and error messages. Also settable via `OPENSHELL_COLOR`. |

## Environment Variables

Expand All @@ -20,6 +21,9 @@ Quick-reference for the `openshell` command-line interface. For workflow guidanc
| `OPENSHELL_GATEWAY` | Override active gateway name (same as `--gateway`) |
| `OPENSHELL_GATEWAY_ENDPOINT` | Connect directly to a gateway endpoint (same as `--gateway-endpoint`) |
| `OPENSHELL_GATEWAY_INSECURE` | Skip TLS verification when set (same as `--gateway-insecure`) |
| `OPENSHELL_COLOR` | When to colorize output: `auto`, `always`, `never` (same as `--color`) |
| `NO_COLOR` | Disable colorized output when set to any non-empty value ([no-color.org](https://no-color.org)) |
| `FORCE_COLOR` | Force colorized output when set to any non-empty value ([force-color.org](https://force-color.org)) |
| `OPENSHELL_SANDBOX_POLICY` | Path to default sandbox policy YAML (fallback when `--policy` is not provided) |
| `OPENSHELL_COMMUNITY_REGISTRY` | Override the community sandbox image registry prefix used by `sandbox create --from <name>` |
| `OPENSHELL_THEME` | TUI theme: `auto`, `dark`, or `light` |
Expand Down Expand Up @@ -56,10 +60,15 @@ openshell
│ ├── upload <name> <path> [dest]
│ ├── download <name> <path> [dest]
│ ├── ssh-config [name]
│ └── provider
│ ├── list [name] [-o table|yaml|json]
│ ├── attach <name> <provider>
│ └── detach <name> <provider>
│ ├── provider
│ │ ├── list [name] [-o table|yaml|json]
│ │ ├── attach <name> <provider>
│ │ └── detach <name> <provider>
│ └── template
│ ├── create <name> [opts]
│ ├── get <name>
│ ├── list [opts]
│ └── delete <name>...
├── forward
│ ├── start <port> [name] [-d]
│ ├── stop <port> [name]
Expand Down Expand Up @@ -239,6 +248,7 @@ process result immediately when it exits. Foreground creation declares one
expected main-process SSH attachment; cleanup finalizes after that connection
drains and closes naturally.
| `--driver-config-json <JSON>` | Experimental driver-keyed configuration object |
| `--template <NAME>` | Create from a named sandbox workload template |
| `--provider <NAME>` | Provider to attach (repeatable) |
| `--policy <PATH>` | Custom policy YAML; overrides the built-in default and `OPENSHELL_SANDBOX_POLICY` |
| `--forward <[BIND:]PORT>` | Start a local port forward and keep the sandbox alive |
Expand All @@ -257,6 +267,57 @@ currently complete after the canonical process starts. Create the default
scratch sandbox, upload files, then use `sandbox exec`, or build the files into
the image.

`--template` uses the named template workload, so it conflicts with inline
workload flags: `--from`, `--gpu`, `--cpu`, `--memory`, `--env`, and
`--driver-config-json`. Direct `sandbox create --driver-config-json` remains
valid when `--template` is not set.

### `openshell sandbox template create NAME [OPTIONS]`

Create a reusable sandbox workload template. Templates hold image,
environment, resource, startup, and driver-specific configuration for later
`sandbox create --template NAME` calls.

| Flag | Description |
|------|-------------|
| `--image <IMAGE>` | OCI image reference; when omitted, the gateway default image is applied at sandbox create time |
| `--env <KEY=VALUE>` | Set a non-secret template workload environment variable (repeatable) |
| `--cpu <QUANTITY>` | CPU limit for sandboxes created from the template |
| `--memory <QUANTITY>` | Memory limit for sandboxes created from the template |
| `--gpu [COUNT]` | Request the driver's default GPU selection or a specific GPU count for sandboxes created from the template |
| `--driver-config-json <JSON>` | Experimental driver-keyed configuration object owned by the template |
| `--ready-within <DURATION>` | Target startup readiness duration, for example `30s`, `5m`, or `1h` |
| `--max-burst <COUNT>` | Maximum startup burst associated with this template |
| `--label <KEY=VALUE>` | Attach a template label (repeatable) |
| `--annotation <KEY=VALUE>` | Attach a template annotation (repeatable) |
| `--output table|yaml|json` | Output format |

### `openshell sandbox template get NAME`

Show a sandbox workload template.

| Flag | Description |
|------|-------------|
| `--output table|yaml|json` | Output format |

### `openshell sandbox template list`

List sandbox workload templates.

| Flag | Default | Description |
|------|---------|-------------|
| `--limit <N>` | 100 | Maximum templates |
| `--offset <N>` | 0 | Pagination offset |
| `--label-selector <KEY=VALUE,...>` | empty | Filter templates by labels |
| `--names` | false | Print only template names |
| `--all-workspaces` | false | List templates across all workspaces; requires platform-admin permissions |
| `--output table|yaml|json` | `table` | Output format |

### `openshell sandbox template delete NAME...`

Delete one or more sandbox workload templates by name. Existing sandboxes
created from a template are not deleted.

### `openshell sandbox get [name]`

Show sandbox details and the active policy. Metadata identifies sandbox or global policy source and the corresponding revision. The name defaults to the last-used sandbox.
Expand Down Expand Up @@ -413,7 +474,7 @@ The sandbox name defaults to the last-used sandbox.

### `openshell policy update [name]`

Incrementally merge live network policy changes into the current sandbox policy when the selected compute driver supports live updates. Multiple flags in one invocation are applied as one atomic batch and create at most one new revision. MXC rejects live policy merges; delete and recreate an MXC sandbox instead.
Incrementally merge live network policy changes into the current sandbox policy when the selected compute driver supports live updates. Multiple flags in one invocation are applied as one atomic batch and create at most one new revision. Use `--wait` to verify that the active runtime loaded the new revision.

| Flag | Default | Description |
|------|---------|-------------|
Expand Down Expand Up @@ -443,7 +504,7 @@ Notes:

### `openshell policy set [name] --policy <PATH>`

Replace the full policy on a live sandbox when the selected compute driver supports live updates. Only the dynamic `network_policies` field can be changed at runtime. MXC rejects live policy replacement; delete and recreate an MXC sandbox instead.
Replace the full policy on a live sandbox when the selected compute driver supports live updates. Only dynamic policy fields can be changed at runtime. Use `--wait` to verify that the active runtime loaded the new revision.

| Flag | Default | Description |
|------|---------|-------------|
Expand Down
Loading
Loading