From ec14984697c753f5f1bbb6f833780471aa4cef52 Mon Sep 17 00:00:00 2001 From: Jim Meyer Date: Thu, 3 Dec 2026 12:03:57 -0800 Subject: [PATCH 1/3] feat(cli): rename the openshell command to os Build the CLI as `os` and keep `openshell` as a link to it in every package. Started through `openshell`, the CLI runs the same command and prints a one-line rename notice to stderr, which OPENSHELL_SUPPRESS_RENAME_WARNING hides. Release archives, the deb, the RPM, and the Homebrew formula install `os` with an `openshell` link. The snap adds an `os` app with an `os` alias request, and its `openshell` app runs the CLI without the notice until the Store grants the alias. SSH configs record the `os` path even when generated through the old name. CLI hints, help examples, tests, and development scripts use `os`. Signed-off-by: Jim Meyer --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 +- .github/actions/setup-e2e-cli/action.yml | 2 +- .github/workflows/branch-checks.yml | 2 +- .github/workflows/build-binaries-linux.yml | 5 +- .github/workflows/build-binaries-macos.yml | 5 +- .github/workflows/build-rpm.yml | 2 +- .github/workflows/deb-package.yml | 4 +- .../workflows/package-release-binaries.yml | 18 +- .github/workflows/release-canary.yml | 38 +- .github/workflows/snap-package.yml | 4 +- CONTRIBUTING.md | 2 +- TESTING.md | 2 +- crates/openshell-cli/Cargo.toml | 2 +- crates/openshell-cli/src/auth.rs | 4 +- crates/openshell-cli/src/color.rs | 2 +- crates/openshell-cli/src/commands/common.rs | 16 +- crates/openshell-cli/src/commands/gateway.rs | 24 +- crates/openshell-cli/src/commands/provider.rs | 10 +- crates/openshell-cli/src/commands/secret.rs | 4 +- crates/openshell-cli/src/main.rs | 567 ++++++++---------- crates/openshell-cli/src/oidc_auth.rs | 10 +- crates/openshell-cli/src/run.rs | 45 +- crates/openshell-cli/src/ssh.rs | 22 +- .../tests/cli_color_integration.rs | 12 +- .../tests/cli_help_integration.rs | 4 +- crates/openshell-cli/tests/common/mod.rs | 2 +- .../openshell-cli/tests/doctor_integration.rs | 8 +- .../tests/forward_list_integration.rs | 4 +- .../tests/gateway_registration_integration.rs | 2 +- .../tests/provider_commands_integration.rs | 4 +- .../sandbox_create_lifecycle_integration.rs | 30 +- .../sandbox_exec_streaming_integration.rs | 2 +- .../tests/sandbox_upload_integration.rs | 4 +- .../tests/ssh_proxy_host_key_integration.rs | 4 +- .../tests/ssh_proxy_shutdown_integration.rs | 4 +- crates/openshell-core/src/config.rs | 7 +- crates/openshell-core/src/forward.rs | 87 ++- crates/openshell-core/src/grpc_client.rs | 2 +- crates/openshell-core/src/ssh_handoff.rs | 2 +- crates/openshell-core/src/ssh_host_key.rs | 2 +- crates/openshell-driver-docker/README.md | 2 +- crates/openshell-driver-kubernetes/README.md | 4 +- .../openshell-driver-kubernetes/src/driver.rs | 2 +- crates/openshell-driver-mxc/README.md | 4 +- crates/openshell-driver-vm/README.md | 6 +- crates/openshell-policy/src/lib.rs | 2 +- .../src/example_profiles.rs | 2 +- crates/openshell-server/src/auth/http.rs | 2 +- .../src/auth/workspace_authz.rs | 8 +- crates/openshell-server/src/compute/mod.rs | 4 +- .../openshell-server/src/config_file/mod.rs | 5 +- crates/openshell-server/src/grpc/policy.rs | 10 +- crates/openshell-server/src/grpc/provider.rs | 2 +- crates/openshell-server/src/grpc/sandbox.rs | 10 +- .../openshell-server/src/grpc/validation.rs | 2 +- .../src/policy_local.rs | 4 +- .../src/skills/policy_advisor.md | 6 +- crates/openshell-tui/src/lib.rs | 8 +- deploy/docker/docker-compose.yml | 8 +- deploy/docker/gateway.toml | 2 +- deploy/man/{openshell.1.md => os.1.md} | 31 +- deploy/rpm/QUICKSTART.md | 18 +- deploy/rpm/TROUBLESHOOTING.md | 36 +- e2e/cedar/README.md | 2 +- e2e/cedar/test.sh | 2 +- e2e/gpu/README.md | 2 +- e2e/kubernetes/app-listener/README.md | 2 +- e2e/kubernetes/app-listener/run.py | 2 +- e2e/kubernetes/app-listener/verify.py | 2 +- e2e/mcp-conformance.sh | 2 +- .../client-through-openshell.sh | 6 +- e2e/policy-advisor/README.md | 8 +- .../existing-endpoint-auto-approve.sh | 2 +- e2e/policy-advisor/test.sh | 4 +- e2e/policy-advisor/wait-smoke.sh | 6 +- e2e/run.sh | 4 +- e2e/rust/e2e-kubernetes.sh | 2 +- e2e/rust/e2e-podman.sh | 2 +- e2e/rust/e2e-vm.sh | 6 +- e2e/rust/src/harness/binary.rs | 10 +- e2e/rust/src/harness/cli.rs | 2 +- e2e/rust/src/harness/container.rs | 2 +- e2e/rust/src/harness/sandbox.rs | 10 +- e2e/rust/tests/edge_tunnel_e2e.rs | 11 +- e2e/rust/tests/policy_dns_ipv6_egress.rs | 4 +- e2e/rust/tests/user_namespaces.rs | 2 +- e2e/support/gateway-common.sh | 4 +- e2e/with-kube-gateway.sh | 6 +- .../agent-driven-policy-management/README.md | 12 +- .../agent-driven-policy-management/demo.sh | 8 +- .../policy.template.yaml | 2 +- examples/aws-s3-sts.md | 22 +- examples/bring-your-own-container/Dockerfile | 2 +- examples/bring-your-own-container/README.md | 6 +- examples/codex-app-server/README.md | 18 +- examples/gateway-deploy-connect.md | 26 +- examples/governance-interceptor/smoke.sh | 6 +- examples/isolation-backend-v8/README.md | 10 +- examples/jupyter-sandbox/README.md | 4 +- examples/kilo-provider/README.md | 12 +- examples/local-inference/README.md | 20 +- examples/local-inference/inference.py | 2 +- examples/policy-advisor/README.md | 12 +- examples/policy-advisor/ctf.py | 2 +- examples/private-ip-routing/README.md | 2 +- examples/sandbox-policy-quickstart/README.md | 16 +- examples/sandbox-policy-quickstart/demo.sh | 18 +- .../sandbox-policy-quickstart/policy.yaml | 6 +- examples/spiffe-token-exchange-demo/README.md | 12 +- examples/spiffe-token-exchange-demo/demo.sh | 8 +- .../podman/README.md | 6 +- .../spiffe-token-exchange-demo/podman/demo.sh | 8 +- .../podman/start-gateway.sh | 2 +- examples/spiffe-token-grant-demo/README.md | 12 +- examples/spiffe-token-grant-demo/demo.sh | 6 +- .../README.md | 2 +- .../smoke.sh | 4 +- examples/sync-files.md | 22 +- examples/transparent-tcp-redis/demo.sh | 12 +- examples/vscode-remote-sandbox.md | 8 +- install.sh | 27 +- nix/test-guest/README.md | 14 +- .../openshell-development/defaults/main.yml | 2 +- .../roles/openshell-rpm/defaults/main.yml | 2 +- openshell.spec | 13 +- scripts/agents/README.md | 2 +- scripts/bin/openshell | 176 +----- scripts/bin/os | 177 ++++++ scripts/smoke-test-network-policy.sh | 32 +- scripts/update_license_headers.py | 2 +- snapcraft.yaml | 27 +- tasks/scripts/gateway-docker.sh | 8 +- tasks/scripts/gateway-vm.sh | 4 +- tasks/scripts/package-deb-install.sh | 6 +- tasks/scripts/package-deb.sh | 6 +- tasks/scripts/release.py | 9 +- tasks/scripts/release_formula_test.py | 8 +- tasks/scripts/sandbox.sh | 16 +- tasks/scripts/test-packaging-assets.sh | 32 +- tasks/scripts/windows-msvc.ps1 | 2 +- tasks/term.toml | 4 +- tasks/test.toml | 2 +- tests/runner/src/collect-k3s.sh | 4 +- tests/runner/src/execute.rs | 4 +- tests/suites/conformance/src/cli.rs | 2 +- tests/suites/conformance/src/port_forward.rs | 2 +- tests/suites/conformance/src/settings.rs | 2 +- .../features/oidc-auth/tests/oidc_auth.rs | 2 +- tests/support/host-server/src/tcp.rs | 2 +- tests/support/keycloak/src/browser.rs | 2 +- tests/support/keycloak/src/session.rs | 2 +- tests/testkit/README.md | 4 +- tests/testkit/testkit/src/cli.rs | 2 +- tests/testkit/testkit/src/cli_sandbox.rs | 4 +- tests/testkit/testkit/src/gateway.rs | 4 +- tests/testkit/testkit/src/logs.rs | 10 +- .../ansible/playbooks/drivers/podman/e2e.yaml | 8 +- .../ansible/playbooks/openshell-k3s-ha.yaml | 2 +- .../ansible/playbooks/openshell-k3s.yaml | 2 +- .../tmachine/ansible/playbooks/openshell.yaml | 2 +- .../tmachine/ansible/playbooks/upgrade/deb.sh | 9 +- .../ansible/playbooks/upgrade/rpm.sh.j2 | 9 +- .../files/collect-k3s.sh | 4 +- tests/tmachine/artifacts.nix | 12 +- tests/tmachine/config.nix | 4 +- 165 files changed, 1159 insertions(+), 1075 deletions(-) rename deploy/man/{openshell.1.md => os.1.md} (86%) mode change 100755 => 120000 scripts/bin/openshell create mode 100755 scripts/bin/os diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 762a1c3bd2..e129538c39 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -62,7 +62,7 @@ body: label: Reproduction Steps description: Provide minimal steps using only an OpenShell deployment. Do not install third-party tools solely to reproduce the issue. placeholder: | - 1. Run `openshell sandbox create ...` + 1. Run `os sandbox create ...` 2. ... validations: required: true @@ -82,7 +82,7 @@ body: label: Environment description: Include the OpenShell version and relevant OpenShell deployment details. placeholder: | - - OpenShell: v0.x.x (output of `openshell --version`) + - OpenShell: v0.x.x (output of `os --version`) - OS: macOS 15.2 / Ubuntu 24.04 / Windows 11 + WSL2 - OpenShell deployment mode and runtime: validations: diff --git a/.github/actions/setup-e2e-cli/action.yml b/.github/actions/setup-e2e-cli/action.yml index 6bc2a78ec2..783c0c0b2e 100644 --- a/.github/actions/setup-e2e-cli/action.yml +++ b/.github/actions/setup-e2e-cli/action.yml @@ -19,7 +19,7 @@ runs: - name: Configure prebuilt CLI shell: bash run: | - cli="$GITHUB_WORKSPACE/.e2e/prebuilt-cli/openshell" + cli="$GITHUB_WORKSPACE/.e2e/prebuilt-cli/os" chmod +x "$cli" "$cli" --version echo "OPENSHELL_BIN=$cli" >> "$GITHUB_ENV" diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 411572ee33..a0d725fe64 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -215,7 +215,7 @@ jobs: include: >- *.rs *.proto *.py *.sh *.toml *.yaml *.yml *.rego *.ts *.tsx *.mts *.cts *.mjs *.css *.in *.service *.tpl - Dockerfile* */Dockerfile* scripts/bin/openshell + Dockerfile* */Dockerfile* scripts/bin/os scripts/keycloak-realm.json sdk/conformance/oauth-client-credentials.json sdk/conformance/oidc-token-bundle.json diff --git a/.github/workflows/build-binaries-linux.yml b/.github/workflows/build-binaries-linux.yml index 9b41355382..76b8b3bc00 100644 --- a/.github/workflows/build-binaries-linux.yml +++ b/.github/workflows/build-binaries-linux.yml @@ -37,7 +37,9 @@ jobs: name: openshell (${{ matrix.triple }}) env: PACKAGE: openshell-cli - BINARY: openshell + BINARY: os + # Release assets keep the openshell package name; the binary inside is os. + ARTIFACT_NAME: openshell-${{ matrix.triple }} strategy: matrix: include: @@ -60,6 +62,7 @@ jobs: with: package: ${{ env.PACKAGE }} binary: ${{ env.BINARY }} + artifact-name: ${{ env.ARTIFACT_NAME }} triple: ${{ matrix.triple }} cargo-version: ${{ inputs.cargo-version }} supervisor-image-tag: ${{ inputs.supervisor-image-tag }} diff --git a/.github/workflows/build-binaries-macos.yml b/.github/workflows/build-binaries-macos.yml index 574b6d181a..3529443570 100644 --- a/.github/workflows/build-binaries-macos.yml +++ b/.github/workflows/build-binaries-macos.yml @@ -37,7 +37,9 @@ jobs: matrix: include: - package: openshell-cli - binary: openshell + binary: os + # Release assets keep the openshell package name; the binary inside is os. + artifact-name: openshell-aarch64-apple-darwin triple: aarch64-apple-darwin - package: openshell-prover-cli binary: openshell-prover @@ -69,6 +71,7 @@ jobs: with: package: ${{ matrix.package }} binary: ${{ matrix.binary }} + artifact-name: ${{ matrix.artifact-name }} triple: ${{ matrix.triple }} cargo-version: ${{ inputs.cargo-version }} supervisor-image-tag: ${{ inputs.supervisor-image-tag }} diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index 2262fc75ef..2e78d575da 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -105,7 +105,7 @@ jobs: - name: Configure package inputs run: | set -euo pipefail - chmod +x package-binaries/openshell{,-gateway,-prover,-driver-podman,-driver-docker} + chmod +x package-binaries/{os,openshell-gateway,openshell-prover,openshell-driver-podman,openshell-driver-docker} ls -lah package-binaries - name: Mark workspace safe for git diff --git a/.github/workflows/deb-package.yml b/.github/workflows/deb-package.yml index a4f5cd4650..5cfac9499b 100644 --- a/.github/workflows/deb-package.yml +++ b/.github/workflows/deb-package.yml @@ -78,13 +78,13 @@ jobs: - name: Configure package inputs run: | set -euo pipefail - chmod +x package-binaries/openshell{,-gateway,-prover,-driver-vm,-driver-podman,-driver-docker} + chmod +x package-binaries/{os,openshell-gateway,openshell-prover,openshell-driver-vm,openshell-driver-podman,openshell-driver-docker} ls -lah package-binaries - name: Build Debian package run: | set -euo pipefail - OPENSHELL_CLI_BINARY="${PWD}/package-binaries/openshell" \ + OPENSHELL_CLI_BINARY="${PWD}/package-binaries/os" \ OPENSHELL_GATEWAY_BINARY="${PWD}/package-binaries/openshell-gateway" \ OPENSHELL_PROVER_BINARY="${PWD}/package-binaries/openshell-prover" \ OPENSHELL_DRIVER_VM_BINARY="${PWD}/package-binaries/openshell-driver-vm" \ diff --git a/.github/workflows/package-release-binaries.yml b/.github/workflows/package-release-binaries.yml index bd24b0ba01..1a47bef93e 100644 --- a/.github/workflows/package-release-binaries.yml +++ b/.github/workflows/package-release-binaries.yml @@ -25,13 +25,16 @@ jobs: matrix: include: - artifact: openshell-x86_64-unknown-linux-musl - binary: openshell + binary: os + deprecated-link: openshell package: cli-linux-amd64 - artifact: openshell-aarch64-unknown-linux-musl - binary: openshell + binary: os + deprecated-link: openshell package: cli-linux-arm64 - artifact: openshell-aarch64-apple-darwin - binary: openshell + binary: os + deprecated-link: openshell package: cli-macos - artifact: openshell-gateway-x86_64-unknown-linux-gnu binary: openshell-gateway @@ -101,10 +104,17 @@ jobs: env: ARTIFACT: ${{ matrix.artifact }} BINARY: ${{ matrix.binary }} + DEPRECATED_LINK: ${{ matrix.deprecated-link }} run: | set -euo pipefail chmod +x "raw/${BINARY}" - tar -czf "${ARTIFACT}.tar.gz" -C raw "${BINARY}" + entries=("${BINARY}") + # Keep the deprecated command name as a link to the renamed binary. + if [ -n "${DEPRECATED_LINK}" ]; then + ln -s "${BINARY}" "raw/${DEPRECATED_LINK}" + entries+=("${DEPRECATED_LINK}") + fi + tar -czf "${ARTIFACT}.tar.gz" -C raw "${entries[@]}" - name: Upload ${{ matrix.package }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml index 9cfe3a9392..e0ac5259a0 100644 --- a/.github/workflows/release-canary.yml +++ b/.github/workflows/release-canary.yml @@ -35,8 +35,8 @@ jobs: run: | set -euo pipefail curl -LsSf https://raw.githubusercontent.com/ai-openshell/openshell/${INSTALL_SHA}/install.sh | sh - openshell --version - openshell status + os --version + os status # GitHub-hosted macOS runners do not expose the Hypervisor.framework # support libkrun needs. Sandbox launch is covered by the VM E2E lane. @@ -86,11 +86,11 @@ jobs: run: | set -euo pipefail curl -LsSf https://raw.githubusercontent.com/ai-openshell/openshell/${INSTALL_SHA}/install.sh | sh - openshell status + os status sandbox="rc-${GITHUB_RUN_ID}" - openshell sandbox create --name "$sandbox" --detach - openshell sandbox exec --name "$sandbox" --no-tty -- true - openshell sandbox delete "$sandbox" + os sandbox create --name "$sandbox" --detach + os sandbox exec --name "$sandbox" --no-tty -- true + os sandbox delete "$sandbox" fedora: name: Fedora RPM @@ -181,10 +181,10 @@ jobs: "$OPENSHELL_TELEMETRY_ENABLED" > "${HOME}/.config/openshell/gateway.env" podman info curl -LsSf "${INSTALL_SH_URL}" | sh - openshell status - openshell sandbox create --name "$CANARY_SANDBOX" --detach - openshell sandbox exec --name "$CANARY_SANDBOX" --no-tty -- true - openshell sandbox delete "$CANARY_SANDBOX" + os status + os sandbox create --name "$CANARY_SANDBOX" --detach + os sandbox exec --name "$CANARY_SANDBOX" --no-tty -- true + os sandbox delete "$CANARY_SANDBOX" EOF - name: Stop Fedora systemd container @@ -242,6 +242,8 @@ jobs: docker info sudo snap connections openshell | grep -E '^docker +openshell:docker +:docker +' openshell --version + # The renamed CLI; the bare `os` alias depends on Snap Store approval. + openshell.os --version openshell-prover --version snap services openshell systemctl --user is-enabled --quiet snap.openshell.user-gateway.service @@ -467,12 +469,12 @@ jobs: - name: Register kind gateway and check status run: | set -euo pipefail - openshell gateway add http://127.0.0.1:8080 --local --name "$KIND_GATEWAY_NAME" - openshell status + os gateway add http://127.0.0.1:8080 --local --name "$KIND_GATEWAY_NAME" + os status sandbox="rc-${GITHUB_RUN_ID}" - openshell sandbox create --name "$sandbox" --detach - openshell sandbox exec --name "$sandbox" --no-tty -- true - openshell sandbox delete "$sandbox" + os sandbox create --name "$sandbox" --detach + os sandbox exec --name "$sandbox" --no-tty -- true + os sandbox delete "$sandbox" - name: Diagnostics on failure if: failure() @@ -492,7 +494,7 @@ jobs: --tail=200 --all-containers --prefix echo "--- port-forward log ---" cat port-forward.log 2>/dev/null - echo "--- openshell gateway list ---" - openshell gateway list 2>/dev/null + echo "--- os gateway list ---" + os gateway list 2>/dev/null echo "--- openshell version ---" - openshell --version 2>/dev/null + os --version 2>/dev/null diff --git a/.github/workflows/snap-package.yml b/.github/workflows/snap-package.yml index 6597b28df1..2daa867aad 100644 --- a/.github/workflows/snap-package.yml +++ b/.github/workflows/snap-package.yml @@ -70,7 +70,7 @@ jobs: - name: Configure prebuilt binaries run: | set -euo pipefail - chmod +x prebuilt/cli/openshell + chmod +x prebuilt/cli/os chmod +x prebuilt/prover/openshell-prover chmod +x prebuilt/gateway/openshell-gateway chmod +x prebuilt/docker-driver/openshell-driver-docker @@ -82,7 +82,7 @@ jobs: set -euo pipefail mkdir -p snap/prebuilt - cp prebuilt/cli/openshell snap/prebuilt/openshell + cp prebuilt/cli/os snap/prebuilt/os cp prebuilt/prover/openshell-prover snap/prebuilt/openshell-prover cp prebuilt/gateway/openshell-gateway snap/prebuilt/openshell-gateway cp prebuilt/docker-driver/openshell-driver-docker snap/prebuilt/openshell-driver-docker diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 214db74a21..deba2e2729 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -365,7 +365,7 @@ with `--features experimental`, or use published Release Dev artifacts. Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will 1. Build `openshell-cli` if needed. -2. Run the local debug CLI binary under `target/debug/openshell`. +2. Run the local debug CLI binary under `target/debug/os`. Because `mise` adds `scripts/bin` to `PATH` for this project, you can run `openshell` directly from the repo. diff --git a/TESTING.md b/TESTING.md index 5cf0592fd0..741f7d8940 100644 --- a/TESTING.md +++ b/TESTING.md @@ -604,7 +604,7 @@ configuration: ```shell cargo build --package openshell-cli -OPENSHELL_BIN="$PWD/target/debug/openshell" \ +OPENSHELL_BIN="$PWD/target/debug/os" \ cargo nextest run \ --locked \ --manifest-path tests/suites/conformance/Cargo.toml \ diff --git a/crates/openshell-cli/Cargo.toml b/crates/openshell-cli/Cargo.toml index 882b7c35d7..10fb7e4fdb 100644 --- a/crates/openshell-cli/Cargo.toml +++ b/crates/openshell-cli/Cargo.toml @@ -11,7 +11,7 @@ license.workspace = true repository.workspace = true [[bin]] -name = "openshell" +name = "os" path = "src/main.rs" [dependencies] diff --git a/crates/openshell-cli/src/auth.rs b/crates/openshell-cli/src/auth.rs index 44b4c50ead..44704df44a 100644 --- a/crates/openshell-cli/src/auth.rs +++ b/crates/openshell-cli/src/auth.rs @@ -117,7 +117,7 @@ pub async fn browser_auth_flow(gateway_endpoint: &str) -> Result { if no_browser { return Err(miette::miette!( "authentication skipped (OPENSHELL_NO_BROWSER is set).\n\ - Authenticate later with: openshell gateway login" + Authenticate later with: os gateway login" )); } @@ -179,7 +179,7 @@ pub async fn browser_auth_flow(gateway_endpoint: &str) -> Result { () = tokio::time::sleep(AUTH_TIMEOUT) => { return Err(miette::miette!( "authentication timed out after {} seconds.\n\ - Try again with: openshell gateway login", + Try again with: os gateway login", AUTH_TIMEOUT.as_secs() )); } diff --git a/crates/openshell-cli/src/color.rs b/crates/openshell-cli/src/color.rs index 460afb5c00..c57105ec83 100644 --- a/crates/openshell-cli/src/color.rs +++ b/crates/openshell-cli/src/color.rs @@ -18,7 +18,7 @@ //! their own default, so [`init`] brings them under the same setting: //! //! - `tracing_subscriber` formats with ANSI on, does no terminal detection, and -//! writes to stdout. Left alone, `openshell -v ... | ...` leaks escapes into a +//! writes to stdout. Left alone, `os -v ... | ...` leaks escapes into a //! pipe exactly like the styled tables did. `main` passes [`stdout_enabled`] //! to `with_ansi`. //! - `indicatif` and `dialoguer` both style through `console`, which has its own diff --git a/crates/openshell-cli/src/commands/common.rs b/crates/openshell-cli/src/commands/common.rs index dcfbaca465..449459a602 100644 --- a/crates/openshell-cli/src/commands/common.rs +++ b/crates/openshell-cli/src/commands/common.rs @@ -629,7 +629,7 @@ pub fn parse_cli_setting_value(key: &str, raw_value: &str) -> Result { - // Reject typos client-side so `openshell settings set ... + // Reject typos client-side so `os settings set ... // proposal_approval_mode autom` errors immediately instead of // round-tripping through the server. The server enforces the // same check independently for non-CLI callers. @@ -883,11 +883,11 @@ fn credential_env_warnings( s.display_name )); lines.push(format!( - " openshell provider create --name my-{ty} --type {ty} --runtime-credentials", + " os provider create --name my-{ty} --type {ty} --runtime-credentials", ty = s.provider_type )); lines.push(format!( - " Then run openshell provider refresh configure my-{} --credential-key {} --strategy {strategy}", + " Then run os provider refresh configure my-{} --credential-key {} --strategy {strategy}", s.provider_type, s.credential_key )); let material = refresh @@ -909,12 +909,12 @@ fn credential_env_warnings( s.display_name )); lines.push(format!( - " openshell provider create --name my-{ty} --type {ty} --credential {key}", + " os provider create --name my-{ty} --type {ty} --credential {key}", ty = s.provider_type )); } } - lines.push(" openshell sandbox create --provider my- ...".to_owned()); + lines.push(" os sandbox create --provider my- ...".to_owned()); } lines.push(format!(" See: {DOCS_PROVIDERS_URL}")); lines.push(String::new()); @@ -1360,17 +1360,17 @@ mod tests { let warnings = credential_env_warnings(&env(&[(key, "secretVALUE42")]), catalog()); let warning = &warnings[0]; assert!(warning.contains(&format!( - "openshell provider create --name my-github --type github --credential {key}" + "os provider create --name my-github --type github --credential {key}" ))); assert!(warning.contains("GitHub (existing token or credential)")); assert!( warning.contains("GitHub App (github-app-installation, gateway-managed refresh)") ); assert!(warning.contains( - "openshell provider create --name my-github-app --type github-app --runtime-credentials" + "os provider create --name my-github-app --type github-app --runtime-credentials" )); assert!(warning.contains(&format!( - "openshell provider refresh configure my-github-app --credential-key {} --strategy github-app-installation", + "os provider refresh configure my-github-app --credential-key {} --strategy github-app-installation", key.to_ascii_uppercase() ))); assert!( diff --git a/crates/openshell-cli/src/commands/gateway.rs b/crates/openshell-cli/src/commands/gateway.rs index 7a45edd1d9..a6324be0ed 100644 --- a/crates/openshell-cli/src/commands/gateway.rs +++ b/crates/openshell-cli/src/commands/gateway.rs @@ -429,7 +429,7 @@ pub async fn gateway_info( pub fn gateway_info_not_configured() -> Result<()> { Err(miette!( - "No gateway configured.\nRegister a gateway with: openshell gateway add " + "No gateway configured.\nRegister a gateway with: os gateway add " )) } @@ -553,8 +553,8 @@ pub fn gateway_use(name: &str) -> Result<()> { get_gateway_metadata(name).ok_or_else(|| { miette::miette!( "No gateway metadata found for '{name}'.\n\ - Register it first with: openshell gateway add --name {name}\n\ - Or list available gateways: openshell gateway select" + Register it first with: os gateway add --name {name}\n\ + Or list available gateways: os gateway select" ) })?; @@ -799,7 +799,7 @@ where eprintln!(); eprintln!( "Select a gateway with: {}", - "openshell gateway select ".dimmed() + "os gateway select ".dimmed() ); } return Ok(()); @@ -918,7 +918,7 @@ pub async fn gateway_add( Some(GatewayMetadataSource::User) => { return Err(miette::miette!( "Gateway '{}' already exists.\n\ - Remove it first with: openshell gateway remove {}\n\ + Remove it first with: os gateway remove {}\n\ Or choose a different name with: --name ", name, name, @@ -1040,9 +1040,9 @@ pub async fn gateway_add( if has_mtls_certs { let https_endpoint = endpoint.replacen("http://", "https://", 1); let suggestion = if is_loopback_gateway_endpoint(&endpoint) { - format!("openshell gateway add --local {https_endpoint}") + format!("os gateway add --local {https_endpoint}") } else { - format!("openshell gateway add {https_endpoint}") + format!("os gateway add {https_endpoint}") }; eprintln!( "{} mTLS certificates found for gateway '{name}'. Did you mean to use https?", @@ -1095,7 +1095,7 @@ pub async fn gateway_add( "mTLS certificates for gateway '{name}' were not found.\n\ Expected them under the default gateway config directory.\n\ Start the gateway package first so it provisions client TLS material, \ - then retry: openshell gateway add {endpoint}{}", + then retry: os gateway add {endpoint}{}", if local { " --local" } else { "" }, )); } @@ -1194,7 +1194,7 @@ pub async fn gateway_login(name: &str, gateway_insecure: bool) -> Result<()> { let metadata = openshell_bootstrap::load_gateway_metadata(name).map_err(|_| { miette::miette!( "Unknown gateway '{name}'.\n\ - List available gateways: openshell gateway select" + List available gateways: os gateway select" ) })?; @@ -1267,7 +1267,7 @@ pub fn gateway_logout(name: &str) -> Result<()> { let metadata = openshell_bootstrap::load_gateway_metadata(name).map_err(|_| { miette::miette!( "Unknown gateway '{name}'.\n\ - List available gateways: openshell gateway select" + List available gateways: os gateway select" ) })?; @@ -1305,7 +1305,7 @@ pub fn gateway_list(gateway_flag: &Option, output: &str) -> Result<()> { println!(); println!( "Register a gateway with: {}", - "openshell gateway add ".dimmed() + "os gateway add ".dimmed() ); return Ok(()); } @@ -1547,7 +1547,7 @@ pub fn gateway_remove(name: &str) -> Result<()> { None => { return Err(miette::miette!( "No gateway metadata found for '{name}'.\n\ - List available gateways: openshell gateway select" + List available gateways: os gateway select" )); } } diff --git a/crates/openshell-cli/src/commands/provider.rs b/crates/openshell-cli/src/commands/provider.rs index b619cfb96e..100a7b4107 100644 --- a/crates/openshell-cli/src/commands/provider.rs +++ b/crates/openshell-cli/src/commands/provider.rs @@ -503,7 +503,7 @@ async fn auto_create_provider( if auto_providers_override.is_none() && !std::io::stdin().is_terminal() { return Err(miette::miette!( "missing required provider '{provider_type}'. Create it first with \ - `openshell provider create --type {provider_type} --name {provider_type} --from-existing`, \ + `os provider create --type {provider_type} --name {provider_type} --from-existing`, \ pass --auto-providers to auto-create, or set it up manually from inside the sandbox" )); } @@ -537,7 +537,7 @@ async fn auto_create_provider( None => { return Err(miette::miette!( "no existing local credentials found for provider profile '{provider_type}'. \ - Create it first with `openshell provider create --type {provider_type} --name {provider_type} --credential `" + Create it first with `os provider create --type {provider_type} --name {provider_type} --credential `" )); } }; @@ -697,7 +697,7 @@ fn read_gcloud_adc() -> Result<(String, String, String)> { "Application Default Credentials are a service account key, not user credentials. \ To use a service account, create the provider with the service account JSON key \ and configure gateway-managed refresh for 'GOOGLE_VERTEX_AI_SERVICE_ACCOUNT_TOKEN'. \ - See: openshell provider create --help" + See: os provider create --help" )); } Some("authorized_user") => {} @@ -766,7 +766,7 @@ async fn rollback_provider_create_after_gcloud_adc_failure( Err(cleanup_err) => { eprintln!( "{} Failed to clean up provider '{}' after {} failed: {}. \ - Run 'openshell provider delete {}' to remove it manually.", + Run 'os provider delete {}' to remove it manually.", "⚠".yellow(), provider_name, stage, @@ -776,7 +776,7 @@ async fn rollback_provider_create_after_gcloud_adc_failure( Err(miette!( "failed to {stage} credentials from gcloud ADC for provider '{provider_name}': {source}. \ Cleanup also failed, so the provider may still exist. \ - Run 'openshell provider delete {provider_name}' to remove it manually." + Run 'os provider delete {provider_name}' to remove it manually." )) } } diff --git a/crates/openshell-cli/src/commands/secret.rs b/crates/openshell-cli/src/commands/secret.rs index 36c10922ce..c05b045b36 100644 --- a/crates/openshell-cli/src/commands/secret.rs +++ b/crates/openshell-cli/src/commands/secret.rs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -//! `openshell secret`: workspace secrets used as shared minting material. +//! `os secret`: workspace secrets used as shared minting material. //! //! Values are read from an environment variable or a file, never from a //! command-line argument, and the gateway never returns them to this CLI. @@ -189,7 +189,7 @@ pub async fn secret_get( println!(" {} {}", "Value updated:".dimmed(), value_updated(&secret)); if is_deleting(&secret) { println!( - " {} deletion did not finish; rerun `openshell secret delete {}`", + " {} deletion did not finish; rerun `os secret delete {}`", "Deleting:".dimmed(), secret_name(&secret) ); diff --git a/crates/openshell-cli/src/main.rs b/crates/openshell-cli/src/main.rs index 5cca485033..93f2077524 100644 --- a/crates/openshell-cli/src/main.rs +++ b/crates/openshell-cli/src/main.rs @@ -130,16 +130,16 @@ fn resolve_gateway( .ok_or_else(|| { miette::miette!( "No active gateway.\n\ - Set one with: openshell gateway select \n\ - Or register one with: openshell gateway add " + Set one with: os gateway select \n\ + Or register one with: os gateway add " ) })?; let metadata = load_gateway_metadata(&name).map_err(|_| { miette::miette!( "Unknown gateway '{name}'.\n\ - Register it first: openshell gateway add --name {name}\n\ - Or list available gateways: openshell gateway select" + Register it first: os gateway add --name {name}\n\ + Or list available gateways: os gateway select" ) })?; @@ -198,7 +198,7 @@ fn apply_auth_with_status(tls: &mut TlsOptions, gateway_name: &str) -> Option Option Option, gateway: &str, workspace: &str) -> let last = load_last_sandbox(gateway, workspace).ok_or_else(|| { miette::miette!( "No sandbox name provided and no last-used sandbox.\n\ - Specify a sandbox name or connect to one first: openshell sandbox connect " + Specify a sandbox name or connect to one first: os sandbox connect " ) })?; eprintln!("{} Using sandbox '{}' (last used)", "→".bold(), last.bold()); @@ -310,9 +310,9 @@ const HELP_TEMPLATE: &str = "\ {options} \x1b[1mEXAMPLES\x1b[0m - $ openshell sandbox create - $ openshell gateway add http://127.0.0.1:8080 --local - $ openshell logs my-sandbox + $ os sandbox create + $ os gateway add http://127.0.0.1:8080 --local + $ os logs my-sandbox \x1b[1mLEARN MORE\x1b[0m Use `openshell --help` for more information about a command. @@ -344,123 +344,123 @@ const SANDBOX_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m sb \x1b[1mEXAMPLES\x1b[0m - $ openshell sandbox create - $ openshell sandbox create --from registry.example.com/agents/python:latest - $ openshell sandbox connect my-sandbox - $ openshell sandbox list - $ openshell sandbox delete my-sandbox + $ os sandbox create + $ os sandbox create --from registry.example.com/agents/python:latest + $ os sandbox connect my-sandbox + $ os sandbox list + $ os sandbox delete my-sandbox "; const FORWARD_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m fwd \x1b[1mEXAMPLES\x1b[0m - $ openshell forward start 8080 - $ openshell forward start 3000 my-sandbox - $ openshell forward service my-sandbox --target-port 8000 --local 8000 - $ openshell forward stop 8080 - $ openshell forward list + $ os forward start 8080 + $ os forward start 3000 my-sandbox + $ os forward service my-sandbox --target-port 8000 --local 8000 + $ os forward stop 8080 + $ os forward list "; const SERVICE_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m svc \x1b[1mEXAMPLES\x1b[0m - $ openshell service expose my-sandbox 8080 - $ openshell service expose my-sandbox 8080 web - $ openshell service list - $ openshell service list my-sandbox - $ openshell service get my-sandbox web - $ openshell service delete my-sandbox web + $ os service expose my-sandbox 8080 + $ os service expose my-sandbox 8080 web + $ os service list + $ os service list my-sandbox + $ os service get my-sandbox web + $ os service delete my-sandbox web "; const LOGS_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m lg \x1b[1mEXAMPLES\x1b[0m - $ openshell logs my-sandbox - $ openshell logs my-sandbox --tail - $ openshell logs --since 5m - $ openshell logs --source sandbox --level debug + $ os logs my-sandbox + $ os logs my-sandbox --tail + $ os logs --since 5m + $ os logs --source sandbox --level debug "; const POLICY_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m pol \x1b[1mEXAMPLES\x1b[0m - $ openshell policy get my-sandbox - $ openshell policy set my-sandbox --policy policy.yaml - $ openshell policy update my-sandbox --add-endpoint api.github.com:443:read-only:rest:enforce - $ openshell policy update my-sandbox --add-endpoint realtime.example.com:443:read-write:websocket:enforce:websocket-credential-rewrite,allowed-ip=10.0.0.0/8 - $ openshell policy update my-sandbox --rule-name github --binary /usr/bin/gh --add-allow 'api.github.com:443:GET:/repos/**' - $ openshell policy set --global --policy policy.yaml - $ openshell policy delete --global - $ openshell policy list my-sandbox + $ os policy get my-sandbox + $ os policy set my-sandbox --policy policy.yaml + $ os policy update my-sandbox --add-endpoint api.github.com:443:read-only:rest:enforce + $ os policy update my-sandbox --add-endpoint realtime.example.com:443:read-write:websocket:enforce:websocket-credential-rewrite,allowed-ip=10.0.0.0/8 + $ os policy update my-sandbox --rule-name github --binary /usr/bin/gh --add-allow 'api.github.com:443:GET:/repos/**' + $ os policy set --global --policy policy.yaml + $ os policy delete --global + $ os policy list my-sandbox "; const SETTINGS_EXAMPLES: &str = "\x1b[1mEXAMPLES\x1b[0m - $ openshell settings get my-sandbox - $ openshell settings get --global - $ openshell settings set my-sandbox --key ocsf_json_enabled --value true - $ openshell settings set --global --key ocsf_json_enabled --value true - $ openshell settings delete --global --key ocsf_json_enabled + $ os settings get my-sandbox + $ os settings get --global + $ os settings set my-sandbox --key ocsf_json_enabled --value true + $ os settings set --global --key ocsf_json_enabled --value true + $ os settings delete --global --key ocsf_json_enabled "; const PROVIDER_EXAMPLES: &str = "\x1b[1mEXAMPLES\x1b[0m - $ openshell provider create --name openai --type openai --credential OPENAI_API_KEY - $ openshell provider create --name anthropic --type anthropic --from-existing - $ openshell provider list - $ openshell provider get openai - $ openshell provider delete openai + $ os provider create --name openai --type openai --credential OPENAI_API_KEY + $ os provider create --name anthropic --type anthropic --from-existing + $ os provider list + $ os provider get openai + $ os provider delete openai "; const PROFILE_EXAMPLES: &str = "\x1b[1mEXAMPLES\x1b[0m - $ openshell profile list - $ openshell profile list --type provider -o json - $ openshell profile describe openai - $ openshell profile export openai - $ openshell profile import -f custom-api.yaml + $ os profile list + $ os profile list --type provider -o json + $ os profile describe openai + $ os profile export openai + $ os profile import -f custom-api.yaml "; const WORKSPACE_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m ws \x1b[1mEXAMPLES\x1b[0m - $ openshell workspace create --name staging - $ openshell workspace list - $ openshell workspace get staging - $ openshell workspace delete staging + $ os workspace create --name staging + $ os workspace list + $ os workspace get staging + $ os workspace delete staging "; const SECRET_EXAMPLES: &str = "\x1b[1mEXAMPLES\x1b[0m - $ openshell secret create acme-oauth-client --value-env CLIENT_SECRET \\ + $ os secret create acme-oauth-client --value-env CLIENT_SECRET \\ --allowed-endpoint https://login.example.com/oauth/token - $ openshell secret create signing-key --value-file ./signing-key.pem - $ openshell secret update acme-oauth-client --value-file ./client-secret - $ openshell secret list - $ openshell secret delete acme-oauth-client + $ os secret create signing-key --value-file ./signing-key.pem + $ os secret update acme-oauth-client --value-file ./client-secret + $ os secret list + $ os secret delete acme-oauth-client "; const GATEWAY_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m gw \x1b[1mEXAMPLES\x1b[0m - $ openshell gateway add http://127.0.0.1:8080 --local - $ openshell gateway select my-gateway - $ openshell gateway info - $ openshell gateway remove my-gateway + $ os gateway add http://127.0.0.1:8080 --local + $ os gateway select my-gateway + $ os gateway info + $ os gateway remove my-gateway "; const DOCTOR_HELP: &str = "\x1b[1mALIAS\x1b[0m dr \x1b[1mEXAMPLES\x1b[0m - $ openshell doctor check + $ os doctor check "; /// `OpenShell` CLI - agent execution and management. #[derive(Parser, Debug)] -#[command(name = "openshell")] +#[command(name = "os")] #[command(author, version = openshell_core::VERSION, about, long_about = None)] #[command(propagate_version = true)] #[command(help_template = HELP_TEMPLATE)] @@ -759,22 +759,22 @@ shell before testing whether completions are working. First, ensure that you install `bash-completion` using your package manager. mkdir -p ~/.local/share/bash-completion/completions - openshell completions bash > ~/.local/share/bash-completion/completions/openshell + os completions bash > ~/.local/share/bash-completion/completions/openshell On macOS with Homebrew (install bash-completion first): mkdir -p $(brew --prefix)/etc/bash_completion.d - openshell completions bash > $(brew --prefix)/etc/bash_completion.d/openshell.bash-completion + os completions bash > $(brew --prefix)/etc/bash_completion.d/openshell.bash-completion \x1b[1mFISH\x1b[0m mkdir -p ~/.config/fish/completions - openshell completions fish > ~/.config/fish/completions/openshell.fish + os completions fish > ~/.config/fish/completions/openshell.fish \x1b[1mZSH\x1b[0m mkdir -p ~/.zfunc - openshell completions zsh > ~/.zfunc/_openshell + os completions zsh > ~/.zfunc/_openshell Then add the following to your .zshrc before compinit: @@ -782,7 +782,7 @@ Then add the following to your .zshrc before compinit: \x1b[1mPOWERSHELL\x1b[0m - openshell completions powershell >> $PROFILE + os completions powershell >> $PROFILE If no profile exists yet, create one first: @@ -792,7 +792,40 @@ If no profile exists yet, create one first: fn normalize_completion_script(output: Vec, executable: &std::path::Path) -> Result { let script = String::from_utf8(output) .map_err(|e| miette::miette!("generated completions were not valid UTF-8: {e}"))?; - Ok(script.replace(executable.to_string_lossy().as_ref(), "openshell")) + Ok(script.replace(executable.to_string_lossy().as_ref(), "os")) +} + +/// Former command name, still installed as a link to `os` during the transition. +const DEPRECATED_COMMAND_NAME: &str = "openshell"; + +/// Set to a non-empty value to hide the notice printed when invoked as `openshell`. +const SUPPRESS_RENAME_WARNING_ENV: &str = "OPENSHELL_SUPPRESS_RENAME_WARNING"; + +const RENAME_WARNING: &str = "warning: `openshell` has been renamed to `os`; `openshell` will be removed in a future release."; + +/// Whether the process was started through the deprecated `openshell` name. +fn invoked_as_deprecated_name(argv0: Option<&std::ffi::OsStr>) -> bool { + argv0 + .map(std::path::Path::new) + .and_then(std::path::Path::file_name) + .and_then(std::ffi::OsStr::to_str) + .is_some_and(|name| { + name == DEPRECATED_COMMAND_NAME + || name.eq_ignore_ascii_case(&format!("{DEPRECATED_COMMAND_NAME}.exe")) + }) +} + +fn rename_warning_suppressed(value: Option) -> bool { + value.is_some_and(|value| !value.is_empty()) +} + +fn warn_if_invoked_as_deprecated_name() { + let argv0 = std::env::args_os().next(); + if invoked_as_deprecated_name(argv0.as_deref()) + && !rename_warning_suppressed(std::env::var_os(SUPPRESS_RENAME_WARNING_ENV)) + { + eprintln!("{RENAME_WARNING}"); + } } #[derive(Clone, Debug, PartialEq, Eq, ValueEnum)] @@ -1366,7 +1399,7 @@ impl ProfileCommands { enum GatewayCommands { /// Add an existing gateway. /// - /// Registers a gateway endpoint so it appears in `openshell gateway select`. + /// Registers a gateway endpoint so it appears in `os gateway select`. /// /// An `http://...` endpoint is treated as a direct plaintext gateway and /// skips both mTLS client certificate lookup and browser authentication. @@ -1502,7 +1535,7 @@ enum DoctorCommands { /// reachable. Reports version info and socket path. /// /// Examples: - /// openshell doctor check + /// os doctor check #[command(help_template = LEAF_HELP_TEMPLATE)] Check, } @@ -1614,7 +1647,7 @@ enum SandboxCommands { forward: Option, /// Expose a loopback HTTP or WebSocket service after the sandbox is ready. - /// Keeps the sandbox alive. Use `openshell service expose` to add a named service. + /// Keeps the sandbox alive. Use `os service expose` to add a named service. #[arg( long, value_name = "PORT", @@ -1832,10 +1865,10 @@ enum SandboxCommands { /// For interactive shell sessions, use `sandbox connect` instead. /// /// Examples: - /// openshell sandbox exec my-sandbox -- ls -la /workspace - /// openshell sandbox exec --name my-sandbox -- ls -la /workspace - /// openshell sandbox exec -n my-sandbox --workdir /app -- python script.py - /// echo "hello" | openshell sandbox exec -n my-sandbox -- cat + /// os sandbox exec my-sandbox -- ls -la /workspace + /// os sandbox exec --name my-sandbox -- ls -la /workspace + /// os sandbox exec -n my-sandbox --workdir /app -- python script.py + /// echo "hello" | os sandbox exec -n my-sandbox -- cat #[command(help_template = LEAF_HELP_TEMPLATE, next_help_heading = "FLAGS")] Exec { /// Sandbox name (defaults to last-used sandbox). @@ -2847,6 +2880,7 @@ fn run_main() -> Result<()> { #[allow(clippy::large_stack_frames)] // CLI dispatch holds many futures; run on an expanded Windows stack. async fn run_async() -> Result<()> { CompleteEnv::with_factory(Cli::command).complete(); + warn_if_invoked_as_deprecated_name(); let (cli, explicit_gateway, explicit_endpoint) = { let mut args = Cli::command().get_matches(); @@ -2884,7 +2918,7 @@ async fn run_async() -> Result<()> { }; // The fmt formatter defaults to ANSI on with no terminal detection, and it - // writes to stdout, so without this `openshell -v ... | ...` pipes escapes + // writes to stdout, so without this `os -v ... | ...` pipes escapes // to the caller. tracing_subscriber::fmt() .with_ansi(color::stdout_enabled()) @@ -2937,8 +2971,8 @@ async fn run_async() -> Result<()> { .ok_or_else(|| { miette::miette!( "No active gateway.\n\ - Specify a gateway name: openshell gateway remove \n\ - Or list available gateways: openshell gateway select" + Specify a gateway name: os gateway remove \n\ + Or list available gateways: os gateway select" ) })?; run::gateway_remove(&name)?; @@ -2949,8 +2983,8 @@ async fn run_async() -> Result<()> { .ok_or_else(|| { miette::miette!( "No active gateway.\n\ - Specify a gateway name: openshell gateway login \n\ - Or set one with: openshell gateway select " + Specify a gateway name: os gateway login \n\ + Or set one with: os gateway select " ) })?; run::gateway_login(&name, cli.gateway_insecure).await?; @@ -2961,8 +2995,8 @@ async fn run_async() -> Result<()> { .ok_or_else(|| { miette::miette!( "No active gateway.\n\ - Specify a gateway name: openshell gateway logout \n\ - Or set one with: openshell gateway select " + Specify a gateway name: os gateway logout \n\ + Or set one with: os gateway select " ) })?; run::gateway_logout(&name)?; @@ -3035,7 +3069,7 @@ async fn run_async() -> Result<()> { println!(); println!( "Register a gateway with: {}", - "openshell gateway add ".dimmed() + "os gateway add ".dimmed() ); } } @@ -3202,7 +3236,7 @@ async fn run_async() -> Result<()> { spec.port, ); eprintln!(" Access at: {}", spec.access_url()); - eprintln!(" Stop with: openshell forward stop {} {name}", spec.port); + eprintln!(" Stop with: os forward stop {} {name}", spec.port); } } }, @@ -4647,7 +4681,7 @@ mod tests { #[test] fn policy_update_parses_explicit_l7_scope_and_endpoint_path() { let cli = Cli::try_parse_from([ - "openshell", + "os", "policy", "update", "sandbox-1", @@ -4688,7 +4722,7 @@ mod tests { #[test] fn policy_update_any_binary_is_explicit_and_conflicts_with_binary() { let args = [ - "openshell", + "os", "policy", "update", "--rule-name", @@ -4715,7 +4749,7 @@ mod tests { #[test] fn policy_update_add_endpoint_keeps_scope_defaults() { let cli = Cli::try_parse_from([ - "openshell", + "os", "policy", "update", "--add-endpoint", @@ -4760,7 +4794,7 @@ mod tests { #[test] fn completions_engine_returns_candidates() { let mut cmd = Cli::command(); - let args: Vec = vec!["openshell".into(), "".into()]; + let args: Vec = vec!["os".into(), "".into()]; let candidates = clap_complete::engine::complete(&mut cmd, args, 1, None) .expect("completion engine failed"); let names: Vec = candidates @@ -4789,7 +4823,7 @@ mod tests { #[test] fn completions_subcommand_appears_in_candidates() { let mut cmd = Cli::command(); - let args: Vec = vec!["openshell".into(), "comp".into()]; + let args: Vec = vec!["os".into(), "comp".into()]; let candidates = clap_complete::engine::complete(&mut cmd, args, 1, None) .expect("completion engine failed"); let names: Vec = candidates @@ -4805,7 +4839,7 @@ mod tests { #[test] fn sandbox_provider_subcommands_parse() { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "provider", "attach", @@ -4834,7 +4868,7 @@ mod tests { // Returns (target, command, tty) or the clap error kind. let parse = |args: &[&str]| { - let mut argv = vec!["openshell", "sandbox", "exec"]; + let mut argv = vec!["os", "sandbox", "exec"]; argv.extend(args); let cli = Cli::try_parse_from(argv).map_err(|e| e.kind())?; let Some(Commands::Sandbox { @@ -4915,7 +4949,7 @@ mod tests { fn provider_readiness_commands_have_bounded_waits_and_structured_output() { for action in ["attach", "detach", "status"] { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "provider", action, @@ -4947,7 +4981,7 @@ mod tests { for timeout in ["0", "3601"] { assert!( Cli::try_parse_from([ - "openshell", + "os", "provider", "update", "provider", @@ -4960,7 +4994,7 @@ mod tests { } assert!( Cli::try_parse_from([ - "openshell", + "os", "sandbox", "provider", "status", @@ -4981,7 +5015,7 @@ mod tests { let mut cmd = Cli::command(); let args: Vec = vec![ - "openshell".into(), + "os".into(), "sandbox".into(), "create".into(), "--policy".into(), @@ -5010,19 +5044,12 @@ mod tests { let cases: Vec<(Vec<&str>, usize, &str)> = vec![ ( - vec!["openshell", "sandbox", "upload", "demo", "Do"], + vec!["os", "sandbox", "upload", "demo", "Do"], 4, "Dockerfile", ), ( - vec![ - "openshell", - "sandbox", - "download", - "demo", - "/sandbox/file", - "Do", - ], + vec!["os", "sandbox", "download", "demo", "/sandbox/file", "Do"], 5, "Dockerfile", ), @@ -5072,7 +5099,7 @@ mod tests { let mut cmd = Cli::command(); let args: Vec = vec![ - "openshell".into(), + "os".into(), "sandbox".into(), "upload".into(), "demo".into(), @@ -5104,9 +5131,9 @@ mod tests { .expect("store gateway beta"); for (raw_args, index) in [ - (vec!["openshell", "--gateway", "a"], 2), - (vec!["openshell", "gateway", "select", "a"], 3), - (vec!["openshell", "gateway", "remove", "a"], 3), + (vec!["os", "--gateway", "a"], 2), + (vec!["os", "gateway", "select", "a"], 3), + (vec!["os", "gateway", "remove", "a"], 3), ] { let mut cmd = Cli::command(); let args: Vec = raw_args.iter().copied().map(Into::into).collect(); @@ -5184,15 +5211,53 @@ mod tests { } #[test] - fn completion_script_uses_openshell_command_name() { + fn completion_script_uses_os_command_name() { let script = normalize_completion_script( - b"/tmp/custom/openshell -- \"${words[@]}\"\n#compdef openshell\n".to_vec(), - std::path::Path::new("/tmp/custom/openshell"), + b"/tmp/custom/os -- \"${words[@]}\"\n#compdef os\n".to_vec(), + std::path::Path::new("/tmp/custom/os"), ) .expect("normalize completion script"); - assert!(script.contains("openshell -- \"${words[@]}\"")); - assert!(!script.contains("/tmp/custom/openshell")); + assert!(script.contains("os -- \"${words[@]}\"")); + assert!(!script.contains("/tmp/custom/os")); + } + + #[test] + fn deprecated_name_detection_matches_only_openshell() { + use std::ffi::OsStr; + + for argv0 in [ + "openshell", + "/usr/bin/openshell", + "/snap/bin/openshell", + "openshell.exe", + "OPENSHELL.EXE", + ] { + assert!( + invoked_as_deprecated_name(Some(OsStr::new(argv0))), + "{argv0} should be treated as the deprecated name" + ); + } + for argv0 in [ + "os", + "/usr/bin/os", + "os.exe", + "openshell-gateway", + "openshell.term", + ] { + assert!( + !invoked_as_deprecated_name(Some(OsStr::new(argv0))), + "{argv0} should not be treated as the deprecated name" + ); + } + assert!(!invoked_as_deprecated_name(None)); + } + + #[test] + fn rename_warning_suppression_requires_non_empty_value() { + assert!(!rename_warning_suppressed(None)); + assert!(!rename_warning_suppressed(Some("".into()))); + assert!(rename_warning_suppressed(Some("1".into()))); } #[test] @@ -5238,7 +5303,7 @@ mod tests { #[test] fn sandbox_create_upload_flag_accepts_multiple_values() { let result = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--upload", @@ -5265,16 +5330,8 @@ mod tests { #[test] fn sandbox_create_upload_conflicts_with_command_and_help_says_so() { - let err = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--upload", - ".", - "--", - "true", - ]) - .expect_err("--upload with a trailing command should be rejected"); + let err = Cli::try_parse_from(["os", "sandbox", "create", "--upload", ".", "--", "true"]) + .expect_err("--upload with a trailing command should be rejected"); assert_eq!(err.kind(), clap::error::ErrorKind::ArgumentConflict); let cmd = Cli::command(); @@ -5326,7 +5383,7 @@ mod tests { let err = resolve_sandbox_name(None, "unknown-gateway", "default").unwrap_err(); let msg = err.to_string(); assert!( - msg.contains("openshell sandbox connect"), + msg.contains("os sandbox connect"), "expected helpful hint in error, got: {msg}" ); }); @@ -5457,7 +5514,7 @@ mod tests { fn ssh_proxy_rejects_tokens_in_arguments() { assert!( Cli::try_parse_from([ - "openshell", + "os", "ssh-proxy", "--gateway", "gw", @@ -5474,7 +5531,7 @@ mod tests { fn ssh_proxy_accepts_generated_and_saved_commands() { for name_flag in ["--sandbox", "--name"] { let cli = Cli::try_parse_from([ - "openshell", + "os", "ssh-proxy", "--gateway-name", "my-gateway", @@ -5517,14 +5574,7 @@ mod tests { )); for (format, expected) in [("json", OutputFormat::Json), ("yaml", OutputFormat::Yaml)] { let cli = Cli::try_parse_from([ - "openshell", - "profile", - "list", - "--type", - "provider", - "-o", - format, - "--global", + "os", "profile", "list", "--type", "provider", "-o", format, "--global", ]) .expect("profile list with type, output, and scope"); assert!(matches!(cli.command, Some(Commands::Profile { @@ -5546,7 +5596,7 @@ mod tests { ("yaml", OutputFormat::Yaml), ] { let cli = Cli::try_parse_from([ - "openshell", + "os", "--workspace", "team", "profile", @@ -5585,7 +5635,7 @@ mod tests { command: Some(ProfileCommands::Export {id, output: OutputFormat::Yaml, global: false}) }) if id == "custom-api")); let update = Cli::try_parse_from([ - "openshell", + "os", "profile", "update", "custom-api", @@ -5598,7 +5648,7 @@ mod tests { command: Some(ProfileCommands::Update {id, file, global: true}) }) if id == "custom-api" && file == std::path::Path::new("custom-api.yaml"))); let delete = Cli::try_parse_from([ - "openshell", + "os", "profile", "delete", "custom-api", @@ -5615,15 +5665,9 @@ mod tests { fn profile_import_and_lint_require_exactly_one_source() { for verb in ["import", "lint"] { for source in ["-f", "--from", "--url"] { - let cli = Cli::try_parse_from([ - "openshell", - "profile", - verb, - source, - "./profiles", - "--global", - ]) - .expect("profile source should parse"); + let cli = + Cli::try_parse_from(["os", "profile", verb, source, "./profiles", "--global"]) + .expect("profile source should parse"); let (file, from, url, global) = match cli.command { Some(Commands::Profile { command: @@ -5652,7 +5696,7 @@ mod tests { assert!(Cli::try_parse_from(["openshell", "profile", verb]).is_err()); assert!( Cli::try_parse_from([ - "openshell", + "os", "profile", verb, "-f", @@ -5700,7 +5744,7 @@ mod tests { )); for (format, expected) in [("json", OutputFormat::Json), ("yaml", OutputFormat::Yaml)] { let cli = Cli::try_parse_from([ - "openshell", + "os", "provider", "list-profiles", "--workspace", @@ -5756,7 +5800,7 @@ mod tests { assert!(Cli::try_parse_from(["openshell", "provider", "profile", verb]).is_err()); assert!( Cli::try_parse_from([ - "openshell", + "os", "provider", "profile", verb, @@ -5840,7 +5884,7 @@ mod tests { )); let workspace_member = Cli::try_parse_from([ - "openshell", + "os", "workspace", "member", "list", @@ -5895,7 +5939,7 @@ mod tests { assert_eq!(output, expected); let workspace_member = Cli::try_parse_from([ - "openshell", + "os", "workspace", "member", "list", @@ -6123,7 +6167,7 @@ mod tests { #[test] fn provider_create_accepts_custom_profile_type_ids() { let cli = Cli::try_parse_from([ - "openshell", + "os", "provider", "create", "--name", @@ -6164,17 +6208,8 @@ mod tests { vec!["--runtime-credentials"], ] { let mut args = vec![ - "openshell", - "provider", - "create", - "--name", - "labeled", - "--type", - "github", - "--label", - "env=dev", - "--label", - "team=ml", + "os", "provider", "create", "--name", "labeled", "--type", "github", "--label", + "env=dev", "--label", "team=ml", ]; args.extend(source); let cli = Cli::try_parse_from(args).unwrap(); @@ -6196,7 +6231,7 @@ mod tests { vec!["-o", "yaml"], ] { let mut args = vec![ - "openshell", + "os", "provider", "list", "--all-workspaces", @@ -6225,7 +6260,7 @@ mod tests { #[test] fn provider_create_accepts_no_credential_source() { let cli = Cli::try_parse_from([ - "openshell", + "os", "provider", "create", "--name", @@ -6253,7 +6288,7 @@ mod tests { #[test] fn provider_create_accepts_runtime_credentials() { let cli = Cli::try_parse_from([ - "openshell", + "os", "provider", "create", "--name", @@ -6291,7 +6326,7 @@ mod tests { #[test] fn provider_create_rejects_from_gcloud_adc_with_from_existing() { let err = Cli::try_parse_from([ - "openshell", + "os", "provider", "create", "--name", @@ -6311,7 +6346,7 @@ mod tests { #[test] fn provider_create_rejects_from_gcloud_adc_with_credential() { let err = Cli::try_parse_from([ - "openshell", + "os", "provider", "create", "--name", @@ -6332,7 +6367,7 @@ mod tests { #[test] fn github_app_refresh_command_parses() { let config = Cli::try_parse_from([ - "openshell", + "os", "provider", "refresh", "configure", @@ -6365,7 +6400,7 @@ mod tests { #[test] fn provider_refresh_commands_parse() { let status = Cli::try_parse_from([ - "openshell", + "os", "provider", "refresh", "status", @@ -6385,7 +6420,7 @@ mod tests { )); let config = Cli::try_parse_from([ - "openshell", + "os", "provider", "refresh", "configure", @@ -6419,7 +6454,7 @@ mod tests { )); let rotate = Cli::try_parse_from([ - "openshell", + "os", "provider", "refresh", "rotate", @@ -6439,7 +6474,7 @@ mod tests { )); let delete = Cli::try_parse_from([ - "openshell", + "os", "provider", "refresh", "delete", @@ -6462,7 +6497,7 @@ mod tests { #[test] fn provider_update_accepts_credential_expiry() { let cli = Cli::try_parse_from([ - "openshell", + "os", "provider", "update", "my-graph", @@ -6487,7 +6522,7 @@ mod tests { #[test] fn provider_refresh_config_accepts_rfc3339_credential_expiry() { let cli = Cli::try_parse_from([ - "openshell", + "os", "provider", "refresh", "configure", @@ -6517,7 +6552,7 @@ mod tests { #[test] fn settings_set_global_parses_yes_flag() { let cli = Cli::try_parse_from([ - "openshell", + "os", "settings", "set", "--global", @@ -6567,16 +6602,9 @@ mod tests { #[test] fn policy_get_json_output_parses() { - let cli = Cli::try_parse_from([ - "openshell", - "policy", - "get", - "my-sandbox", - "--full", - "-o", - "json", - ]) - .expect("policy get -o json should parse"); + let cli = + Cli::try_parse_from(["os", "policy", "get", "my-sandbox", "--full", "-o", "json"]) + .expect("policy get -o json should parse"); match cli.command { Some(Commands::Policy { @@ -6637,7 +6665,7 @@ mod tests { #[test] fn settings_delete_global_parses_yes_flag() { let cli = Cli::try_parse_from([ - "openshell", + "os", "settings", "delete", "--global", @@ -6717,7 +6745,7 @@ mod tests { #[test] fn sandbox_create_annotation_is_repeatable() { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--annotation", @@ -6755,14 +6783,9 @@ mod tests { #[test] fn sandbox_create_restart_policy_accepts_on_failure() { - let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--restart-policy", - "on-failure", - ]) - .unwrap(); + let cli = + Cli::try_parse_from(["os", "sandbox", "create", "--restart-policy", "on-failure"]) + .unwrap(); match cli.command { Some(Commands::Sandbox { command: Some(SandboxCommands::Create { restart_policy, .. }), @@ -6815,14 +6838,8 @@ mod tests { ); assert_eq!(create_retry_flags(&["--no-create-retry"]), (None, true)); assert!( - Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--create-retry-timeout", - "0" - ]) - .is_err(), + Cli::try_parse_from(["os", "sandbox", "create", "--create-retry-timeout", "0"]) + .is_err(), "a zero retry budget must be rejected; --no-create-retry disables retries" ); } @@ -6843,7 +6860,7 @@ mod tests { fn sandbox_create_restart_policy_rejects_unknown_value() { assert!( Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--restart-policy", @@ -6856,13 +6873,7 @@ mod tests { #[test] fn sandbox_create_detach_parses_with_main_command() { let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--detach", - "--", - "worker", - "--serve", + "os", "sandbox", "create", "--detach", "--", "worker", "--serve", ]) .expect("sandbox create --detach should parse"); @@ -6884,7 +6895,7 @@ mod tests { #[test] fn sandbox_create_detach_accepts_ephemeral_sandbox() { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--detach", @@ -6916,7 +6927,7 @@ mod tests { #[test] fn sandbox_create_rejects_upload_with_main_command() { let result = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--upload", @@ -6969,7 +6980,7 @@ mod tests { #[test] fn sandbox_create_approval_mode_rejects_unknown_value() { let result = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--approval-mode", @@ -7002,7 +7013,7 @@ mod tests { #[test] fn sandbox_create_detached_command_accepts_structured_output() { Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--detach", @@ -7018,15 +7029,7 @@ mod tests { #[test] fn sandbox_create_resource_flags_parse() { let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--cpu", - "500m", - "--memory", - "2Gi", - "--", - "claude", + "os", "sandbox", "create", "--cpu", "500m", "--memory", "2Gi", "--", "claude", ]) .expect("sandbox create resource flags should parse"); @@ -7052,14 +7055,8 @@ mod tests { #[test] fn sandbox_create_driver_config_json_flag_parses() { let json = r#"{"kubernetes":{"pod":{"node_selector":{"pool":"gpu"}}}}"#; - let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--driver-config-json", - json, - ]) - .expect("sandbox create driver config JSON flag should parse"); + let cli = Cli::try_parse_from(["os", "sandbox", "create", "--driver-config-json", json]) + .expect("sandbox create driver config JSON flag should parse"); match cli.command { Some(Commands::Sandbox { @@ -7078,7 +7075,7 @@ mod tests { #[test] fn sandbox_create_template_flag_parses() { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--template", @@ -7130,7 +7127,7 @@ mod tests { fn sandbox_template_create_parses_workload_flags() { let json = r#"{"kubernetes":{"pod":{"node_selector":{"pool":"gpu"}}}}"#; let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "template", "create", @@ -7202,7 +7199,7 @@ mod tests { #[test] fn sandbox_template_list_parses_names_and_all_workspaces() { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "template", "list", @@ -7243,7 +7240,7 @@ mod tests { #[test] fn workspace_create_and_get_accept_output_format() { let cli = Cli::try_parse_from([ - "openshell", + "os", "workspace", "create", "--name", @@ -7272,13 +7269,7 @@ mod tests { #[test] fn sandbox_template_list_names_conflicts_with_output() { let result = Cli::try_parse_from([ - "openshell", - "sandbox", - "template", - "list", - "--names", - "--output", - "json", + "os", "sandbox", "template", "list", "--names", "--output", "json", ]); assert!(result.is_err()); } @@ -7302,15 +7293,8 @@ mod tests { #[test] fn sandbox_template_create_gpu_parses_driver_default() { - let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "template", - "create", - "gpu-kata", - "--gpu", - ]) - .expect("sandbox template create --gpu should parse"); + let cli = Cli::try_parse_from(["os", "sandbox", "template", "create", "gpu-kata", "--gpu"]) + .expect("sandbox template create --gpu should parse"); match cli.command { Some(Commands::Sandbox { @@ -7375,16 +7359,8 @@ mod tests { #[test] fn sandbox_create_gpu_count_allows_trailing_command() { - let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--gpu", - "2", - "--", - "claude", - ]) - .expect("sandbox create --gpu 2 -- claude should parse"); + let cli = Cli::try_parse_from(["os", "sandbox", "create", "--gpu", "2", "--", "claude"]) + .expect("sandbox create --gpu 2 -- claude should parse"); match cli.command { Some(Commands::Sandbox { @@ -7433,15 +7409,8 @@ mod tests { #[test] fn sandbox_create_accepts_service_exposure() { - let cli = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--expose", - "4500", - "--detach", - ]) - .expect("sandbox create --expose should parse"); + let cli = Cli::try_parse_from(["os", "sandbox", "create", "--expose", "4500", "--detach"]) + .expect("sandbox create --expose should parse"); match cli.command { Some(Commands::Sandbox { @@ -7466,14 +7435,8 @@ mod tests { #[test] fn sandbox_create_rejects_service_exposure_with_no_keep() { - let result = Cli::try_parse_from([ - "openshell", - "sandbox", - "create", - "--expose", - "4500", - "--no-keep", - ]); + let result = + Cli::try_parse_from(["os", "sandbox", "create", "--expose", "4500", "--no-keep"]); assert!(result.is_err()); } @@ -7488,7 +7451,7 @@ mod tests { #[test] fn sandbox_create_parses_bearer_passthrough_and_requires_expose() { let cli = Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--expose", @@ -7513,7 +7476,7 @@ mod tests { assert!( Cli::try_parse_from([ - "openshell", + "os", "sandbox", "create", "--expose-authorization-mode", @@ -7525,15 +7488,8 @@ mod tests { #[test] fn service_expose_accepts_positional_target_port_and_service() { - let cli = Cli::try_parse_from([ - "openshell", - "service", - "expose", - "my-sandbox", - "8080", - "api", - ]) - .expect("service expose positional target port should parse"); + let cli = Cli::try_parse_from(["os", "service", "expose", "my-sandbox", "8080", "api"]) + .expect("service expose positional target port should parse"); match cli.command { Some(Commands::Service { @@ -7584,7 +7540,7 @@ mod tests { #[test] fn service_expose_parses_bearer_passthrough_and_http2_backend() { let cli = Cli::try_parse_from([ - "openshell", + "os", "service", "expose", "my-sandbox", @@ -7641,7 +7597,7 @@ mod tests { #[test] fn service_list_accepts_optional_sandbox_and_paging() { let cli = Cli::try_parse_from([ - "openshell", + "os", "service", "list", "my-sandbox", @@ -7692,13 +7648,8 @@ mod tests { #[test] fn service_list_rejects_sandbox_with_all_workspaces() { - let result = Cli::try_parse_from([ - "openshell", - "service", - "list", - "my-sandbox", - "--all-workspaces", - ]); + let result = + Cli::try_parse_from(["os", "service", "list", "my-sandbox", "--all-workspaces"]); assert!(result.is_err()); } diff --git a/crates/openshell-cli/src/oidc_auth.rs b/crates/openshell-cli/src/oidc_auth.rs index f05c03d42f..1623fe4834 100644 --- a/crates/openshell-cli/src/oidc_auth.rs +++ b/crates/openshell-cli/src/oidc_auth.rs @@ -262,7 +262,7 @@ pub async fn oidc_browser_auth_flow( () = tokio::time::sleep(AUTH_TIMEOUT) => { return Err(miette::miette!( "OIDC authentication timed out after {} seconds.\n\ - Try again with: openshell gateway login", + Try again with: os gateway login", AUTH_TIMEOUT.as_secs() )); } @@ -501,9 +501,7 @@ async fn oidc_refresh_token( insecure: bool, ) -> Result { let refresh_token = bundle.refresh_token.as_deref().ok_or_else(|| { - miette::miette!( - "no refresh token available — re-authenticate with: openshell gateway login" - ) + miette::miette!("no refresh token available — re-authenticate with: os gateway login") })?; let scopes = scopes.map_or_else(Vec::new, |scopes| { @@ -556,7 +554,7 @@ pub async fn oidc_renew_token( } if std::env::var_os(CLIENT_SECRET_ENV).is_none() { return Err(miette::miette!( - "token was issued via client credentials; set {CLIENT_SECRET_ENV} to renew it, or run: openshell gateway login" + "token was issued via client credentials; set {CLIENT_SECRET_ENV} to renew it, or run: os gateway login" )); } oidc_client_credentials_flow( @@ -578,7 +576,7 @@ pub async fn ensure_valid_oidc_token_bundle( openshell_bootstrap::oidc_token::load_oidc_token(gateway_name).ok_or_else(|| { miette::miette!( "No OIDC token stored for gateway '{gateway_name}'.\n\ - Authenticate with: openshell gateway login" + Authenticate with: os gateway login" ) })?; diff --git a/crates/openshell-cli/src/run.rs b/crates/openshell-cli/src/run.rs index feb05f2f45..decd9d8e51 100644 --- a/crates/openshell-cli/src/run.rs +++ b/crates/openshell-cli/src/run.rs @@ -646,7 +646,8 @@ impl CreateRetry { } /// Hint shown when a live sandbox keeps the requested name. -const SANDBOX_NAME_TAKEN_HINT: &str = "\n\nhint: delete it first with: openshell sandbox delete \n or use a different name"; +const SANDBOX_NAME_TAKEN_HINT: &str = + "\n\nhint: delete it first with: os sandbox delete \n or use a different name"; /// Report for a create that failed with `AlreadyExists` without retrying. fn already_exists_report(status: &Status) -> miette::Report { @@ -1059,7 +1060,7 @@ pub async fn sandbox_create( if editor.is_some() && !command.is_empty() { return Err(miette::miette!( - "--editor cannot be used with a trailing command; use `openshell sandbox connect --editor ...` after the sandbox is ready" + "--editor cannot be used with a trailing command; use `os sandbox connect --editor ...` after the sandbox is ready" )); } if !uploads.is_empty() && !command.is_empty() { @@ -1092,7 +1093,7 @@ pub async fn sandbox_create( format!( "failed to connect to gateway '{gateway_name}' at {server}. \ Start the gateway service with the installed package manager, \ - or register a different endpoint with `openshell gateway add `." + or register a different endpoint with `os gateway add `." ) })?; let effective_server = server.to_string(); @@ -1285,7 +1286,7 @@ pub async fn sandbox_create( // Persist `--approval-mode` as a sandbox-scoped setting now that the // sandbox exists. `manual` is the implicit default (no setting needed); // any other value is written so it survives sandbox restarts and can be - // flipped later via `openshell settings set proposal_approval_mode`. + // flipped later via `os settings set proposal_approval_mode`. // If the write fails the sandbox still runs in default `manual` — surface // the recovery command so the user can retry. if approval_mode != "manual" { @@ -1305,7 +1306,7 @@ pub async fn sandbox_create( Ok(_) => {} Err(status) => { eprintln!( - "{} failed to set approval mode '{approval_mode}' on sandbox '{sandbox_name}': {}\n retry with: openshell settings set {sandbox_name} proposal_approval_mode {approval_mode}", + "{} failed to set approval mode '{approval_mode}' on sandbox '{sandbox_name}': {}\n retry with: os settings set {sandbox_name} proposal_approval_mode {approval_mode}", "warning:".yellow().bold(), status.message(), ); @@ -1618,7 +1619,7 @@ pub async fn sandbox_create( .await .wrap_err_with(|| { format!( - "Sandbox '{sandbox_name}' was created and still exists.\nRetry the upload with 'openshell sandbox upload', or remove the sandbox with 'openshell sandbox delete'", + "Sandbox '{sandbox_name}' was created and still exists.\nRetry the upload with 'os sandbox upload', or remove the sandbox with 'os sandbox delete'", ) })?; eprintln!(" {} Files uploaded", "\u{2713}".green().bold()); @@ -1643,10 +1644,7 @@ pub async fn sandbox_create( spec.port, ); eprintln!(" Access at: {}", spec.access_url()); - eprintln!( - " Stop with: openshell forward stop {} {sandbox_name}", - spec.port, - ); + eprintln!(" Stop with: os forward stop {} {sandbox_name}", spec.port); } if let Some(target_port) = expose @@ -1810,7 +1808,7 @@ fn retained_sandbox_timeout_message( "repair its configuration" }; format!( - "{error_reason}\nSandbox '{sandbox_name}' was retained. Inspect it with `openshell sandbox get {sandbox_name}`; {recovery}, then run `openshell sandbox start {sandbox_name}` after cleanup completes." + "{error_reason}\nSandbox '{sandbox_name}' was retained. Inspect it with `os sandbox get {sandbox_name}`; {recovery}, then run `os sandbox start {sandbox_name}` after cleanup completes." ) } @@ -1864,7 +1862,7 @@ fn resolve_from(value: &str) -> Result { Build and tag the image with the container engine used by the gateway, then pass the resulting image reference:\n \ docker build -t {} # Docker gateway\n \ podman build -t {} # Podman gateway\n \ - openshell sandbox create --from \n\ + os sandbox create --from \n\ If the gateway cannot access the selected engine's local image store (for example, a remote or Kubernetes gateway), push the image to a registry that the gateway can pull from.", path.display(), build_context, @@ -2411,7 +2409,7 @@ const MAX_EXEC_STDIN_BYTES: usize = 4 * 1024 * 1024; /// How long `sandbox exec` waits for piped stdin to reach EOF before it starts /// the command and streams the rest of the input as it arrives. /// -/// Small pipes such as `echo x | openshell sandbox exec ...` close well within +/// Small pipes such as `echo x | os sandbox exec ...` close well within /// this window and keep using the single-request path that older gateways /// need. A pipe that stays open (a CI runner, a supervisor, a harness that /// never closes stdin) must not block the command: after the grace period the @@ -6606,13 +6604,13 @@ pub async fn sandbox_policy_update( if current.policy_source == PolicySource::Global as i32 { return Err(miette!( - "policy is managed globally; delete the global policy before using `openshell policy update`" + "policy is managed globally; delete the global policy before using `os policy update`" )); } if current.policy.as_ref().is_some_and(SandboxPolicy::is_cedar) { return Err(miette!( "incremental policy updates are not available for Cedar policies; edit the Cedar \ - policy and replace it with `openshell policy set`" + policy and replace it with `os policy set`" )); } @@ -7578,9 +7576,8 @@ fn draft_approval_error(status: Status, name: &str) -> miette::Report { && status.message().contains("refetch and review again") { return miette::miette!( - help = format!( - "review it with `openshell rule get {name} --status pending`, then approve again" - ), + help = + format!("review it with `os rule get {name} --status pending`, then approve again"), "the sandbox policy or its inputs changed after this rule was fetched, so the gateway re-evaluated it" ); } @@ -7761,7 +7758,7 @@ fn format_endpoints(rule: &openshell_core::proto::NetworkPolicyRule) -> String { /// can tell L4-only access apart from a method/path-scoped L7 grant. The L7 /// fields (`protocol: rest`, `rules`, `access`) materially change what gets /// allowed; surfacing them in the default text output is what makes -/// `openshell rule get` useful for approval review. +/// `os rule get` useful for approval review. fn format_endpoint(endpoint: &openshell_core::proto::NetworkEndpoint) -> String { let host_port = if endpoint.port > 0 { format!("{}:{}", endpoint.host, endpoint.port) @@ -7973,7 +7970,7 @@ mod tests { ); assert!(refreshed.to_string().contains("re-evaluated")); let help = refreshed.help().expect("help text").to_string(); - assert!(help.contains("openshell rule get my-agent --status pending")); + assert!(help.contains("os rule get my-agent --status pending")); let other = draft_approval_error(Status::not_found("chunk not found"), "my-agent"); assert!(other.to_string().contains("chunk not found")); @@ -9979,8 +9976,8 @@ mod tests { assert!(message.contains("image preparation and supervisor startup diagnostics")); assert!(message.contains("image_preparation_timeout_seconds")); assert!(!message.contains("repair its configuration")); - assert!(message.contains("openshell sandbox get cold-image")); - assert!(message.contains("openshell sandbox start cold-image` after cleanup completes")); + assert!(message.contains("os sandbox get cold-image")); + assert!(message.contains("os sandbox start cold-image` after cleanup completes")); // An admission timeout retains preparation timestamps. Its completed // transition must select configuration repair rather than a larger budget. @@ -9997,9 +9994,7 @@ mod tests { ); assert!(message.contains("repair its configuration")); assert!(!message.contains("image_preparation_timeout_seconds")); - assert!( - message.contains("openshell sandbox start invalid-policy` after cleanup completes") - ); + assert!(message.contains("os sandbox start invalid-policy` after cleanup completes")); } } diff --git a/crates/openshell-cli/src/ssh.rs b/crates/openshell-cli/src/ssh.rs index 0417316414..42f5369a3f 100644 --- a/crates/openshell-cli/src/ssh.rs +++ b/crates/openshell-cli/src/ssh.rs @@ -2175,8 +2175,8 @@ pub async fn relay_prepared_ssh( } else { // The `ssh` of such a client accepts any host key. eprintln!( - "openshell: warning: the OpenShell client that started this SSH connection predates host-key verification, so the SSH host key is NOT verified.\n\ - Restart that client (the openshell command or openshell term)." + "os: warning: the OpenShell client that started this SSH connection predates host-key verification, so the SSH host key is NOT verified.\n\ + Restart that client (the os command or os term)." ); permit_unverified().into_diagnostic()?; None @@ -2463,20 +2463,20 @@ fn stale_ssh_config_warning(gateway: &str, workspace: &str, sandbox: &str) -> St "-g" }; let openshell = format!( - "openshell {selector} {} --workspace {}", + "os {selector} {} --workspace {}", shell_escape(gateway), shell_escape(workspace) ); let name = shell_escape(sandbox); format!( - "openshell: warning: this SSH config entry for sandbox '{sandbox}' (workspace '{workspace}') predates host-key verification, so the SSH host key is NOT verified.\n\ + "os: warning: this SSH config entry for sandbox '{sandbox}' (workspace '{workspace}') predates host-key verification, so the SSH host key is NOT verified.\n\ Regenerate it: {openshell} sandbox connect {name} --editor vscode\n\ Or replace the entry with the output of: {openshell} sandbox ssh-config {name}" ) } fn render_ssh_config(gateway: &str, name: &str, workspace: &str) -> Result { - let exe = std::env::current_exe().into_diagnostic()?; + let exe = openshell_core::forward::cli_executable()?; let (selector, target) = match gateway.split_once("://") { Some((scheme, rest)) if (scheme.eq_ignore_ascii_case("http") || scheme.eq_ignore_ascii_case("https")) @@ -2495,7 +2495,7 @@ fn render_ssh_config(gateway: &str, name: &str, workspace: &str) -> Result ("--gateway-name", gateway.to_owned()), _ => { return Err(miette::miette!( - "A saved SSH configuration needs a named gateway profile for this private endpoint. Register the endpoint with `openshell gateway add --name `." + "A saved SSH configuration needs a named gateway profile for this private endpoint. Register the endpoint with `os gateway add --name `." )); } }; @@ -2889,7 +2889,7 @@ mod tests { let pin = KnownHostsPin::at(known_hosts.clone(), "demo", "default").unwrap(); let host_key = HostKeyCheck::for_relay(PUBLISHED_FINGERPRINT.parse().unwrap(), pin).unwrap(); - let proxy = SandboxProxyCommand::new("openshell ssh-proxy".to_string(), host_key); + let proxy = SandboxProxyCommand::new("os ssh-proxy".to_string(), host_key); (proxy, known_hosts) } @@ -3319,13 +3319,13 @@ mod tests { fn stale_ssh_config_warning_names_the_gateway_and_workspace_of_the_entry() { assert_eq!( stale_ssh_config_warning("my gw", "beta", "demo"), - "openshell: warning: this SSH config entry for sandbox 'demo' (workspace 'beta') predates host-key verification, so the SSH host key is NOT verified.\n\ - Regenerate it: openshell -g 'my gw' --workspace beta sandbox connect demo --editor vscode\n\ - Or replace the entry with the output of: openshell -g 'my gw' --workspace beta sandbox ssh-config demo" + "os: warning: this SSH config entry for sandbox 'demo' (workspace 'beta') predates host-key verification, so the SSH host key is NOT verified.\n\ + Regenerate it: os -g 'my gw' --workspace beta sandbox connect demo --editor vscode\n\ + Or replace the entry with the output of: os -g 'my gw' --workspace beta sandbox ssh-config demo" ); assert!( stale_ssh_config_warning("https://gw.example.com", "beta", "demo").contains( - "Regenerate it: openshell --gateway-endpoint 'https://gw.example.com' --workspace beta sandbox connect demo" + "Regenerate it: os --gateway-endpoint 'https://gw.example.com' --workspace beta sandbox connect demo" ) ); } diff --git a/crates/openshell-cli/tests/cli_color_integration.rs b/crates/openshell-cli/tests/cli_color_integration.rs index 02d9a7793a..7135c7477a 100644 --- a/crates/openshell-cli/tests/cli_color_integration.rs +++ b/crates/openshell-cli/tests/cli_color_integration.rs @@ -35,7 +35,7 @@ fn config_dir_with_forward(root: &Path) { } fn forward_list(config_dir: &Path, args: &[&str], no_color: Option<&str>) -> String { - let mut command = Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = Command::new(env!("CARGO_BIN_EXE_os")); command .args(["forward", "list"]) .args(args) @@ -47,7 +47,7 @@ fn forward_list(config_dir: &Path, args: &[&str], no_color: Option<&str>) -> Str command.env("NO_COLOR", value); } - let output = command.output().expect("run openshell forward list"); + let output = command.output().expect("run os forward list"); let stdout = String::from_utf8(output.stdout).expect("stdout is utf-8"); assert!( stdout.contains(SANDBOX), @@ -129,7 +129,7 @@ fn explicit_color_flag_overrides_no_color() { /// escapes to reach a pipe. fn failing_connect(args: &[&str]) -> (String, String) { let tmpdir = tempfile::tempdir().expect("create tmpdir"); - let output = Command::new(env!("CARGO_BIN_EXE_openshell")) + let output = Command::new(env!("CARGO_BIN_EXE_os")) .args([ "sandbox", "list", @@ -146,7 +146,7 @@ fn failing_connect(args: &[&str]) -> (String, String) { .env_remove("FORCE_COLOR") .env_remove("OPENSHELL_COLOR") .output() - .expect("run openshell sandbox list"); + .expect("run os sandbox list"); ( String::from_utf8_lossy(&output.stdout).into_owned(), @@ -235,7 +235,7 @@ fn run_with_stdout_tty(mut command: Command) -> (String, String) { #[cfg(target_os = "linux")] fn split_streams_stdout_tty(args: &[&str]) -> (String, String) { let tmpdir = tempfile::tempdir().expect("create tmpdir"); - let mut command = Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = Command::new(env!("CARGO_BIN_EXE_os")); command .args([ "sandbox", @@ -276,7 +276,7 @@ fn forward_list_on_pty(term: &str, args: &[&str], stderr_on_tty: bool) -> String let tmpdir = tempfile::tempdir().expect("create tmpdir"); config_dir_with_forward(tmpdir.path()); - let mut command = Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = Command::new(env!("CARGO_BIN_EXE_os")); command .args(["forward", "list"]) .args(args) diff --git a/crates/openshell-cli/tests/cli_help_integration.rs b/crates/openshell-cli/tests/cli_help_integration.rs index fccb7fd4ae..e62c403afb 100644 --- a/crates/openshell-cli/tests/cli_help_integration.rs +++ b/crates/openshell-cli/tests/cli_help_integration.rs @@ -10,12 +10,12 @@ use common::run_isolated; #[test] fn root_help_shows_top_level_commands() { let output = run_isolated(&["--help"]); - assert_eq!(output.code, 0, "openshell --help:\n{}", output.combined); + assert_eq!(output.code, 0, "os --help:\n{}", output.combined); for command in ["gateway", "status", "sandbox", "forward", "logs", "policy"] { assert!( output.combined.contains(command), - "expected '{command}' in openshell --help:\n{}", + "expected '{command}' in os --help:\n{}", output.combined ); } diff --git a/crates/openshell-cli/tests/common/mod.rs b/crates/openshell-cli/tests/common/mod.rs index c7cab6a33d..43eeeff948 100644 --- a/crates/openshell-cli/tests/common/mod.rs +++ b/crates/openshell-cli/tests/common/mod.rs @@ -21,7 +21,7 @@ pub fn run_with_env( args: &[&str], env: &[(&str, &str)], ) -> CliOutput { - let output = Command::new(env!("CARGO_BIN_EXE_openshell")) + let output = Command::new(env!("CARGO_BIN_EXE_os")) .args(args) .env("XDG_CONFIG_HOME", config_dir) .env("HOME", config_dir) diff --git a/crates/openshell-cli/tests/doctor_integration.rs b/crates/openshell-cli/tests/doctor_integration.rs index 343dc7a9c2..ccc0945ab6 100644 --- a/crates/openshell-cli/tests/doctor_integration.rs +++ b/crates/openshell-cli/tests/doctor_integration.rs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -//! `openshell doctor check` against a fake `docker` on `PATH`, so the result +//! `os doctor check` against a fake `docker` on `PATH`, so the result //! doesn't depend on the host's Docker. #![cfg(unix)] @@ -18,11 +18,11 @@ struct Doctor { elapsed: Duration, } -/// Run `openshell doctor check` with only `bin` on `PATH`. +/// Run `os doctor check` with only `bin` on `PATH`. fn doctor_check(bin: &Path) -> Doctor { let home = tempfile::tempdir().expect("create isolated config dir"); let start = Instant::now(); - let output = Command::new(env!("CARGO_BIN_EXE_openshell")) + let output = Command::new(env!("CARGO_BIN_EXE_os")) .args(["doctor", "check"]) .env("XDG_CONFIG_HOME", home.path()) .env("HOME", home.path()) @@ -33,7 +33,7 @@ fn doctor_check(bin: &Path) -> Doctor { .env_remove("OPENSHELL_GATEWAY_ENDPOINT") .stdin(Stdio::null()) .output() - .expect("run openshell doctor check"); + .expect("run os doctor check"); Doctor { combined: format!( "{}{}", diff --git a/crates/openshell-cli/tests/forward_list_integration.rs b/crates/openshell-cli/tests/forward_list_integration.rs index 5d630d8df6..3754c8dffc 100644 --- a/crates/openshell-cli/tests/forward_list_integration.rs +++ b/crates/openshell-cli/tests/forward_list_integration.rs @@ -8,7 +8,7 @@ use std::process::{Command, Output}; const DEAD_PID: u32 = u32::MAX; fn run_forward_list(config_dir: &Path, args: &[&str]) -> Output { - let mut command = Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = Command::new(env!("CARGO_BIN_EXE_os")); for (key, _) in std::env::vars().filter(|(key, _)| key.starts_with("OPENSHELL_")) { command.env_remove(key); } @@ -18,7 +18,7 @@ fn run_forward_list(config_dir: &Path, args: &[&str]) -> Output { .env("XDG_CONFIG_HOME", config_dir) .env("HOME", config_dir) .output() - .expect("run openshell forward list") + .expect("run os forward list") } fn write_dead_forward(config_dir: &Path) { diff --git a/crates/openshell-cli/tests/gateway_registration_integration.rs b/crates/openshell-cli/tests/gateway_registration_integration.rs index 706ec1dee9..6e3f87cb4d 100644 --- a/crates/openshell-cli/tests/gateway_registration_integration.rs +++ b/crates/openshell-cli/tests/gateway_registration_integration.rs @@ -87,7 +87,7 @@ fn status_without_gateway_prints_registration_hint() { ); assert!(output.combined.contains("No gateway configured")); assert!( - output.combined.contains("openshell gateway add "), + output.combined.contains("os gateway add "), "{}", output.combined ); diff --git a/crates/openshell-cli/tests/provider_commands_integration.rs b/crates/openshell-cli/tests/provider_commands_integration.rs index f5563a7e77..4d625fbdd6 100644 --- a/crates/openshell-cli/tests/provider_commands_integration.rs +++ b/crates/openshell-cli/tests/provider_commands_integration.rs @@ -1504,7 +1504,7 @@ async fn run_readiness_cli(server: &TestServer, args: &[&str]) -> std::process:: ) .unwrap(); } - let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); for (key, _) in std::env::vars().filter(|(key, _)| key.starts_with("OPENSHELL_")) { command.env_remove(key); } @@ -3289,7 +3289,7 @@ async fn profile_commands_dispatch_scope_and_output_to_gateway() { ] { let mut outputs = Vec::new(); for legacy in [false, true] { - let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); command .env("XDG_CONFIG_HOME", config.path()) .env("OPENSHELL_TELEMETRY_ENABLED", "false") diff --git a/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs b/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs index 8d616c69ba..6fdee214bf 100644 --- a/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs +++ b/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs @@ -3197,7 +3197,7 @@ async fn ssh_profile_credentials_follow_the_selected_endpoint() { prepare_cli_xdg(&server, &xdg, "openshell"); write_oidc_test_credentials(&server, &xdg, "https://unused.invalid", 4_102_444_800); let cli = || { - let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); command .env_remove("OPENSHELL_GATEWAY") .env_remove("OPENSHELL_GATEWAY_ENDPOINT") @@ -3334,7 +3334,7 @@ async fn selected_ssh_profile_wins_over_an_active_profile_on_the_same_host() { .into_iter() .enumerate() { - let output = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")) + let output = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")) .args(args) .env("OPENSHELL_GATEWAY", "openshell") .env("OPENSHELL_GATEWAY_ENDPOINT", &endpoint) @@ -3637,7 +3637,7 @@ async fn run_cli_sandbox_create_with_xdg_and_env( extra_args: &[&str], environment: &[(&str, &str)], ) -> std::process::Output { - let mut cmd = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut cmd = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); for (key, _) in std::env::vars().filter(|(k, _)| k.starts_with("OPENSHELL_")) { cmd.env_remove(&key); } @@ -3780,8 +3780,14 @@ async fn sandbox_create_upload_warns_and_reaches_ssh_outside_git_repository() { stderr.contains("Sandbox 'upload-non-repository' was created and still exists"), "{stderr}" ); - assert!(stderr.contains("openshell sandbox upload"), "{stderr}"); - assert!(stderr.contains("openshell sandbox delete"), "{stderr}"); + // The diagnostic wraps at the terminal width, so compare unwrapped words. + let unwrapped = stderr + .split_whitespace() + .filter(|word| *word != "│") + .collect::>() + .join(" "); + assert!(unwrapped.contains("os sandbox upload"), "{stderr}"); + assert!(unwrapped.contains("os sandbox delete"), "{stderr}"); assert_eq!(create_requests(&server).await.len(), 1); assert!( fake_ssh_dir.path().join("ssh.called").is_file(), @@ -3844,7 +3850,7 @@ async fn run_cli_sandbox_template_create( fs::copy(server.dir.path().join(filename), tls_dir.join(filename)).unwrap(); } - let mut cmd = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut cmd = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); for (key, _) in std::env::vars().filter(|(k, _)| k.starts_with("OPENSHELL_")) { cmd.env_remove(&key); } @@ -3987,7 +3993,7 @@ async fn sandbox_create_fails_before_mutation_when_expired_oidc_refresh_is_rejec "unexpected error: {stderr}" ); assert!( - stderr.contains("openshell gateway login openshell"), + stderr.contains("os gateway login openshell"), "error should explain how to re-authenticate: {stderr}" ); assert!( @@ -4098,7 +4104,7 @@ async fn sandbox_template_create_warns_for_credential_env_vars() { ); assert!( stderr.contains( - "openshell provider create --name my-openai --type openai --credential OPENAI_API_KEY" + "os provider create --name my-openai --type openai --credential OPENAI_API_KEY" ), "warning should recommend existing-credential provider setup: {stderr}" ); @@ -4142,7 +4148,7 @@ async fn sandbox_template_create_suppresses_credential_env_warnings() { } // --------------------------------------------------------------------------- -// `openshell forward service` (`run::service_forward_tcp`) +// `os forward service` (`run::service_forward_tcp`) // --------------------------------------------------------------------------- /// Pick a free loopback port for the forward to bind. @@ -4504,7 +4510,7 @@ async fn policy_update_rejects_a_cedar_sandbox_before_merging() { .await .unwrap_err(); assert!( - error.to_string().contains("openshell policy set"), + error.to_string().contains("os policy set"), "dry_run={dry_run}: {error}" ); } @@ -5926,7 +5932,7 @@ async fn sandbox_create_no_create_retry_conflict_shows_the_delete_hint() { let stderr = String::from_utf8_lossy(&output.stderr); assert!(!output.status.success(), "{stderr}"); assert!( - stderr.contains("hint: delete it first with: openshell sandbox delete"), + stderr.contains("hint: delete it first with: os sandbox delete"), "a conflict that skips the retry loop must explain how to free the name: {stderr}" ); assert!(stderr.contains("or use a different name"), "{stderr}"); @@ -5975,7 +5981,7 @@ async fn sandbox_create_unnamed_conflict_shows_the_delete_hint_without_a_phase_p let msg = err.to_string(); assert!( - msg.contains("hint: delete it first with: openshell sandbox delete"), + msg.contains("hint: delete it first with: os sandbox delete"), "{msg}" ); assert!(msg.contains("or use a different name"), "{msg}"); diff --git a/crates/openshell-cli/tests/sandbox_exec_streaming_integration.rs b/crates/openshell-cli/tests/sandbox_exec_streaming_integration.rs index 657ee8e12c..37889d5f85 100644 --- a/crates/openshell-cli/tests/sandbox_exec_streaming_integration.rs +++ b/crates/openshell-cli/tests/sandbox_exec_streaming_integration.rs @@ -258,7 +258,7 @@ impl TestGateway { let baseline = std::env::var_os("OPENSHELL_STREAMING_TEST_BASELINE_CLI"); let executable = baseline .as_deref() - .map_or_else(|| Path::new(env!("CARGO_BIN_EXE_openshell")), Path::new); + .map_or_else(|| Path::new(env!("CARGO_BIN_EXE_os")), Path::new); let mut command = Command::new(executable); command.args([ "--gateway", diff --git a/crates/openshell-cli/tests/sandbox_upload_integration.rs b/crates/openshell-cli/tests/sandbox_upload_integration.rs index 15f87adff9..af0d7a6ce9 100644 --- a/crates/openshell-cli/tests/sandbox_upload_integration.rs +++ b/crates/openshell-cli/tests/sandbox_upload_integration.rs @@ -10,7 +10,7 @@ use std::path::Path; use std::process::{Command, Output}; fn upload_command(local_path: &Path, config_dir: &Path) -> Command { - let mut command = Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = Command::new(env!("CARGO_BIN_EXE_os")); command .args([ "--gateway", @@ -49,7 +49,7 @@ fn run_upload( command.env("OPENSHELL_TEST_GIT_MARKER", marker); } - command.output().expect("run openshell sandbox upload") + command.output().expect("run os sandbox upload") } #[test] diff --git a/crates/openshell-cli/tests/ssh_proxy_host_key_integration.rs b/crates/openshell-cli/tests/ssh_proxy_host_key_integration.rs index 66dd37ead1..8a25d74592 100644 --- a/crates/openshell-cli/tests/ssh_proxy_host_key_integration.rs +++ b/crates/openshell-cli/tests/ssh_proxy_host_key_integration.rs @@ -245,7 +245,7 @@ async fn finished( /// Runs `openshell` with `args`, which are separated by single spaces. async fn openshell(args: &str, config: &Path, require_host_key: bool) -> Output { - let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut command = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); command.args(args.split(' ')); finished(command, config, require_host_key).await } @@ -556,7 +556,7 @@ mod openssh { // The client is this test, so its proxy command names the test binary. let this_test = std::env::current_exe().unwrap(); let this_test = shell_escape(&this_test.to_string_lossy()).replace('%', "%%"); - let openshell = shell_escape(env!("CARGO_BIN_EXE_openshell")).replace('%', "%%"); + let openshell = shell_escape(env!("CARGO_BIN_EXE_os")).replace('%', "%%"); let arguments = sandbox_ssh_args(proxy.command(), "ERROR") .into_iter() .map(|argument| argument.replace(&this_test, &openshell)); diff --git a/crates/openshell-cli/tests/ssh_proxy_shutdown_integration.rs b/crates/openshell-cli/tests/ssh_proxy_shutdown_integration.rs index 0b53fe5630..b764d85514 100644 --- a/crates/openshell-cli/tests/ssh_proxy_shutdown_integration.rs +++ b/crates/openshell-cli/tests/ssh_proxy_shutdown_integration.rs @@ -193,7 +193,7 @@ async fn proxy_exits_with_stdin_open(relay_status: Status, admission: Admission) let expected_code = relay_status.code(); let (address, gateway, server) = Gateway::start(vec![admission], relay_status, None).await; let config = tempfile::tempdir().unwrap(); - let mut child = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")) + let mut child = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")) .args([ "ssh-proxy", "--server", @@ -347,7 +347,7 @@ exit 1 #[cfg(unix)] fn sandbox_cli(config: &tempfile::TempDir, address: SocketAddr) -> tokio::process::Command { - let mut cli = tokio::process::Command::new(env!("CARGO_BIN_EXE_openshell")); + let mut cli = tokio::process::Command::new(env!("CARGO_BIN_EXE_os")); cli.args([ "--gateway", "test", diff --git a/crates/openshell-core/src/config.rs b/crates/openshell-core/src/config.rs index 2d3f37c7eb..ed134557cf 100644 --- a/crates/openshell-core/src/config.rs +++ b/crates/openshell-core/src/config.rs @@ -868,7 +868,7 @@ pub enum GatewayProviderProfileSourceConfig { pub(crate) const BUILTIN_PROFILE_SOURCE_REMOVED: &str = "provider profile source type \"builtin\" was removed: provider profiles are import-only. \ Remove the entry and import the profiles this gateway needs with \ - 'openshell provider profile import --from providers --global'"; + 'os provider profile import --from providers --global'"; impl<'de> Deserialize<'de> for GatewayProviderProfileSourceConfig { fn deserialize(deserializer: D) -> Result @@ -1765,10 +1765,7 @@ mod tests { .expect_err("the builtin source was removed"); let message = error.to_string(); assert!(message.contains("import-only"), "{message}"); - assert!( - message.contains("openshell provider profile import"), - "{message}" - ); + assert!(message.contains("os provider profile import"), "{message}"); } #[test] diff --git a/crates/openshell-core/src/forward.rs b/crates/openshell-core/src/forward.rs index d65aa53321..2c24ebc1ad 100644 --- a/crates/openshell-core/src/forward.rs +++ b/crates/openshell-core/src/forward.rs @@ -745,7 +745,7 @@ impl std::fmt::Display for ForwardSpec { /// If the port is already in use the error message includes an actionable /// hint: /// -/// - If an existing openshell forward owns the port, suggest the stop command. +/// - If an existing os forward owns the port, suggest the stop command. /// - Otherwise, show the `lsof` output and suggest `kill` to terminate the /// owning process. pub fn check_port_available(spec: &ForwardSpec) -> Result<()> { @@ -765,7 +765,7 @@ pub fn check_port_available(spec: &ForwardSpec) -> Result<()> { return Ok(()); } - // Port is occupied. Check if it belongs to a tracked openshell forward. + // Port is occupied. Check if it belongs to a tracked os forward. if let Ok(forwards) = list_forwards() && let Some(fwd) = forwards .iter() @@ -773,7 +773,7 @@ pub fn check_port_available(spec: &ForwardSpec) -> Result<()> { { return Err(miette::miette!( "Port {port} is already forwarded to sandbox '{}'.\n\ - Stop it with: openshell forward stop {port} {}", + Stop it with: os forward stop {port} {}", fwd.sandbox_name, fwd.sandbox_name, )); @@ -951,6 +951,27 @@ pub fn build_proxy_command(exe: &str, handle: &str, sandbox: &str, workspace: &s .replace('%', "%%") } +/// Path of the running CLI, for commands that it records or runs again. +/// +/// A CLI started through the deprecated `openshell` link prefers the `os` +/// binary beside it, so recorded commands survive the link's removal and do +/// not repeat the rename notice. +pub fn cli_executable() -> Result { + std::env::current_exe() + .into_diagnostic() + .map(prefer_renamed_cli) +} + +fn prefer_renamed_cli(exe: PathBuf) -> PathBuf { + let renamed = match exe.file_name().and_then(std::ffi::OsStr::to_str) { + Some("openshell") => "os", + Some(name) if name.eq_ignore_ascii_case("openshell.exe") => "os.exe", + _ => return exe, + }; + let candidate = exe.with_file_name(renamed); + if candidate.is_file() { candidate } else { exe } +} + /// The `ProxyCommand` of a sandbox SSH connection, with the host-key decision /// it was built with. pub struct SandboxProxyCommand { @@ -1428,6 +1449,28 @@ mod tests { const HOST_KEY_FINGERPRINT: &str = "SHA256:ZkAslGjFiUHdGf/WUL8rQvkib4PTvQatUV0OUQSncCA"; + #[test] + fn renamed_cli_replaces_deprecated_link_when_os_is_beside_it() { + let dir = tempfile::tempdir().unwrap(); + let deprecated = dir.path().join("openshell"); + let renamed = dir.path().join("os"); + std::fs::write(&deprecated, b"").unwrap(); + assert_eq!(prefer_renamed_cli(deprecated.clone()), deprecated); + + std::fs::write(&renamed, b"").unwrap(); + assert_eq!(prefer_renamed_cli(deprecated), renamed); + } + + #[test] + fn renamed_cli_keeps_other_executables() { + let dir = tempfile::tempdir().unwrap(); + std::fs::write(dir.path().join("os"), b"").unwrap(); + for name in ["os", "openshell-gateway", "custom-cli"] { + let exe = dir.path().join(name); + assert_eq!(prefer_renamed_cli(exe.clone()), exe); + } + } + fn sandbox_proxy(exe: &str, known_hosts: &std::path::Path) -> SandboxProxyCommand { let pin = KnownHostsPin::at(known_hosts.to_path_buf(), "sbx-1", "team-a").unwrap(); let host_key = HostKeyCheck::for_relay(HOST_KEY_FINGERPRINT.parse().unwrap(), pin).unwrap(); @@ -1440,7 +1483,7 @@ mod tests { #[test] fn sandbox_ssh_args_disable_connection_sharing() { let dir = tempfile::tempdir().unwrap(); - let proxy = sandbox_proxy("openshell", &dir.path().join("pin")); + let proxy = sandbox_proxy("os", &dir.path().join("pin")); let args = sandbox_ssh_args(&proxy, "DEBUG"); let options: Vec<&str> = args .chunks(2) @@ -1449,7 +1492,7 @@ mod tests { pair[1].as_str() }) .collect(); - assert!(options[0].starts_with("ProxyCommand=openshell ssh-proxy ")); + assert!(options[0].starts_with("ProxyCommand=os ssh-proxy ")); assert!(options.contains(&"LogLevel=DEBUG")); for option in ["ControlMaster=no", "ControlPath=none", "ControlPersist=no"] { assert!(options.contains(&option), "missing {option}"); @@ -1682,9 +1725,9 @@ mod tests { #[test] fn ssh_forward_command_matches_exact_l_argument() { let command = - "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L 80:127.0.0.1:80 sandbox"; + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L 80:127.0.0.1:80 sandbox"; let compact = - "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L80:127.0.0.1:80 sandbox"; + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L80:127.0.0.1:80 sandbox"; assert!(command_matches_ssh_forward( command, @@ -1702,8 +1745,9 @@ mod tests { #[test] fn ssh_forward_command_matches_bind_prefixed_l_argument() { - let command = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L 127.0.0.1:80:127.0.0.1:80 sandbox"; - let compact = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L[::1]:80:127.0.0.1:80 sandbox"; + let command = "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L 127.0.0.1:80:127.0.0.1:80 sandbox"; + let compact = + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L[::1]:80:127.0.0.1:80 sandbox"; assert!(command_matches_ssh_forward( command, @@ -1721,7 +1765,7 @@ mod tests { #[test] fn ssh_forward_command_rejects_substring_port_collision() { - let command = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L 127.0.0.1:8080:127.0.0.1:8080 sandbox"; + let command = "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L 127.0.0.1:8080:127.0.0.1:8080 sandbox"; assert!(!command_matches_ssh_forward( command, @@ -1734,9 +1778,9 @@ mod tests { #[test] fn ssh_forward_command_requires_matching_sandbox_name() { let command = - "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-2 -N -L 80:127.0.0.1:80 sandbox"; + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-2 -N -L 80:127.0.0.1:80 sandbox"; let equals = - "ssh -o ProxyCommand=openshell ssh-proxy --sandbox=sbx-1 -N -L 80:127.0.0.1:80 sandbox"; + "ssh -o ProxyCommand=os ssh-proxy --sandbox=sbx-1 -N -L 80:127.0.0.1:80 sandbox"; assert!(!command_matches_ssh_forward( command, @@ -1750,8 +1794,10 @@ mod tests { #[test] fn ssh_forward_command_rejects_sandbox_name_prefix_collision() { - let split = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-10 -N -L 80:127.0.0.1:80 sandbox"; - let equals = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox=sbx-10 -N -L 80:127.0.0.1:80 sandbox"; + let split = + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-10 -N -L 80:127.0.0.1:80 sandbox"; + let equals = + "ssh -o ProxyCommand=os ssh-proxy --sandbox=sbx-10 -N -L 80:127.0.0.1:80 sandbox"; assert!(!command_matches_ssh_forward(split, 80, None, Some("sbx-1"))); assert!(!command_matches_ssh_forward( @@ -1764,10 +1810,11 @@ mod tests { #[test] fn ssh_forward_command_rejects_host_port_ambiguity() { - let wrong_remote_port = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L 80:127.0.0.1:8080 sandbox"; - let wrong_local_port = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L 127.0.0.1:8080:127.0.0.1:80 sandbox"; + let wrong_remote_port = + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L 80:127.0.0.1:8080 sandbox"; + let wrong_local_port = "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L 127.0.0.1:8080:127.0.0.1:80 sandbox"; let wrong_remote_host = - "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N -L 80:localhost:80 sandbox"; + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N -L 80:localhost:80 sandbox"; assert!(!command_matches_ssh_forward( wrong_remote_port, @@ -1990,10 +2037,10 @@ mod tests { #[test] fn ssh_forward_command_rejects_remote_command_l_argument() { let remote_arg = - "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 -N sandbox -L 80:127.0.0.1:80"; + "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 -N sandbox -L 80:127.0.0.1:80"; let missing_no_command = "ssh ssh-proxy --sandbox sbx-1 -L 80:127.0.0.1:80 sandbox"; - let remote_command_lookalike = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-1 real-host echo -N -L 80:127.0.0.1:80 sandbox"; - let sandbox_name_in_remote_command = "ssh -o ProxyCommand=openshell ssh-proxy --sandbox sbx-2 real-host --sandbox sbx-1 -N -L 80:127.0.0.1:80 sandbox"; + let remote_command_lookalike = "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-1 real-host echo -N -L 80:127.0.0.1:80 sandbox"; + let sandbox_name_in_remote_command = "ssh -o ProxyCommand=os ssh-proxy --sandbox sbx-2 real-host --sandbox sbx-1 -N -L 80:127.0.0.1:80 sandbox"; assert!(!command_matches_ssh_forward( remote_arg, diff --git a/crates/openshell-core/src/grpc_client.rs b/crates/openshell-core/src/grpc_client.rs index 2429f255cc..c8310745ed 100644 --- a/crates/openshell-core/src/grpc_client.rs +++ b/crates/openshell-core/src/grpc_client.rs @@ -1372,7 +1372,7 @@ pub async fn discover_and_sync_policy( /// Sync an enriched policy back to the gateway. /// /// Used by the supervisor to push baseline-path-enriched policies so the -/// gateway stores the effective policy users see via `openshell sandbox get`. +/// gateway stores the effective policy users see via `os sandbox get`. pub async fn sync_policy( gateway: &GatewayEndpoint, sandbox: &str, diff --git a/crates/openshell-core/src/ssh_handoff.rs b/crates/openshell-core/src/ssh_handoff.rs index 5045a39ba4..0fda34c0aa 100644 --- a/crates/openshell-core/src/ssh_handoff.rs +++ b/crates/openshell-core/src/ssh_handoff.rs @@ -308,7 +308,7 @@ impl SshTarget { let id = Uuid::new_v4(); let listener = ipc::Listener::bind(id).into_diagnostic()?; let handle = format!("{}-{id}", std::process::id()); - let exe = std::env::current_exe().into_diagnostic()?; + let exe = crate::forward::cli_executable()?; let command = build_proxy_command(&exe.to_string_lossy(), &handle, &self.name, &self.workspace); Ok((listener, command)) diff --git a/crates/openshell-core/src/ssh_host_key.rs b/crates/openshell-core/src/ssh_host_key.rs index c5ae29f645..d2b5f1244f 100644 --- a/crates/openshell-core/src/ssh_host_key.rs +++ b/crates/openshell-core/src/ssh_host_key.rs @@ -158,7 +158,7 @@ pub enum HostKeyError { gateway published: {expected}\n \ server presented: {presented}\n\ The SSH server reached through the gateway is not this sandbox's. The handshake was not forwarded.\n\ - Do not connect. Compare the published value with `openshell --workspace {} sandbox get {} --output json`, then stop and start the sandbox.\n\ + Do not connect. Compare the published value with `os --workspace {} sandbox get {} --output json`, then stop and start the sandbox.\n\ If the mismatch persists, contact the gateway operator.", shell_escape(.workspace), shell_escape(.sandbox) diff --git a/crates/openshell-driver-docker/README.md b/crates/openshell-driver-docker/README.md index 871c9f2f01..d770a29917 100644 --- a/crates/openshell-driver-docker/README.md +++ b/crates/openshell-driver-docker/README.md @@ -242,7 +242,7 @@ Example: ```shell docker volume create openshell-work -openshell sandbox create \ +os sandbox create \ --driver-config-json '{"docker":{"mounts":[{"type":"volume","source":"openshell-work","target":"/sandbox/work"}]}}' \ -- claude ``` diff --git a/crates/openshell-driver-kubernetes/README.md b/crates/openshell-driver-kubernetes/README.md index a08e7816cc..e2ef06f4ee 100644 --- a/crates/openshell-driver-kubernetes/README.md +++ b/crates/openshell-driver-kubernetes/README.md @@ -448,7 +448,7 @@ Set this through the CLI with the public driver-keyed envelope. The gateway forwards only the `kubernetes` object to this driver: ```shell -openshell sandbox create \ +os sandbox create \ --driver-config-json '{"kubernetes":{"pod":{"runtime_class_name":"kata-containers","node_selector":{"pool":"gpu"}}}}' \ -- claude ``` @@ -476,7 +476,7 @@ mount paths persist through the external PVC; other `/sandbox` paths come from the current sandbox image. ```shell -openshell sandbox create \ +os sandbox create \ --driver-config-json '{ "kubernetes": { "volumes": [{ diff --git a/crates/openshell-driver-kubernetes/src/driver.rs b/crates/openshell-driver-kubernetes/src/driver.rs index e8eb3f30e9..4e6b3af282 100644 --- a/crates/openshell-driver-kubernetes/src/driver.rs +++ b/crates/openshell-driver-kubernetes/src/driver.rs @@ -2176,7 +2176,7 @@ impl KubernetesComputeDriver { })? { return Err(tonic::Status::failed_precondition( - "GPU sandbox requested, but the active gateway has no allocatable GPUs. Please refer to documentation and use `openshell doctor` commands to inspect GPU support and gateway configuration.", + "GPU sandbox requested, but the active gateway has no allocatable GPUs. Please refer to documentation and use `os doctor` commands to inspect GPU support and gateway configuration.", )); } Ok(()) diff --git a/crates/openshell-driver-mxc/README.md b/crates/openshell-driver-mxc/README.md index 15b11abff8..f28bfa1506 100644 --- a/crates/openshell-driver-mxc/README.md +++ b/crates/openshell-driver-mxc/README.md @@ -77,7 +77,7 @@ Supply workload settings for each sandbox. The public config is keyed by driver ```powershell $config = '{"mxc":{"command":["cmd","/c","echo hello > C:\\\\work\\\\demo\\\\hello.txt"],"cwd":"C:\\\\work\\\\demo"}}' -openshell sandbox create --name mxc-demo --policy demo.yaml ` +os sandbox create --name mxc-demo --policy demo.yaml ` --driver-config-json $config --env MODE=demo --no-tty ``` @@ -155,7 +155,7 @@ gateway host before applying sandbox and TLS overrides, so required Windows bootstrap values remain available without exposing the gateway's full environment. The development export surface remains the [`policy-to-mxc`](examples/policy-to-mxc.rs) example; there is no production -`openshell policy export-mxc` subcommand yet. +`os policy export-mxc` subcommand yet. If governed egress is disabled, any network rule fails closed rather than launching without an enforcement path. diff --git a/crates/openshell-driver-vm/README.md b/crates/openshell-driver-vm/README.md index ff2ed322e2..f675fe3845 100644 --- a/crates/openshell-driver-vm/README.md +++ b/crates/openshell-driver-vm/README.md @@ -85,8 +85,8 @@ overview lives in the repository `README.md`. Point the CLI at the gateway with one of: ```shell -openshell --gateway vm-dev status -openshell gateway select vm-dev # then plain `openshell ` +os --gateway vm-dev status +os gateway select vm-dev # then plain `openshell ` ``` Override defaults via environment: @@ -303,7 +303,7 @@ create TAP devices or install nftables/iptables rules. - `cargo install --locked cargo-zigbuild` and `brew install zig` (or distro equivalent). `vm:supervisor` cross-compiles the Linux guest `openshell-sandbox` and its matching `openshell-supervisor`. - [mise](https://mise.jdx.dev/) task runner - Docker or Podman socket on the local CLI/gateway host when building an image - before `openshell sandbox create --from `; the VM driver exports the + before `os sandbox create --from `; the VM driver exports the image via the local container engine. Docker is tried first; if unavailable, the driver falls back to the Podman socket. On Linux, enable the Podman API socket with diff --git a/crates/openshell-policy/src/lib.rs b/crates/openshell-policy/src/lib.rs index ff6cdd8d5a..ae36a1f19e 100644 --- a/crates/openshell-policy/src/lib.rs +++ b/crates/openshell-policy/src/lib.rs @@ -2678,7 +2678,7 @@ pub fn validate_authored_rule_names( for name in names { if is_provider_rule_name(name) { violations.push(format!( - "network_policies key '{name}' uses reserved '_provider_' prefix for provider composition; use 'openshell policy get --base' for a round-trippable base policy, or use 'openshell policy get --full' to inspect the effective policy including provider entries" + "network_policies key '{name}' uses reserved '_provider_' prefix for provider composition; use 'os policy get --base' for a round-trippable base policy, or use 'os policy get --full' to inspect the effective policy including provider entries" )); } } diff --git a/crates/openshell-providers/src/example_profiles.rs b/crates/openshell-providers/src/example_profiles.rs index 596f643260..9c8ac1830a 100644 --- a/crates/openshell-providers/src/example_profiles.rs +++ b/crates/openshell-providers/src/example_profiles.rs @@ -5,7 +5,7 @@ //! //! `OpenShell` does not compile any provider profile into a release binary. The //! YAML under `providers/` is reviewable example data that an operator imports -//! explicitly with `openshell provider profile import`. +//! explicitly with `os provider profile import`. //! //! Tests still need those files: they are the fixtures that keep the examples //! honest, and they stand in for "what an operator imported" in gateway and CLI diff --git a/crates/openshell-server/src/auth/http.rs b/crates/openshell-server/src/auth/http.rs index 90dae5046f..1b4a03b86c 100644 --- a/crates/openshell-server/src/auth/http.rs +++ b/crates/openshell-server/src/auth/http.rs @@ -534,7 +534,7 @@ fn render_connect_page( btn.disabled = false; btn.textContent = 'Connect to Gateway'; status.className = 'status status-err'; - status.textContent = 'Could not reach the CLI. Is openshell still running?'; + status.textContent = 'Could not reach the CLI. Is os still running?'; }}); }} diff --git a/crates/openshell-server/src/auth/workspace_authz.rs b/crates/openshell-server/src/auth/workspace_authz.rs index 035d8aa354..492dd6dd06 100644 --- a/crates/openshell-server/src/auth/workspace_authz.rs +++ b/crates/openshell-server/src/auth/workspace_authz.rs @@ -168,7 +168,7 @@ pub async fn authorize_workspace( }, format!( "not a member of workspace '{workspace}'; ask a platform admin to run: \ - openshell workspace member add --workspace {workspace_arg} \ + os workspace member add --workspace {workspace_arg} \ --subject {subject_arg} --role user" ), )); @@ -188,7 +188,7 @@ pub async fn authorize_workspace( }, format!( "workspace role '{role}' required in workspace '{workspace}'; ask a \ - platform admin to run: openshell workspace member add --workspace \ + platform admin to run: os workspace member add --workspace \ {workspace_arg} --subject {subject_arg} --role {role}" ), )); @@ -395,7 +395,7 @@ mod tests { assert_eq!( err.message(), "workspace role 'admin' required in workspace 'default'; ask a platform admin to run: \ - openshell workspace member add --workspace 'default' --subject 'user-c' --role admin" + os workspace member add --workspace 'default' --subject 'user-c' --role admin" ); } @@ -463,7 +463,7 @@ mod tests { assert_eq!( err.message(), "not a member of workspace 'default'; ask a platform admin to run: \ - openshell workspace member add --workspace 'default' --subject 'stranger' --role user" + os workspace member add --workspace 'default' --subject 'stranger' --role user" ); } diff --git a/crates/openshell-server/src/compute/mod.rs b/crates/openshell-server/src/compute/mod.rs index 8b2adb5570..58739b83b4 100644 --- a/crates/openshell-server/src/compute/mod.rs +++ b/crates/openshell-server/src/compute/mod.rs @@ -8834,7 +8834,7 @@ fn rewrite_user_facing_conditions(status: &mut Option, spec: Opti && condition.status.eq_ignore_ascii_case("false") && condition.reason.eq_ignore_ascii_case("Unschedulable") { - condition.message = "GPU sandbox could not be scheduled on the active gateway. Another GPU sandbox may already be using the available GPU, or the gateway may not currently be able to satisfy GPU placement. Please refer to documentation and use `openshell doctor` commands to inspect GPU support and gateway configuration.".to_string(); + condition.message = "GPU sandbox could not be scheduled on the active gateway. Another GPU sandbox may already be using the available GPU, or the gateway may not currently be able to satisfy GPU placement. Please refer to documentation and use `os doctor` commands to inspect GPU support and gateway configuration.".to_string(); } } } @@ -13784,7 +13784,7 @@ mod tests { let message = &status.unwrap().conditions[0].message; assert_eq!( message, - "GPU sandbox could not be scheduled on the active gateway. Another GPU sandbox may already be using the available GPU, or the gateway may not currently be able to satisfy GPU placement. Please refer to documentation and use `openshell doctor` commands to inspect GPU support and gateway configuration." + "GPU sandbox could not be scheduled on the active gateway. Another GPU sandbox may already be using the available GPU, or the gateway may not currently be able to satisfy GPU placement. Please refer to documentation and use `os doctor` commands to inspect GPU support and gateway configuration." ); } diff --git a/crates/openshell-server/src/config_file/mod.rs b/crates/openshell-server/src/config_file/mod.rs index 5c2bdf606e..617ae5a6a1 100644 --- a/crates/openshell-server/src/config_file/mod.rs +++ b/crates/openshell-server/src/config_file/mod.rs @@ -3492,10 +3492,7 @@ provider_profile_sources = [ let error = load(tmp.path()).expect_err("the builtin source was removed"); let message = error.to_string(); assert!(message.contains("import-only"), "{message}"); - assert!( - message.contains("openshell provider profile import"), - "{message}" - ); + assert!(message.contains("os provider profile import"), "{message}"); } #[test] diff --git a/crates/openshell-server/src/grpc/policy.rs b/crates/openshell-server/src/grpc/policy.rs index b9d5fa8fff..33a7be0b25 100644 --- a/crates/openshell-server/src/grpc/policy.rs +++ b/crates/openshell-server/src/grpc/policy.rs @@ -7653,7 +7653,7 @@ fn require_mergeable_policy(policy: &ProtoSandboxPolicy) -> Result<(), Status> { } Err(Status::failed_precondition( "incremental policy updates are not available for Cedar policies; edit the Cedar \ - policy and replace it with `openshell policy set`", + policy and replace it with `os policy set`", )) } @@ -17019,7 +17019,7 @@ mod tests { } /// Test helper: pin the proposal approval mode for a sandbox via the - /// settings model, mirroring what `openshell settings set + /// settings model, mirroring what `os settings set /// proposal_approval_mode ` would do at runtime. async fn seed_sandbox_approval_mode(state: &Arc, sandbox_name: &str, mode: &str) { let mut settings = load_sandbox_settings(state.store.as_ref(), "default", sandbox_name) @@ -17036,7 +17036,7 @@ mod tests { } /// Test helper: pin the gateway-wide proposal approval mode, mirroring - /// `openshell settings set --global proposal_approval_mode `. + /// `os settings set --global proposal_approval_mode `. async fn seed_global_approval_mode(state: &Arc, mode: &str) { let mut settings = load_global_settings(state.store.as_ref()).await.unwrap(); settings.settings.insert( @@ -19525,7 +19525,7 @@ mod tests { .unwrap() .review_token; - // `openshell policy set`: a full policy replacement through UpdateConfig. + // `os policy set`: a full policy replacement through UpdateConfig. handle_update_config( &state, with_user(Request::new(UpdateConfigRequest { @@ -23677,7 +23677,7 @@ mod tests { // A gateway without Cedar support refuses to read a stored Cedar // revision before it reaches the merge. assert!( - err.message().contains("openshell policy set") + err.message().contains("os policy set") || (!cfg!(feature = "experimental") && sandbox == "cedar-revision" && err.message().contains("without Cedar policy support")), diff --git a/crates/openshell-server/src/grpc/provider.rs b/crates/openshell-server/src/grpc/provider.rs index e14424bc9c..a84201bc31 100644 --- a/crates/openshell-server/src/grpc/provider.rs +++ b/crates/openshell-server/src/grpc/provider.rs @@ -2213,7 +2213,7 @@ pub async fn validate_provider_profiles_present( }; return Err(Status::failed_precondition(format!( "provider '{name}' references provider profile '{requested}', which is not in this gateway's profile catalog; \ - import it with 'openshell provider profile import -f {scope_flag}'" + import it with 'os provider profile import -f {scope_flag}'" ))); } Ok(()) diff --git a/crates/openshell-server/src/grpc/sandbox.rs b/crates/openshell-server/src/grpc/sandbox.rs index 8e5762a33b..cee29bb57a 100644 --- a/crates/openshell-server/src/grpc/sandbox.rs +++ b/crates/openshell-server/src/grpc/sandbox.rs @@ -7684,10 +7684,7 @@ mod tests { let message = err.message(); assert!(message.contains("'orphan'"), "{message}"); assert!(message.contains("'never-imported'"), "{message}"); - assert!( - message.contains("openshell provider profile import"), - "{message}" - ); + assert!(message.contains("os provider profile import"), "{message}"); } #[tokio::test] @@ -7722,10 +7719,7 @@ mod tests { assert_eq!(err.code(), tonic::Code::FailedPrecondition); let message = err.message(); assert!(message.contains("'never-imported'"), "{message}"); - assert!( - message.contains("openshell provider profile import"), - "{message}" - ); + assert!(message.contains("os provider profile import"), "{message}"); } #[tokio::test] diff --git a/crates/openshell-server/src/grpc/validation.rs b/crates/openshell-server/src/grpc/validation.rs index ef515fd220..825e58c56e 100644 --- a/crates/openshell-server/src/grpc/validation.rs +++ b/crates/openshell-server/src/grpc/validation.rs @@ -1074,7 +1074,7 @@ pub(super) fn validate_no_reserved_provider_policy_keys( .map_err(|violations| Status::invalid_argument(violations.join("; ")))?; if !policy.provider_credential_rules.is_empty() { return Err(Status::invalid_argument( - "provider_credential_rules is managed by the gateway from attached providers; use 'openshell policy get --base' for a round-trippable base policy", + "provider_credential_rules is managed by the gateway from attached providers; use 'os policy get --base' for a round-trippable base policy", )); } Ok(()) diff --git a/crates/openshell-supervisor-network/src/policy_local.rs b/crates/openshell-supervisor-network/src/policy_local.rs index bdf8898986..afee11b194 100644 --- a/crates/openshell-supervisor-network/src/policy_local.rs +++ b/crates/openshell-supervisor-network/src/policy_local.rs @@ -484,7 +484,7 @@ fn parse_last_query(query: &str) -> Option { /// Walk the shorthand log files (most-recent first) and return up to `limit` /// raw denial lines in newest-first order. The agent receives the same -/// human-readable text that `openshell logs` displays — no parsing back into +/// human-readable text that `os logs` displays — no parsing back into /// structured form. Updating the shorthand format adds fields automatically; /// no schema rev required. /// @@ -684,7 +684,7 @@ async fn submit_proposal(ctx: &PolicyLocalContext, body: &[u8]) -> (u16, serde_j }; // One OCSF event per accepted chunk so the audit trace in - // `openshell logs ` carries the propose beat alongside the + // `os logs ` carries the propose beat alongside the // proxy deny and policy reload that bracket it. // // The gateway compresses its `accepted_chunk_ids` by skipping rejected diff --git a/crates/openshell-supervisor-process/src/skills/policy_advisor.md b/crates/openshell-supervisor-process/src/skills/policy_advisor.md index 275043ed12..2903cb9e2e 100644 --- a/crates/openshell-supervisor-process/src/skills/policy_advisor.md +++ b/crates/openshell-supervisor-process/src/skills/policy_advisor.md @@ -131,9 +131,9 @@ A complete narrow REST-inspected rule looks like this: Auto-approval is opt-in via the `proposal_approval_mode` setting, managed through the standard settings model. Reviewers set it at the -gateway scope (fleet-wide) with `openshell settings set --global -proposal_approval_mode auto` or at the sandbox scope with `openshell -settings set proposal_approval_mode auto`. The CLI's `openshell +gateway scope (fleet-wide) with `os settings set --global +proposal_approval_mode auto` or at the sandbox scope with `os +settings set proposal_approval_mode auto`. The CLI's `os sandbox create --approval-mode auto` is a shorthand that writes the sandbox-scoped setting at create time. Gateway scope wins when both are set; the default (no setting) is `"manual"`. diff --git a/crates/openshell-tui/src/lib.rs b/crates/openshell-tui/src/lib.rs index c6464157a9..f03760bbff 100644 --- a/crates/openshell-tui/src/lib.rs +++ b/crates/openshell-tui/src/lib.rs @@ -616,13 +616,13 @@ async fn connect_to_gateway(name: &str, endpoint: &str) -> Result<(Channel, Edge let bundle = openshell_bootstrap::oidc_token::load_oidc_token(name).ok_or_else(|| { miette::miette!( "No OIDC token for gateway '{name}'.\n\ - Authenticate with: openshell gateway login" + Authenticate with: os gateway login" ) })?; if openshell_bootstrap::oidc_token::is_token_expired(&bundle) { miette::bail!( "OIDC token for gateway '{name}' has expired.\n\ - Re-authenticate with: openshell gateway login" + Re-authenticate with: os gateway login" ); } let interceptor = EdgeAuthInterceptor::new(Some(&bundle.access_token), None)?; @@ -975,7 +975,7 @@ async fn fetch_sandbox_detail(app: &mut App) { /// Suspend the TUI, launch an interactive SSH shell to the sandbox, resume on exit. /// -/// This replicates the `openshell sandbox connect` flow but uses `Command::status()` +/// This replicates the `os sandbox connect` flow but uses `Command::status()` /// instead of `exec()` so the TUI process survives. async fn handle_shell_connect( app: &mut App, @@ -1109,7 +1109,7 @@ async fn run_sandbox_ssh( use openshell_core::forward::{sandbox_ssh_args, shell_escape}; /// The status line shows one row, so it carries the first line of an error. -/// `openshell sandbox connect` prints the rest of a host key refusal. +/// `os sandbox connect` prints the rest of a host key refusal. fn first_line(error: &miette::Report) -> String { let error = error.to_string(); error.lines().next().unwrap_or_default().to_string() diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml index 1e5e766e9c..f63ecae228 100644 --- a/deploy/docker/docker-compose.yml +++ b/deploy/docker/docker-compose.yml @@ -13,18 +13,18 @@ # docker compose up -d # # 2. Register the gateway with the CLI (one-time): -# openshell gateway add http://localhost:8080 --name openshell-docker +# os gateway add http://localhost:8080 --name openshell-docker # # 3. Configure an AI provider (example: Anthropic): # ANTHROPIC_API_KEY=sk-ant-... \ -# openshell provider create --type anthropic --from-existing +# os provider create --type anthropic --from-existing # # 4. Create a sandboxed agent — Claude Code: -# openshell sandbox create -- claude +# os sandbox create -- claude # For OpenClaw, use NemoClaw: https://github.com/NVIDIA/NemoClaw # # Sandbox containers are managed by the gateway, not by this Compose file. -# Each `openshell sandbox create` call launches a fresh container; the gateway +# Each `os sandbox create` call launches a fresh container; the gateway # tracks their lifecycle. # # Configuration: diff --git a/deploy/docker/gateway.toml b/deploy/docker/gateway.toml index d2dc51cea2..b1a0d33111 100644 --- a/deploy/docker/gateway.toml +++ b/deploy/docker/gateway.toml @@ -42,7 +42,7 @@ kid_path = "/var/lib/openshell/tls/jwt/kid" gateway_id = "openshell-docker" [openshell.drivers.docker] -# Default image pulled for `openshell sandbox create` without --from. +# Default image pulled for `os sandbox create` without --from. default_image = "nvcr.io/nvidia/base/ubuntu:24.04" # Sandbox runtime image from which the openshell-sandbox binary is extracted. sandbox_runtime_image = "quay.io/ai-openshell/sandbox:latest" diff --git a/deploy/man/openshell.1.md b/deploy/man/os.1.md similarity index 86% rename from deploy/man/openshell.1.md rename to deploy/man/os.1.md index 7dabf558ab..b95ca2f483 100644 --- a/deploy/man/openshell.1.md +++ b/deploy/man/os.1.md @@ -1,22 +1,22 @@ --- -title: OPENSHELL +title: OS section: 1 header: OpenShell Manual -footer: openshell +footer: os date: 2026 --- # NAME -openshell - CLI for managing OpenShell sandboxes, gateway registrations, and providers +os - CLI for managing OpenShell sandboxes, gateway registrations, and providers # SYNOPSIS -**openshell** \[*OPTIONS*\] *COMMAND* \[*ARGS*\] +**os** \[*OPTIONS*\] *COMMAND* \[*ARGS*\] # DESCRIPTION -**openshell** is the command-line interface for OpenShell, a platform +**os** is the command-line interface for OpenShell, a platform providing safe, sandboxed runtimes for autonomous AI agents. It manages gateway registrations, sandbox lifecycle, credential providers, network policies, and provider attachments. @@ -25,6 +25,10 @@ The CLI communicates with a gateway server over gRPC. The gateway can run as a package-managed systemd user service, a Helm deployment, a development task, or behind a cloud reverse proxy. +The CLI was previously named **openshell**. That name still runs the same +command and prints a rename notice to standard error; it will be removed in a +future release. + # COMMANDS ## Gateway Management @@ -168,6 +172,9 @@ development task, or behind a cloud reverse proxy. **OPENSHELL_GATEWAY_ENDPOINT** : Direct gateway URL (bypasses metadata lookup). +**OPENSHELL_SUPPRESS_RENAME_WARNING** +: Set to any non-empty value to hide the notice printed when the CLI runs as **openshell**. + **ANTHROPIC_API_KEY**, **OPENAI_API_KEY**, **OPENROUTER_API_KEY** : API keys discovered by auto-provider creation. @@ -186,21 +193,21 @@ development task, or behind a cloud reverse proxy. Register the local RPM gateway and create a sandbox: - openshell gateway add --local https://127.0.0.1:17670 - openshell sandbox create -- claude + os gateway add --local https://127.0.0.1:17670 + os sandbox create -- claude List sandboxes and connect to one: - openshell sandbox list - openshell sandbox connect my-sandbox + os sandbox list + os sandbox connect my-sandbox Create a provider from a local environment variable: - openshell provider create --name openai --type openai --from-existing + os provider create --name openai --type openai --from-existing Check gateway health: - openshell status + os status # SEE ALSO @@ -208,4 +215,4 @@ Check gateway health: Full documentation: *https://docs.nvidia.com/openshell/* -Run **openshell** *COMMAND* **--help** for detailed help on any command. +Run **os** *COMMAND* **--help** for detailed help on any command. diff --git a/deploy/rpm/QUICKSTART.md b/deploy/rpm/QUICKSTART.md index 26ef3c02b0..2fe3a11b31 100644 --- a/deploy/rpm/QUICKSTART.md +++ b/deploy/rpm/QUICKSTART.md @@ -81,7 +81,7 @@ systemctl --user status openshell-gateway The CLI needs to know where the gateway is. Register it: ```shell -openshell gateway add --local https://127.0.0.1:17670 +os gateway add --local https://127.0.0.1:17670 ``` This discovers the pre-provisioned mTLS certificates at @@ -91,7 +91,7 @@ as active. Verify the connection: ```shell -openshell status +os status ``` ## Persist across reboots @@ -113,7 +113,7 @@ Set your API key in the environment, then create a sandbox: ```shell export ANTHROPIC_API_KEY=sk-... -openshell sandbox create -- claude +os sandbox create -- claude ``` The CLI detects the agent, prompts to create a credential provider @@ -123,8 +123,8 @@ and connects you to the running sandbox. Other agents: ```shell -openshell sandbox create -- opencode -openshell sandbox create -- codex +os sandbox create -- opencode +os sandbox create -- codex ``` ## Set up providers manually @@ -133,14 +133,14 @@ If you prefer to configure providers before creating sandboxes: ```shell # Create a provider from a local environment variable -openshell provider create --name anthropic --type anthropic --from-existing +os provider create --name anthropic --type anthropic --from-existing # Or supply the credential directly -openshell provider create --name openai --type openai \ +os provider create --name openai --type openai \ --credential OPENAI_API_KEY=sk-... # List configured providers -openshell provider list +os provider list ``` ## Configure provider-backed inference (optional) @@ -148,7 +148,7 @@ openshell provider list To grant a sandbox access to a model provider: ```shell -openshell sandbox provider attach openai +os sandbox provider attach openai # Configure the workload to call the provider's native endpoint and select # the model in the client. diff --git a/deploy/rpm/TROUBLESHOOTING.md b/deploy/rpm/TROUBLESHOOTING.md index 0d5921d965..5448116f3f 100644 --- a/deploy/rpm/TROUBLESHOOTING.md +++ b/deploy/rpm/TROUBLESHOOTING.md @@ -18,17 +18,17 @@ communicate with the gateway over gRPC and work identically regardless of deployment mode: ``` -openshell status -openshell sandbox create|list|get|delete|connect|exec -openshell logs -openshell provider create|list|get|update|delete -openshell policy get|set|update|list|prove -openshell provider list -openshell sandbox provider list -openshell settings get|set -openshell forward start|stop|list -openshell term -openshell gateway add|select|info|list|remove +os status +os sandbox create|list|get|delete|connect|exec +os logs +os provider create|list|get|update|delete +os policy get|set|update|list|prove +os provider list +os sandbox provider list +os settings get|set +os forward start|stop|list +os term +os gateway add|select|info|list|remove ``` ### Gateway lifecycle @@ -44,7 +44,7 @@ systemd commands directly: | Check status | `systemctl --user status openshell-gateway` | | View logs | `journalctl --user -u openshell-gateway` | | Follow logs | `journalctl --user -u openshell-gateway -f` | -| Remove CLI registration | `openshell gateway remove [name]` | +| Remove CLI registration | `os gateway remove [name]` | ### Building from local Dockerfiles @@ -52,7 +52,7 @@ Build the image with Podman, then reference it directly: ```shell podman build -t localhost/my-sandbox:latest ./my-dir -openshell sandbox create --from localhost/my-sandbox:latest +os sandbox create --from localhost/my-sandbox:latest ``` ## Remote CLI access @@ -74,8 +74,8 @@ ssh -L 17670:127.0.0.1:17670 user@gateway-host scp -r user@gateway-host:~/.config/openshell/gateways/openshell/mtls/ \ ~/.config/openshell/gateways/openshell/mtls/ -openshell gateway add --local https://127.0.0.1:17670 -openshell status +os gateway add --local https://127.0.0.1:17670 +os status ``` ### Option 2: Externally-managed certificates @@ -94,7 +94,7 @@ CLI: mkdir -p ~/.config/openshell/gateways/openshell/mtls/ cp ca.crt tls.crt tls.key ~/.config/openshell/gateways/openshell/mtls/ -openshell gateway add --local https://:17670 +os gateway add --local https://:17670 ``` ### Firewall @@ -120,7 +120,7 @@ The CLI cannot find a registered gateway. This happens when the gateway is running but has not been registered with the CLI. ```shell -openshell gateway add --local https://127.0.0.1:17670 +os gateway add --local https://127.0.0.1:17670 ``` ### Gateway fails to start @@ -284,7 +284,7 @@ Other breaking changes in this release: gateway at `https://127.0.0.1:8080`, re-register it: ```shell - openshell gateway add --local https://127.0.0.1:17670 + os gateway add --local https://127.0.0.1:17670 ``` - **Default bind address changed from `0.0.0.0` to `127.0.0.1`.** If diff --git a/e2e/cedar/README.md b/e2e/cedar/README.md index f02f16bfc3..14a5279c78 100644 --- a/e2e/cedar/README.md +++ b/e2e/cedar/README.md @@ -57,7 +57,7 @@ Against an already running development gateway and supervisor: ```shell OPENSHELL_GATEWAY= \ -OPENSHELL_BIN="$PWD/target/debug/openshell" \ +OPENSHELL_BIN="$PWD/target/debug/os" \ mise run e2e:cedar ``` diff --git a/e2e/cedar/test.sh b/e2e/cedar/test.sh index 189b98b96d..dd906368ee 100755 --- a/e2e/cedar/test.sh +++ b/e2e/cedar/test.sh @@ -16,7 +16,7 @@ export NO_COLOR=1 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" -OPENSHELL_BIN="${OPENSHELL_BIN:-${REPO_ROOT}/target/debug/openshell}" +OPENSHELL_BIN="${OPENSHELL_BIN:-${REPO_ROOT}/target/debug/os}" # Sandbox names are limited to 19 characters. RUN_ID="${RUN_ID:-$(date +%H%M%S)}" SANDBOX="${SANDBOX:-cedar-e2e-${RUN_ID}}" diff --git a/e2e/gpu/README.md b/e2e/gpu/README.md index 8462006cd3..87c090ddda 100644 --- a/e2e/gpu/README.md +++ b/e2e/gpu/README.md @@ -158,7 +158,7 @@ mise run e2e:workloads:build or to set `OPENSHELL_E2E_WORKLOAD_MANIFEST` to an external manifest. Each manifest entry supplies the sandbox image and command. OpenShell runs that -command through `openshell sandbox create --gpu --from -- `. +command through `os sandbox create --gpu --from -- `. The test runner iterates all GPU-tagged workload entries and enforces each entry's declared expectation: diff --git a/e2e/kubernetes/app-listener/README.md b/e2e/kubernetes/app-listener/README.md index efb83d17d7..a58897c3d8 100644 --- a/e2e/kubernetes/app-listener/README.md +++ b/e2e/kubernetes/app-listener/README.md @@ -117,7 +117,7 @@ Deploy through the repository's Helm development workflow with these values. Create two sandboxes running an HTTP/WebSocket test application bound to loopback port 8080. Expose named and unnamed services using the existing CLI, including -`openshell service expose 8080 web`. CLI URLs still use gateway mode in +`os service expose 8080 web`. CLI URLs still use gateway mode in this stage. Use these direct-listener hostnames instead: - `default--.services.example.com` for the unnamed service. diff --git a/e2e/kubernetes/app-listener/run.py b/e2e/kubernetes/app-listener/run.py index ccbc77c39e..fd25394351 100644 --- a/e2e/kubernetes/app-listener/run.py +++ b/e2e/kubernetes/app-listener/run.py @@ -48,7 +48,7 @@ def main(): helm_args = [*config_args, *(["--kube-context", context] if context else [])] k = ["kubectl", *kube_args, "-n", namespace] helm = ["helm", *helm_args] - cli = Path(os.getenv("OPENSHELL_BIN", ROOT / "target/debug/openshell")).resolve() + cli = Path(os.getenv("OPENSHELL_BIN", ROOT / "target/debug/os")).resolve() evidence = ( ROOT / "results/app-listener" diff --git a/e2e/kubernetes/app-listener/verify.py b/e2e/kubernetes/app-listener/verify.py index e42949f269..83f2be1b0c 100644 --- a/e2e/kubernetes/app-listener/verify.py +++ b/e2e/kubernetes/app-listener/verify.py @@ -38,7 +38,7 @@ def main(): help="Maintain an API port-forward to this Service across gateway restarts (e.g. service/listener-review)", ) parser.add_argument("--app-ca", type=Path, required=True) - parser.add_argument("--cli", default="target/debug/openshell") + parser.add_argument("--cli", default="target/debug/os") parser.add_argument("--domain", default="services.example.com") parser.add_argument("--port", default="9443") parser.add_argument( diff --git a/e2e/mcp-conformance.sh b/e2e/mcp-conformance.sh index a9e912e34a..a5314c806a 100755 --- a/e2e/mcp-conformance.sh +++ b/e2e/mcp-conformance.sh @@ -107,7 +107,7 @@ openshell_bin() { local target_dir target_dir="$(e2e_cargo_target_dir "${ROOT}")" - printf '%s\n' "${target_dir}/debug/openshell" + printf '%s\n' "${target_dir}/debug/os" } patch_conformance_clients() { diff --git a/e2e/mcp-conformance/client-through-openshell.sh b/e2e/mcp-conformance/client-through-openshell.sh index a3ab20c0c5..a8b17d6ae3 100755 --- a/e2e/mcp-conformance/client-through-openshell.sh +++ b/e2e/mcp-conformance/client-through-openshell.sh @@ -29,7 +29,7 @@ ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" source "${ROOT}/e2e/support/gateway-common.sh" if [ -z "${OPENSHELL_BIN:-}" ]; then TARGET_DIR="$(e2e_cargo_target_dir "${ROOT}")" - OPENSHELL_BIN="${TARGET_DIR}/debug/openshell" + OPENSHELL_BIN="${TARGET_DIR}/debug/os" fi require_active_gateway() { @@ -38,9 +38,9 @@ require_active_gateway() { if ! status_output="$("${OPENSHELL_BIN}" status 2>&1)"; then echo "ERROR: no reachable active OpenShell gateway for MCP conformance." >&2 echo " Run e2e/mcp-conformance.sh so it starts one shared Docker-backed gateway." >&2 - echo "=== openshell status output ===" >&2 + echo "=== os status output ===" >&2 printf '%s\n' "${status_output}" >&2 - echo "=== end openshell status output ===" >&2 + echo "=== end os status output ===" >&2 exit 2 fi } diff --git a/e2e/policy-advisor/README.md b/e2e/policy-advisor/README.md index a04a8bc996..4a75a2c15f 100644 --- a/e2e/policy-advisor/README.md +++ b/e2e/policy-advisor/README.md @@ -24,11 +24,11 @@ Run against an ephemeral Docker gateway: DEMO_GITHUB_OWNER= \ DEMO_GITHUB_REPO=openshell-policy-demo \ e2e/with-docker-gateway.sh bash -lc ' - target/debug/openshell settings set --global \ + target/debug/os settings set --global \ --key agent_policy_proposals_enabled \ --value true \ --yes - OPENSHELL_BIN="$PWD/target/debug/openshell" bash e2e/policy-advisor/test.sh + OPENSHELL_BIN="$PWD/target/debug/os" bash e2e/policy-advisor/test.sh ' ``` @@ -36,13 +36,13 @@ To keep the sandbox for debugging, start a local gateway first with `mise run gateway:docker`, then run: ```bash -target/debug/openshell settings set --global \ +target/debug/os settings set --global \ --key agent_policy_proposals_enabled \ --value true \ --yes OPENSHELL_GATEWAY=docker-dev \ -OPENSHELL_BIN="$PWD/target/debug/openshell" \ +OPENSHELL_BIN="$PWD/target/debug/os" \ DEMO_KEEP_SANDBOX=1 \ DEMO_GITHUB_OWNER= \ DEMO_GITHUB_REPO=openshell-policy-demo \ diff --git a/e2e/policy-advisor/existing-endpoint-auto-approve.sh b/e2e/policy-advisor/existing-endpoint-auto-approve.sh index c80c6bbdc4..fa0d3e2536 100755 --- a/e2e/policy-advisor/existing-endpoint-auto-approve.sh +++ b/e2e/policy-advisor/existing-endpoint-auto-approve.sh @@ -12,7 +12,7 @@ export NO_COLOR=1 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" -OPENSHELL_BIN="${OPENSHELL_BIN:-${REPO_ROOT}/target/debug/openshell}" +OPENSHELL_BIN="${OPENSHELL_BIN:-${REPO_ROOT}/target/debug/os}" RUN_ID="${RUN_ID:-$(date +%H%M%S)}" SANDBOX="${SANDBOX:-advisor-2821-${RUN_ID}}" FLUSH_WAIT="${FLUSH_WAIT:-45}" diff --git a/e2e/policy-advisor/test.sh b/e2e/policy-advisor/test.sh index 98854b52c9..2a0cdce0b7 100755 --- a/e2e/policy-advisor/test.sh +++ b/e2e/policy-advisor/test.sh @@ -11,8 +11,8 @@ POLICY_TEMPLATE="${SCRIPT_DIR}/policy.template.yaml" RUNNER_SOURCE="${SCRIPT_DIR}/sandbox-runner.sh" if [[ -z "${OPENSHELL_BIN:-}" ]]; then - if [[ -x "${REPO_ROOT}/target/debug/openshell" ]]; then - OPENSHELL_BIN="${REPO_ROOT}/target/debug/openshell" + if [[ -x "${REPO_ROOT}/target/debug/os" ]]; then + OPENSHELL_BIN="${REPO_ROOT}/target/debug/os" else OPENSHELL_BIN="openshell" fi diff --git a/e2e/policy-advisor/wait-smoke.sh b/e2e/policy-advisor/wait-smoke.sh index 006295a470..ab2f642c2f 100755 --- a/e2e/policy-advisor/wait-smoke.sh +++ b/e2e/policy-advisor/wait-smoke.sh @@ -37,7 +37,7 @@ # KUBECONFIG=kubeconfig kubectl -n openshell \ # port-forward svc/openshell 8090:8080 >/dev/null 2>&1 & # - The agent-proposals feature flag enabled. Run once: -# openshell settings set --global \ +# os settings set --global \ # --key agent_policy_proposals_enabled --value true --yes # # Runs in ~10s on a warm cluster (most of which is sandbox SSH bring-up). @@ -49,8 +49,8 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" RUNNER_SOURCE="${SCRIPT_DIR}/sandbox-runner.sh" if [[ -z "${OPENSHELL_BIN:-}" ]]; then - if [[ -x "${REPO_ROOT}/target/debug/openshell" ]]; then - OPENSHELL_BIN="${REPO_ROOT}/target/debug/openshell" + if [[ -x "${REPO_ROOT}/target/debug/os" ]]; then + OPENSHELL_BIN="${REPO_ROOT}/target/debug/os" else OPENSHELL_BIN="openshell" fi diff --git a/e2e/run.sh b/e2e/run.sh index f96d06cfdb..0284e7157e 100755 --- a/e2e/run.sh +++ b/e2e/run.sh @@ -235,8 +235,8 @@ target_dir="$(e2e_cargo_target_dir "${ROOT}" mise x -- cargo)" ensure_build_nofile_limit echo "==> Building native host openshell CLI" -mise x -- cargo build "${cargo_jobs[@]}" -p openshell-cli --bin openshell -host_cli_bin="${target_dir}/debug/openshell" +mise x -- cargo build "${cargo_jobs[@]}" -p openshell-cli --bin os +host_cli_bin="${target_dir}/debug/os" echo "==> Preparing ${linux_musl_target} build target" mise x -- rustup target add "${linux_musl_target}" >/dev/null diff --git a/e2e/rust/e2e-kubernetes.sh b/e2e/rust/e2e-kubernetes.sh index 4e2df4a469..65eb009a57 100755 --- a/e2e/rust/e2e-kubernetes.sh +++ b/e2e/rust/e2e-kubernetes.sh @@ -61,7 +61,7 @@ render_html() { # local CLI needs to be built when CI has not supplied a prebuilt one. if [ -z "${OPENSHELL_BIN:-}" ]; then cargo build -p openshell-cli - export OPENSHELL_BIN="${ROOT}/target/debug/openshell" + export OPENSHELL_BIN="${ROOT}/target/debug/os" fi test_filter=() diff --git a/e2e/rust/e2e-podman.sh b/e2e/rust/e2e-podman.sh index 06245b6d04..daed06720c 100755 --- a/e2e/rust/e2e-podman.sh +++ b/e2e/rust/e2e-podman.sh @@ -81,7 +81,7 @@ fi if [ -n "${OPENSHELL_GATEWAY_ENDPOINT:-}" ] && [ -z "${OPENSHELL_BIN:-}" ]; then cargo build -p openshell-cli - export OPENSHELL_BIN="${ROOT}/target/debug/openshell" + export OPENSHELL_BIN="${ROOT}/target/debug/os" fi # The conformance suite runs on every lane, including e2e-conformance-only, diff --git a/e2e/rust/e2e-vm.sh b/e2e/rust/e2e-vm.sh index eaef034e0f..375a93d8ae 100755 --- a/e2e/rust/e2e-vm.sh +++ b/e2e/rust/e2e-vm.sh @@ -48,7 +48,7 @@ source "${ROOT}/e2e/support/conformance.sh" COMPRESSED_DIR="${ROOT}/target/vm-runtime-compressed" GATEWAY_BIN="${OPENSHELL_GATEWAY_BIN:-${ROOT}/target/debug/openshell-gateway}" DRIVER_BIN="${OPENSHELL_VM_DRIVER_BIN:-${ROOT}/target/debug/openshell-driver-vm}" -CLI_BIN="${OPENSHELL_BIN:-${ROOT}/target/debug/openshell}" +CLI_BIN="${OPENSHELL_BIN:-${ROOT}/target/debug/os}" E2E_TEST_OVERRIDE="${OPENSHELL_E2E_VM_TEST:-}" # Unset or empty selects Rust defaults; e2e-conformance-only skips Rust tests. E2E_FEATURES="${OPENSHELL_E2E_VM_FEATURES:-e2e-vm}" @@ -413,13 +413,13 @@ done if [ "${elapsed}" -ge "${GATEWAY_READY_TIMEOUT}" ]; then echo "ERROR: openshell-gateway did not become ready after ${GATEWAY_READY_TIMEOUT}s" - echo "=== last openshell status output ===" + echo "=== last os status output ===" if [ -n "${last_status_output}" ]; then printf '%s\n' "${last_status_output}" else echo "" fi - echo "=== end openshell status output ===" + echo "=== end os status output ===" exit 1 fi diff --git a/e2e/rust/src/harness/binary.rs b/e2e/rust/src/harness/binary.rs index cd853906b9..5f6f476757 100644 --- a/e2e/rust/src/harness/binary.rs +++ b/e2e/rust/src/harness/binary.rs @@ -4,7 +4,7 @@ //! CLI binary resolution for e2e tests. //! //! Resolves the `openshell` binary from `OPENSHELL_BIN`, or from -//! `/target/debug/openshell` for local runs. The local binary must +//! `/target/debug/os` for local runs. The local binary must //! already be built — the E2E mise tasks do this before running the tests. use std::path::{Path, PathBuf}; @@ -23,16 +23,14 @@ fn workspace_root() -> PathBuf { /// Return the path to the `openshell` CLI binary. /// /// Uses `OPENSHELL_BIN` when set, otherwise expects the binary at -/// `/target/debug/openshell`. +/// `/target/debug/os`. /// /// # Panics /// /// Panics if the configured or locally-built binary is not found. pub fn openshell_bin() -> PathBuf { - let bin = std::env::var_os("OPENSHELL_BIN").map_or_else( - || workspace_root().join("target/debug/openshell"), - PathBuf::from, - ); + let bin = std::env::var_os("OPENSHELL_BIN") + .map_or_else(|| workspace_root().join("target/debug/os"), PathBuf::from); assert!( bin.is_file(), "openshell binary not found at {} — set OPENSHELL_BIN or run `cargo build -p openshell-cli` first", diff --git a/e2e/rust/src/harness/cli.rs b/e2e/rust/src/harness/cli.rs index 1c63ea392b..4b95350f5e 100644 --- a/e2e/rust/src/harness/cli.rs +++ b/e2e/rust/src/harness/cli.rs @@ -128,7 +128,7 @@ pub async fn wait_for_sandbox_exec_contains( } Err(err) => ( false, - format!("failed to spawn openshell sandbox exec: {err}"), + format!("failed to spawn os sandbox exec: {err}"), ), }; (ready, last_output) diff --git a/e2e/rust/src/harness/container.rs b/e2e/rust/src/harness/container.rs index 2b81405742..3726e909ef 100644 --- a/e2e/rust/src/harness/container.rs +++ b/e2e/rust/src/harness/container.rs @@ -76,7 +76,7 @@ static NEXT_IMAGE_ID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU6 /// Builds a container image from a local Dockerfile via the active container /// engine and removes it on drop. /// -/// `openshell sandbox create --from` no longer builds local Dockerfiles +/// `os sandbox create --from` no longer builds local Dockerfiles /// itself (see the pre-0.1.0 breaking-change notes), so e2e tests that need a /// custom image build it out-of-band with this guard and pass the resulting /// `tag()` to `--from`. diff --git a/e2e/rust/src/harness/sandbox.rs b/e2e/rust/src/harness/sandbox.rs index 9d14092cb2..6e20745f35 100644 --- a/e2e/rust/src/harness/sandbox.rs +++ b/e2e/rust/src/harness/sandbox.rs @@ -121,7 +121,7 @@ impl SandboxGuard { /// /// # Arguments /// - /// * `args` — Extra arguments to `openshell sandbox create`, including + /// * `args` — Extra arguments to `os sandbox create`, including /// `-- ` if needed. /// /// # Errors @@ -386,7 +386,7 @@ impl SandboxGuard { }) } - /// Upload local files to the sandbox via `openshell sandbox upload`. + /// Upload local files to the sandbox via `os sandbox upload`. /// /// # Arguments /// @@ -475,7 +475,7 @@ impl SandboxGuard { Ok(combined) } - /// Run a one-shot command inside the sandbox via `openshell sandbox exec`. + /// Run a one-shot command inside the sandbox via `os sandbox exec`. /// /// Used by tests that need to pre-populate sandbox-side state (create /// files, symlinks, directories) without going through the upload flow. @@ -528,7 +528,7 @@ impl SandboxGuard { Ok(combined) } - /// Download files from the sandbox via `openshell sandbox download`. + /// Download files from the sandbox via `os sandbox download`. /// /// # Arguments /// @@ -615,7 +615,7 @@ impl SandboxGuard { .stderr(Stdio::piped()) .output() .await - .map_err(|e| format!("failed to spawn openshell sandbox delete: {e}"))?; + .map_err(|e| format!("failed to spawn os sandbox delete: {e}"))?; if !output.status.success() { return Err(format!( "sandbox delete {} failed (exit {:?}):\n{}{}", diff --git a/e2e/rust/tests/edge_tunnel_e2e.rs b/e2e/rust/tests/edge_tunnel_e2e.rs index 80ee4a6ed8..507b79a222 100644 --- a/e2e/rust/tests/edge_tunnel_e2e.rs +++ b/e2e/rust/tests/edge_tunnel_e2e.rs @@ -96,7 +96,7 @@ fn seed_edge_gateway_config( // Test 12: gRPC health check against a gateway // ------------------------------------------------------------------- -/// `openshell status` should report a healthy gateway when connected to a +/// `os status` should report a healthy gateway when connected to a /// configured gateway. /// /// This test verifies the normal gateway path: @@ -108,10 +108,7 @@ async fn gateway_status_reports_healthy() { let (output, code) = run_cli(&["status"]).await; let clean = strip_ansi(&output); - assert_eq!( - code, 0, - "openshell status should exit 0 against gateway:\n{clean}" - ); + assert_eq!(code, 0, "os status should exit 0 against gateway:\n{clean}"); // The status output should show the gateway as healthy/connected. assert!( @@ -134,7 +131,7 @@ async fn gateway_status_reports_healthy() { /// CLI → local TCP proxy → WebSocket → /_ws_tunnel → loopback TCP → gRPC /// /// The test seeds a temporary config directory with edge auth metadata and a -/// dummy token, then runs `openshell status` against the live plaintext +/// dummy token, then runs `os status` against the live plaintext /// gateway. /// /// Note: The dummy token won't be validated (no edge auth middleware on @@ -208,7 +205,7 @@ async fn ws_tunnel_status_through_edge_proxy() { let clean = strip_ansi(&output); assert_eq!( code, 0, - "openshell status through WS tunnel should exit 0:\n{clean}" + "os status through WS tunnel should exit 0:\n{clean}" ); assert!( clean.to_lowercase().contains("healthy") diff --git a/e2e/rust/tests/policy_dns_ipv6_egress.rs b/e2e/rust/tests/policy_dns_ipv6_egress.rs index 10526f8ee0..6f0ede76e3 100644 --- a/e2e/rust/tests/policy_dns_ipv6_egress.rs +++ b/e2e/rust/tests/policy_dns_ipv6_egress.rs @@ -56,7 +56,7 @@ async fn sandbox_logs(name: &str) -> Result { .stderr(Stdio::piped()) .output() .await - .map_err(|e| format!("failed to spawn openshell logs: {e}"))?; + .map_err(|e| format!("failed to spawn os logs: {e}"))?; let combined = format!( "{}{}", String::from_utf8_lossy(&output.stdout), @@ -65,7 +65,7 @@ async fn sandbox_logs(name: &str) -> Result { if output.status.success() { Ok(combined) } else { - Err(format!("openshell logs failed:\n{combined}")) + Err(format!("os logs failed:\n{combined}")) } } diff --git a/e2e/rust/tests/user_namespaces.rs b/e2e/rust/tests/user_namespaces.rs index 0c0da89158..c5ef8dac95 100644 --- a/e2e/rust/tests/user_namespaces.rs +++ b/e2e/rust/tests/user_namespaces.rs @@ -155,7 +155,7 @@ async fn wait_for_sandbox_pod(name: &str, timeout_secs: u64) -> Result<(), Strin // 2. The test mutates the gateway StatefulSet via `kubectl set env`, which // triggers a pod rollout mid-test. The wrapper's `kubectl port-forward` // to the old pod is disrupted during the rollout, and the test's -// `openshell sandbox create` is spawned without capturing stderr, so +// `os sandbox create` is spawned without capturing stderr, so // transient connection failures surface as a generic "sandbox did not // appear within 60s" with no actionable signal. #[ignore = "broken: hardcoded docker exec container name + brittle mid-test gateway rollout (see header)"] diff --git a/e2e/support/gateway-common.sh b/e2e/support/gateway-common.sh index f69518f0bc..822d49238c 100644 --- a/e2e/support/gateway-common.sh +++ b/e2e/support/gateway-common.sh @@ -341,7 +341,7 @@ e2e_import_example_provider_profiles() { # # The browser PKCE flow the CLI normally uses cannot run unattended, so mint an # admin access token with Keycloak's password grant and write the same token -# bundle `openshell gateway login` would have stored. Used only to establish a +# bundle `os gateway login` would have stored. Used only to establish a # setup identity; the tests themselves still authenticate however they choose. e2e_register_oidc_admin_session() { local config_home=$1 @@ -497,7 +497,7 @@ e2e_build_gateway_binaries() { target_dir="$(e2e_cargo_target_dir "${root}")" printf -v "${target_var}" '%s' "${target_dir}" printf -v "${gateway_var}" '%s' "${OPENSHELL_GATEWAY_BIN:-${target_dir}/debug/openshell-gateway}" - printf -v "${cli_var}" '%s' "${OPENSHELL_BIN:-${target_dir}/debug/openshell}" + printf -v "${cli_var}" '%s' "${OPENSHELL_BIN:-${target_dir}/debug/os}" if [ -z "${OPENSHELL_GATEWAY_BIN:-}" ]; then echo "Building openshell-gateway..." diff --git a/e2e/with-kube-gateway.sh b/e2e/with-kube-gateway.sh index 4611fd137d..e58feca029 100755 --- a/e2e/with-kube-gateway.sh +++ b/e2e/with-kube-gateway.sh @@ -760,7 +760,7 @@ cleanup() { echo "=== Agent Sandbox resources ===" kctl -n "${NAMESPACE}" get sandboxes.agents.x-k8s.io -o yaml 2>&1 || true echo "=== gateway sandbox records ===" - "${OPENSHELL_BIN:-${ROOT}/target/debug/openshell}" \ + "${OPENSHELL_BIN:-${ROOT}/target/debug/os}" \ sandbox list --all-workspaces --output json 2>&1 || true echo "=== sandbox-runtime supervisor Pods ===" kctl -n "${NAMESPACE}" get pods \ @@ -1023,7 +1023,7 @@ run_scenario() { fi e2e_import_example_provider_profiles \ - "${OPENSHELL_BIN:-${ROOT}/target/debug/openshell}" "${ROOT}" || return 1 + "${OPENSHELL_BIN:-${ROOT}/target/debug/os}" "${ROOT}" || return 1 echo "Running e2e command against ${GATEWAY_ENDPOINT}: ${E2E_CMD[*]}" "${E2E_CMD[@]}" || scenario_exit=$? @@ -1886,7 +1886,7 @@ else fi e2e_import_example_provider_profiles \ - "${OPENSHELL_BIN:-${ROOT}/target/debug/openshell}" "${ROOT}" || exit 1 + "${OPENSHELL_BIN:-${ROOT}/target/debug/os}" "${ROOT}" || exit 1 echo "Running e2e command against ${GATEWAY_ENDPOINT}: $*" "$@" diff --git a/examples/agent-driven-policy-management/README.md b/examples/agent-driven-policy-management/README.md index a0eaa63585..ffffffcd8c 100644 --- a/examples/agent-driven-policy-management/README.md +++ b/examples/agent-driven-policy-management/README.md @@ -20,7 +20,7 @@ Run the full agent-driven policy loop end-to-end: This is the load-bearing UX point: the agent burns zero LLM tokens while it waits; it's literally sleeping on a socket. 6. You approve the proposal from the host with one keystroke after seeing the - exact rule and the prover verdict in `openshell rule get`. + exact rule and the prover verdict in `os rule get`. 7. The agent's `/wait` returns within ~1 second of the approval. The sandbox has hot-reloaded the merged policy; the agent retries the original PUT once and exits. @@ -31,7 +31,7 @@ the policy round-trip itself. ## Prerequisites -- An active OpenShell gateway (`openshell gateway start`). +- An active OpenShell gateway (`os gateway start`). - `gh auth login` (or a `GITHUB_TOKEN` env var with contents-write on a scratch repo). - `codex login` on the host. @@ -84,7 +84,7 @@ reject with `--reason "scope to docs/ paths only"` and the agent reads | `DEMO_APPROVAL_TIMEOUT_SECS` | `240` (auto), `1800` (manual mode) | | `DEMO_CODEX_MODEL` | `gpt-5.4-mini` (pinned for ChatGPT-account compatibility; override if your account supports a different model) | | `DEMO_CODEX_REASONING` | `low` (the demo task is mechanical; `medium`/`high` slow it down without changing outcomes) | -| `OPENSHELL_BIN` | `target/debug/openshell` if present, else `openshell` on `PATH` | +| `OPENSHELL_BIN` | `target/debug/os` if present, else `openshell` on `PATH` | ## What the agent sees @@ -105,8 +105,8 @@ with three parts, each with a different trust level: | `validation_result` (prover output) | gateway-side prover | trust signal — but this surface is in progress (see [RFC 0002](../../rfc/0002-agent-driven-policy-management/README.md)) | The MVP today shows the structured rule plus the agent's rationale in -`openshell rule get` and the TUI inbox panel. With prover validation wired -into the gateway, `openshell rule get` also shows a `Validation:` line for +`os rule get` and the TUI inbox panel. With prover validation wired +into the gateway, `os rule get` also shows a `Validation:` line for agent-authored chunks. The value is the prover's verdict in OCSF-shorthand style — one short, scannable string per chunk: @@ -125,7 +125,7 @@ issue — surfaces in the gateway log, not as proposal failure), `merge failed: (merged policy fails the structural safety check). Read the structured rule (Endpoints + Binary). Read the Validation line. -Approve if both look right. The demo's `openshell rule approve-all` +Approve if both look right. The demo's `os rule approve-all` auto-approves to keep the loop short; in a real session a developer makes that judgment per chunk before pressing `a`. diff --git a/examples/agent-driven-policy-management/demo.sh b/examples/agent-driven-policy-management/demo.sh index 2cb10dedb9..d82f25dbad 100755 --- a/examples/agent-driven-policy-management/demo.sh +++ b/examples/agent-driven-policy-management/demo.sh @@ -21,8 +21,8 @@ SANDBOX_AGENT="${SCRIPT_DIR}/sandbox-agent.sh" OPENSHELL_BIN="${OPENSHELL_BIN:-}" if [[ -z "$OPENSHELL_BIN" ]]; then - if [[ -x "${REPO_ROOT}/target/debug/openshell" ]]; then - OPENSHELL_BIN="${REPO_ROOT}/target/debug/openshell" + if [[ -x "${REPO_ROOT}/target/debug/os" ]]; then + OPENSHELL_BIN="${REPO_ROOT}/target/debug/os" else OPENSHELL_BIN="openshell" fi @@ -250,7 +250,7 @@ github_api_status() { check_gateway() { local raw version - # `openshell status` colorizes labels with ANSI even when piped, so strip + # `os status` colorizes labels with ANSI even when piped, so strip # escapes before parsing. Use NO_COLOR as a belt-and-suspenders hint for # libraries that respect it. Capture stderr explicitly so a connection # failure (gateway down, port-forward died after a redeploy) surfaces a @@ -267,7 +267,7 @@ bleed into the demo): raw="$(sed 's/\x1b\[[0-9;]*m//g' <<<"$raw")" version="$(awk -F': *' '/Version:/ { print $2; exit }' <<<"$raw")" [[ -n "$version" ]] \ - || fail "active OpenShell gateway is not reachable; start one with: openshell gateway start" + || fail "active OpenShell gateway is not reachable; start one with: os gateway start" info "gateway: connected · ${version}" } diff --git a/examples/agent-driven-policy-management/policy.template.yaml b/examples/agent-driven-policy-management/policy.template.yaml index 01f2d6e3b0..19c13e9dea 100644 --- a/examples/agent-driven-policy-management/policy.template.yaml +++ b/examples/agent-driven-policy-management/policy.template.yaml @@ -64,7 +64,7 @@ network_policies: # un-credentialed (no provider declares this host), so the prover # sees no findings and the gateway auto-approves narrow scoped reads # when `proposal_approval_mode = auto` (set via `--approval-mode auto` - # at create or via `openshell settings set` at runtime). + # at create or via `os settings set` at runtime). name: github-raw-scoped endpoints: - host: raw.githubusercontent.com diff --git a/examples/aws-s3-sts.md b/examples/aws-s3-sts.md index 76bace9f3d..f47560b6d3 100644 --- a/examples/aws-s3-sts.md +++ b/examples/aws-s3-sts.md @@ -132,10 +132,10 @@ export OPENSHELL_BASE_URL=http://localhost:18080 # Create the provider with the aws-s3 profile. All three credentials are # gateway-minted via STS, so no static credential is needed. -openshell provider create --name s3-test --type aws-s3 --runtime-credentials +os provider create --name s3-test --type aws-s3 --runtime-credentials # Configure STS refresh -openshell provider refresh configure s3-test \ +os provider refresh configure s3-test \ --credential-key AWS_ACCESS_KEY_ID \ --strategy aws-sts-assume-role \ --material role_arn="arn:aws:iam::${ACCOUNT}:role/openshell-sts-test-role" \ @@ -143,11 +143,11 @@ openshell provider refresh configure s3-test \ --material aws_region="us-east-1" # Mint the first set of credentials -openshell provider refresh rotate s3-test \ +os provider refresh rotate s3-test \ --credential-key AWS_ACCESS_KEY_ID # Verify -openshell provider refresh status s3-test +os provider refresh status s3-test ``` The status should show `refreshed` with an expiry ~1 hour from now. @@ -161,9 +161,9 @@ egress. Attach the built-in `pypi` profile so `pip` can reach PyPI (or bake boto3 into a custom sandbox image): ```shell -openshell provider create --name pypi --type pypi --runtime-credentials +os provider create --name pypi --type pypi --runtime-credentials -openshell sandbox create --name s3-smoke \ +os sandbox create --name s3-smoke \ --provider s3-test \ --provider pypi \ -- bash -c ' @@ -203,7 +203,7 @@ All three operations should succeed. The download should print ### Using curl ```shell -openshell sandbox create --name s3-curl \ +os sandbox create --name s3-curl \ --provider s3-test \ -- bash -c ' BUCKET="'"${BUCKET}"'" @@ -255,9 +255,9 @@ in the environment. ```shell # Delete the sandboxes and the pypi provider -openshell sandbox delete s3-smoke -openshell sandbox delete s3-curl -openshell provider delete pypi +os sandbox delete s3-smoke +os sandbox delete s3-curl +os provider delete pypi # Delete AWS resources aws s3 rb "s3://${BUCKET}" --force @@ -272,5 +272,5 @@ aws iam delete-role --role-name openshell-sts-test-role | `STS AssumeRole failed: dispatch failure` | Gateway doesn't have AWS credentials | Export credentials before starting: `eval "$(aws configure export-credentials --format env)"` | | `Policy discovery sync failed: invalid wire type` | Supervisor image doesn't have updated proto | Rebuild: `CONTAINER_ENGINE=podman IMAGE_TAG=dev mise run build:docker:supervisor` | | `CONNECT ... not permitted by policy` | Binary not in profile's `binaries` list | Use curl (in the list) or add your binary path to the policy | -| `403 AccessDenied` from S3 | IAM role missing permissions, or STS creds expired | Check `openshell provider refresh status`; re-rotate if expired | +| `403 AccessDenied` from S3 | IAM role missing permissions, or STS creds expired | Check `os provider refresh status`; re-rotate if expired | | Supervisor uses wrong image | `mise run gateway` places `supervisor_image` in wrong TOML section | Use the hand-written config from step 3 instead of `mise run gateway` | diff --git a/examples/bring-your-own-container/Dockerfile b/examples/bring-your-own-container/Dockerfile index 60d6ed5fc8..a193950034 100644 --- a/examples/bring-your-own-container/Dockerfile +++ b/examples/bring-your-own-container/Dockerfile @@ -27,5 +27,5 @@ EXPOSE 8080 USER app # NOTE: The sandbox supervisor replaces CMD at runtime. Pass the start -# command explicitly: openshell sandbox create ... -- python /sandbox/app.py +# command explicitly: os sandbox create ... -- python /sandbox/app.py CMD ["python", "app.py"] diff --git a/examples/bring-your-own-container/README.md b/examples/bring-your-own-container/README.md index 88b3a0c65b..08be64a773 100644 --- a/examples/bring-your-own-container/README.md +++ b/examples/bring-your-own-container/README.md @@ -23,14 +23,14 @@ your local machine through port forwarding. ```bash # Docker gateway docker build -t openshell-byoc:latest examples/bring-your-own-container -openshell sandbox create \ +os sandbox create \ --from openshell-byoc:latest \ --forward 8080 \ -- python /sandbox/app.py # Podman gateway podman build -t localhost/openshell-byoc:latest examples/bring-your-own-container -openshell sandbox create \ +os sandbox create \ --from localhost/openshell-byoc:latest \ --forward 8080 \ -- python /sandbox/app.py @@ -98,5 +98,5 @@ bridges the tunnel to `127.0.0.1:` inside the container. Delete the sandbox when you're done (this also stops port forwards): ```bash -openshell sandbox delete +os sandbox delete ``` diff --git a/examples/codex-app-server/README.md b/examples/codex-app-server/README.md index 706d94870f..8280e216c0 100644 --- a/examples/codex-app-server/README.md +++ b/examples/codex-app-server/README.md @@ -35,11 +35,11 @@ The gateway starts with an empty provider-profile catalog. Validate and import the profile included with this example before creating the provider: ```shell -openshell provider profile lint --file codex.yaml +os provider profile lint --file codex.yaml ``` ```shell -openshell provider profile import --file codex.yaml +os provider profile import --file codex.yaml ``` ## 3. Create the provider @@ -50,7 +50,7 @@ sandbox receives opaque handles for only the access token and account ID; it never receives the refresh token. Run these commands once per workspace. ```shell -openshell provider create \ +os provider create \ --name codex \ --type codex \ --credential "CODEX_AUTH_ACCESS_TOKEN=$(jq -er '.tokens.access_token' "$HOME/.codex/auth.json")" \ @@ -59,7 +59,7 @@ openshell provider create \ ```shell env "CODEX_AUTH_REFRESH_TOKEN=$(jq -er '.tokens.refresh_token' "$HOME/.codex/auth.json")" \ - openshell provider refresh configure codex \ + os provider refresh configure codex \ --credential-key CODEX_AUTH_ACCESS_TOKEN \ --strategy oauth2-refresh-token \ --material client_id=app_EMoamEEZ73f0CkXaXp7hrann \ @@ -67,14 +67,14 @@ env "CODEX_AUTH_REFRESH_TOKEN=$(jq -er '.tokens.refresh_token' "$HOME/.codex/aut ``` ```shell -openshell provider refresh rotate codex \ +os provider refresh rotate codex \ --credential-key CODEX_AUTH_ACCESS_TOKEN ``` ## 4. Launch the sandbox ```shell -openshell sandbox create \ +os sandbox create \ --name codex-app-server \ --from openshell/codex-app-server:local \ --expose 4500 \ @@ -105,8 +105,8 @@ codex --remote ws://default--codex-app-server.openshell.localhost: ## Clean up ```shell -openshell sandbox delete codex-app-server -openshell provider delete codex -openshell provider profile delete codex +os sandbox delete codex-app-server +os provider delete codex +os provider profile delete codex docker image rm openshell/codex-app-server:local ``` diff --git a/examples/gateway-deploy-connect.md b/examples/gateway-deploy-connect.md index 2ad4f29303..8e3cdd637d 100644 --- a/examples/gateway-deploy-connect.md +++ b/examples/gateway-deploy-connect.md @@ -24,7 +24,7 @@ For local evaluation, forward the service and register the forwarded endpoint: ```bash kubectl -n openshell port-forward svc/openshell 8080:8080 -openshell gateway add http://127.0.0.1:8080 --local --name local +os gateway add http://127.0.0.1:8080 --local --name local ``` Production deployments should keep TLS enabled or place the gateway behind a trusted TLS-terminating ingress, load balancer, or access proxy. @@ -34,13 +34,13 @@ Production deployments should keep TLS enabled or place the gateway behind a tru Register a gateway that is already running: ```bash -openshell gateway add https://gateway.example.com --name production +os gateway add https://gateway.example.com --name production ``` Verify the gateway: ```bash -openshell status +os status ``` Expected output: @@ -54,14 +54,14 @@ Version: ## Create a Sandbox ```bash -openshell sandbox create --name hello -- echo "it works" -openshell sandbox connect hello +os sandbox create --name hello -- echo "it works" +os sandbox connect hello ``` Clean up the sandbox when finished: ```bash -openshell sandbox delete hello +os sandbox delete hello ``` ## Edge-Authenticated Gateway @@ -69,7 +69,7 @@ openshell sandbox delete hello For gateways running behind a reverse proxy that handles authentication, such as Cloudflare Access, register the endpoint and authenticate via browser: ```bash -openshell gateway add https://gateway.example.com +os gateway add https://gateway.example.com ``` This opens your browser for the proxy's login flow. After authentication, the CLI stores a bearer token and sets the gateway as active. @@ -77,7 +77,7 @@ This opens your browser for the proxy's login flow. After authentication, the CL To re-authenticate after token expiry: ```bash -openshell gateway login +os gateway login ``` ### How Edge-Authenticated Connections Differ @@ -97,19 +97,19 @@ This is transparent to the user. CLI commands work the same regardless of whethe List all registered gateways: ```bash -openshell gateway select +os gateway select ``` Switch the active gateway: ```bash -openshell gateway select production +os gateway select production ``` Override the active gateway for a single command: ```bash -openshell status -g production +os status -g production ``` ## Troubleshooting @@ -117,8 +117,8 @@ openshell status -g production Check gateway registration details: ```bash -openshell gateway info -openshell status +os gateway info +os status ``` For Helm deployments, inspect the release and gateway workload: diff --git a/examples/governance-interceptor/smoke.sh b/examples/governance-interceptor/smoke.sh index d91aed79b0..c5ee7c17b8 100755 --- a/examples/governance-interceptor/smoke.sh +++ b/examples/governance-interceptor/smoke.sh @@ -429,7 +429,7 @@ configure_gateway() { CLI=( env -u OPENSHELL_SANDBOX_POLICY - "$ROOT/target/debug/openshell" + "$ROOT/target/debug/os" --gateway-endpoint "$GATEWAY_ENDPOINT" ) @@ -637,7 +637,7 @@ Gateway log: $GATEWAY_LOG Interceptor log: $INTERCEPTOR_LOG Example CLI: - env -u OPENSHELL_SANDBOX_POLICY "$ROOT/target/debug/openshell" --gateway-endpoint "$GATEWAY_ENDPOINT" sandbox list + env -u OPENSHELL_SANDBOX_POLICY "$ROOT/target/debug/os" --gateway-endpoint "$GATEWAY_ENDPOINT" sandbox list Press Ctrl-C to stop the gateway and interceptor. EOF @@ -661,7 +661,7 @@ cd "$ROOT" run_setup_step "building gateway" cargo build --quiet -p openshell-gateway --bin openshell-gateway run_setup_step "building governance interceptor" cargo build --quiet --manifest-path "$EXAMPLE_DIR/Cargo.toml" -run_setup_step "building CLI" cargo build --quiet -p openshell-cli --bin openshell +run_setup_step "building CLI" cargo build --quiet -p openshell-cli --bin os generate_gateway_jwt_bundle cp "$EXAMPLE_DIR/policy.yaml" "$POLICY_FILE" diff --git a/examples/isolation-backend-v8/README.md b/examples/isolation-backend-v8/README.md index cf85980733..eadc863771 100644 --- a/examples/isolation-backend-v8/README.md +++ b/examples/isolation-backend-v8/README.md @@ -57,7 +57,7 @@ In another terminal, from this example directory: ```shell export OPENSHELL_GATEWAY_ENDPOINT=http://127.0.0.1:18770 -openshell sandbox create --name js-demo \ +os sandbox create --name js-demo \ --keep --no-tty --no-auto-providers -- /work/guest.js ``` @@ -73,14 +73,14 @@ print an error and return exit code 1. `--keep` retains the sandbox so you can inspect that result after the command. Add `--detach` to run without attaching; detached creation does not stream guest -output. Use `openshell sandbox connect js-demo` to attach afterward. +output. Use `os sandbox connect js-demo` to attach afterward. ## Inspect and stop ```shell -openshell sandbox list -openshell logs js-demo -openshell sandbox delete js-demo +os sandbox list +os logs js-demo +os sandbox delete js-demo ``` Wait for deletion, then press Ctrl-C in the script's terminal to stop all three diff --git a/examples/jupyter-sandbox/README.md b/examples/jupyter-sandbox/README.md index 153e636fa0..8efea3f65f 100644 --- a/examples/jupyter-sandbox/README.md +++ b/examples/jupyter-sandbox/README.md @@ -22,7 +22,7 @@ kernel, so no container build is needed. ```shell JUPYTER_TOKEN="$(openssl rand -hex 32)" -openshell sandbox create \ +os sandbox create \ --name jupyter-demo \ --from quay.io/jupyter/base-notebook:2026-09-29 \ --policy policy.yaml \ @@ -60,5 +60,5 @@ URL as a flag and authenticates its REST and WebSocket connections. When finished, delete the sandbox and its service: ```shell -openshell sandbox delete jupyter-demo +os sandbox delete jupyter-demo ``` diff --git a/examples/kilo-provider/README.md b/examples/kilo-provider/README.md index d1feffa810..1a47427add 100644 --- a/examples/kilo-provider/README.md +++ b/examples/kilo-provider/README.md @@ -26,11 +26,11 @@ cd examples/kilo-provider Lint the profile, then import it at platform scope: ```shell -openshell provider profile lint -f kilo.yaml +os provider profile lint -f kilo.yaml ``` ```shell -openshell provider profile import -f kilo.yaml --global +os provider profile import -f kilo.yaml --global ``` Without `--global`, the import goes into the current workspace. @@ -40,13 +40,13 @@ Without `--global`, the import goes into the current workspace. Create a provider named `kilo` from the `KILO_API_KEY` variable in your shell: ```shell -openshell provider create --name kilo --type kilo --from-existing +os provider create --name kilo --type kilo --from-existing ``` ## 3. Run the smoke test ```shell -openshell sandbox create --provider kilo \ +os sandbox create --provider kilo \ --from ghcr.io/kilo-org/kilocode:latest-openshell -- \ kilo run --model kilo/nvidia/nemotron-3.5-lightning:free 'reply with OK' ``` @@ -105,8 +105,8 @@ OpenShell still confines Kilo and every tool it runs. The image's environment reaches the sandbox's main command only, so start Kilo as that command, as the smoke test does. A process started with -`openshell sandbox exec` does not get those variables. To reach every process, -pass them with `--env` on `openshell sandbox create`. +`os sandbox exec` does not get those variables. To reach every process, +pass them with `--env` on `os sandbox create`. ### Other images diff --git a/examples/local-inference/README.md b/examples/local-inference/README.md index 7cc36513ed..f5a43c28d7 100644 --- a/examples/local-inference/README.md +++ b/examples/local-inference/README.md @@ -19,22 +19,22 @@ Export the built-in profile as a starting point and compare it with the example before import. A custom profile must use a new ID; built-in IDs are reserved. ```shell -openshell provider profile export nvidia -o yaml > /tmp/nvidia-profile.yaml +os provider profile export nvidia -o yaml > /tmp/nvidia-profile.yaml diff -u /tmp/nvidia-profile.yaml examples/local-inference/nvidia-inference.yaml -openshell provider profile lint -f examples/local-inference/nvidia-inference.yaml -openshell provider profile import -f examples/local-inference/nvidia-inference.yaml +os provider profile lint -f examples/local-inference/nvidia-inference.yaml +os provider profile import -f examples/local-inference/nvidia-inference.yaml ``` Create the provider from the local `NVIDIA_API_KEY`, then attach it to the new sandbox: ```shell -openshell provider create \ +os provider create \ --name nvidia-demo \ --type nvidia-inference \ --from-existing -openshell sandbox create \ +os sandbox create \ --name inference-demo \ --provider nvidia-demo \ --policy examples/local-inference/sandbox-policy.yaml \ @@ -48,7 +48,7 @@ key only for requests that match the profile endpoint. Inspect the composed policy with: ```shell -openshell policy get inference-demo --full +os policy get inference-demo --full ``` To change the endpoint or allowed client binaries, export the custom profile, @@ -56,14 +56,14 @@ edit it, and submit its `resource_version` with `profile update`. The workload still needs a native client configuration that matches the profile. ```shell -openshell provider profile export nvidia-inference -o yaml > nvidia-inference.yaml +os provider profile export nvidia-inference -o yaml > nvidia-inference.yaml # Edit nvidia-inference.yaml. -openshell provider profile lint -f nvidia-inference.yaml -openshell provider profile update nvidia-inference -f nvidia-inference.yaml +os provider profile lint -f nvidia-inference.yaml +os provider profile update nvidia-inference -f nvidia-inference.yaml ``` Delete the sandbox when finished: ```shell -openshell sandbox delete inference-demo +os sandbox delete inference-demo ``` diff --git a/examples/local-inference/inference.py b/examples/local-inference/inference.py index b0e2035be6..1b62a90b7f 100644 --- a/examples/local-inference/inference.py +++ b/examples/local-inference/inference.py @@ -8,7 +8,7 @@ the native endpoint, model, request shape, and timeout. Usage: - openshell sandbox create --provider nvidia-demo --policy sandbox-policy.yaml \ + os sandbox create --provider nvidia-demo --policy sandbox-policy.yaml \ --upload inference.py -- python3 /sandbox/inference.py """ diff --git a/examples/policy-advisor/README.md b/examples/policy-advisor/README.md index bc9ac6fd7d..1a67019922 100644 --- a/examples/policy-advisor/README.md +++ b/examples/policy-advisor/README.md @@ -77,7 +77,7 @@ In your **first terminal**, launch the interactive TUI so you can watch denials arrive and approve recommendations: ```bash -openshell term +os term ``` ### 2. Create the sandbox and run the CTF @@ -86,7 +86,7 @@ In your **second terminal**, create the sandbox with the restrictive policy, upload the script, and run it -- all in one command: ```bash -openshell sandbox create \ +os sandbox create \ --name advisor-ctf \ --policy examples/policy-advisor/sandbox-policy.yaml \ --upload examples/policy-advisor/ctf.py \ @@ -140,9 +140,9 @@ Once all 7 gates are unlocked the script prints a victory banner. TUI: ```bash - openshell rule get advisor-ctf # list pending - openshell rule approve advisor-ctf --chunk-id ID # approve one - openshell rule approve-all advisor-ctf # approve all + os rule get advisor-ctf # list pending + os rule approve advisor-ctf --chunk-id ID # approve one + os rule approve-all advisor-ctf # approve all ``` - **Gate 3 shows per-binary tracking** -- curl hits its own endpoint, producing @@ -154,5 +154,5 @@ Once all 7 gates are unlocked the script prints a victory banner. ## Cleanup ```bash -openshell sandbox delete advisor-ctf +os sandbox delete advisor-ctf ``` diff --git a/examples/policy-advisor/ctf.py b/examples/policy-advisor/ctf.py index 5974268fa3..99167e425a 100644 --- a/examples/policy-advisor/ctf.py +++ b/examples/policy-advisor/ctf.py @@ -490,7 +490,7 @@ def run_ctf() -> int: log("INFO", f"Retry interval: {RETRY_INTERVAL}s between attempts") log( "INFO", - "Tip: open the TUI now if you haven't -> openshell term", + "Tip: open the TUI now if you haven't -> os term", ) print() diff --git a/examples/private-ip-routing/README.md b/examples/private-ip-routing/README.md index 148871c2ef..0792f2a043 100644 --- a/examples/private-ip-routing/README.md +++ b/examples/private-ip-routing/README.md @@ -62,7 +62,7 @@ Create a sandbox and curl the private API through the proxy. Replace the IP with whatever `kubectl get pod` showed above: ```bash -openshell sandbox create \ +os sandbox create \ --from registry.example.com/tools/curl:latest \ --policy ./private-policy.yaml \ -- bash -c \ diff --git a/examples/sandbox-policy-quickstart/README.md b/examples/sandbox-policy-quickstart/README.md index 35ad206ec4..c00a8d61c2 100644 --- a/examples/sandbox-policy-quickstart/README.md +++ b/examples/sandbox-policy-quickstart/README.md @@ -22,7 +22,7 @@ while writes are blocked — all without restarting anything. ### 1. Create a sandbox ```bash -openshell sandbox create --name demo --no-auto-providers +os sandbox create --name demo --no-auto-providers ``` `--no-auto-providers` skips the provider setup prompt since this @@ -58,7 +58,7 @@ exit ### 3. Check the deny log ```bash -openshell logs demo --since 5m --source sandbox +os logs demo --since 5m --source sandbox ``` You'll see a line like: @@ -73,7 +73,7 @@ attempted it, and the reason. Nothing gets out silently. ### 4. Add a read-only GitHub API rule ```bash -openshell policy update demo \ +os policy update demo \ --rule-name github_api \ --binary /usr/bin/curl \ --add-endpoint api.github.com:443:read-only:rest:enforce \ @@ -109,15 +109,15 @@ revision. No restart required — network rules reload while the sandbox runs. [`policy.yaml`](policy.yaml) contains the same rule in a complete policy. Use it to start a new sandbox with the rule in place: -`openshell sandbox create --name demo --policy examples/sandbox-policy-quickstart/policy.yaml`. -Do not apply it to a running sandbox with `openshell policy set`, which +`os sandbox create --name demo --policy examples/sandbox-policy-quickstart/policy.yaml`. +Do not apply it to a running sandbox with `os policy set`, which replaces the entire policy and is rejected if the file drops a filesystem path the sandbox already has. ### 5. Connect and verify: GET works ```bash -openshell sandbox connect demo +os sandbox connect demo ``` ```bash @@ -188,7 +188,7 @@ exit ### 7. Check the L7 deny log ```bash -openshell logs demo --since 5m --source sandbox +os logs demo --since 5m --source sandbox ``` ```text @@ -203,7 +203,7 @@ your SIEM for a complete audit trail of every request your agent makes. ### 8. Clean up ```bash -openshell sandbox delete demo +os sandbox delete demo ``` ## What you just saw diff --git a/examples/sandbox-policy-quickstart/demo.sh b/examples/sandbox-policy-quickstart/demo.sh index 8cc8b2145a..e9c0baab20 100755 --- a/examples/sandbox-policy-quickstart/demo.sh +++ b/examples/sandbox-policy-quickstart/demo.sh @@ -24,7 +24,7 @@ cleanup() { rm -f "$SSH_CONFIG" printf '\n' step "Cleaning up" - openshell sandbox delete "$SANDBOX_NAME" 2>/dev/null || true + os sandbox delete "$SANDBOX_NAME" 2>/dev/null || true } trap cleanup EXIT @@ -50,7 +50,7 @@ run() { return "${PIPESTATUS[0]}" } -# Keep only OCSF network and HTTP policy decisions from `openshell logs`. +# Keep only OCSF network and HTTP policy decisions from `os logs`. policy_events() { grep -E '(NET|HTTP):[A-Z]+ .*(ALLOWED|DENIED)' } @@ -84,14 +84,14 @@ wait_for_ssh() { # ------------------------------------------------------------------ step "1/7 Creating sandbox \"${SANDBOX_NAME}\" (default-deny networking)" -run openshell sandbox create \ +run os sandbox create \ --name "$SANDBOX_NAME" \ --no-auto-providers \ --no-tty \ -- echo "sandbox ready" step "Connecting to sandbox" -openshell sandbox ssh-config "$SANDBOX_NAME" > "$SSH_CONFIG" +os sandbox ssh-config "$SANDBOX_NAME" > "$SSH_CONFIG" SSH_HOST=$(awk '/^Host / { print $2; exit }' "$SSH_CONFIG") wait_for_ssh @@ -109,8 +109,8 @@ printf " ${RED}✗ Blocked by default-deny policy.${RESET}\n" step "3/7 Checking deny log" sleep 2 -printf " ${BOLD}\$ openshell logs ${SANDBOX_NAME} --since 1m --source sandbox -n 10${RESET}\n" -openshell logs "$SANDBOX_NAME" --since 1m --source sandbox -n 10 2>&1 \ +printf " ${BOLD}\$ os logs ${SANDBOX_NAME} --since 1m --source sandbox -n 10${RESET}\n" +os logs "$SANDBOX_NAME" --since 1m --source sandbox -n 10 2>&1 \ | policy_events \ | colorize_logs \ | sed 's/^/ /' @@ -118,7 +118,7 @@ openshell logs "$SANDBOX_NAME" --since 1m --source sandbox -n 10 2>&1 \ # ------------------------------------------------------------------ step "4/7 Adding a read-only GitHub API rule" -run openshell policy update "$SANDBOX_NAME" \ +run os policy update "$SANDBOX_NAME" \ --rule-name github_api \ --binary /usr/bin/curl \ --add-endpoint api.github.com:443:read-only:rest:enforce \ @@ -151,8 +151,8 @@ printf " ${YELLOW}%s${RESET}\n" "$RESPONSE" step "7/7 Checking L7 deny log" sleep 2 # Policy events are INFO-level OCSF records, so a --level warn filter hides them. -printf " ${BOLD}\$ openshell logs ${SANDBOX_NAME} --since 1m --source sandbox -n 10${RESET}\n" -openshell logs "$SANDBOX_NAME" --since 1m --source sandbox -n 10 2>&1 \ +printf " ${BOLD}\$ os logs ${SANDBOX_NAME} --since 1m --source sandbox -n 10${RESET}\n" +os logs "$SANDBOX_NAME" --since 1m --source sandbox -n 10 2>&1 \ | policy_events \ | colorize_logs \ | sed 's/^/ /' diff --git a/examples/sandbox-policy-quickstart/policy.yaml b/examples/sandbox-policy-quickstart/policy.yaml index c332d9d8cd..43e6022008 100644 --- a/examples/sandbox-policy-quickstart/policy.yaml +++ b/examples/sandbox-policy-quickstart/policy.yaml @@ -5,9 +5,9 @@ # POST, PUT, PATCH, and DELETE are blocked by the "read-only" preset. # # This is a complete policy for starting a new sandbox: -# openshell sandbox create --name demo --policy policy.yaml -# To add the same rule to a running sandbox, use `openshell policy update` as -# shown in README.md. `openshell policy set` replaces the entire policy and is +# os sandbox create --name demo --policy policy.yaml +# To add the same rule to a running sandbox, use `os policy update` as +# shown in README.md. `os policy set` replaces the entire policy and is # rejected if the file drops a filesystem path the running sandbox already has. version: 1 diff --git a/examples/spiffe-token-exchange-demo/README.md b/examples/spiffe-token-exchange-demo/README.md index 12294fd80d..f5d0c81b64 100644 --- a/examples/spiffe-token-exchange-demo/README.md +++ b/examples/spiffe-token-exchange-demo/README.md @@ -128,27 +128,27 @@ Then run: ```bash export GATEWAY=https://127.0.0.1:8097 -openshell --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" profile import \ +os --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" profile import \ -f "$OPENSHELL_REPO/examples/spiffe-token-exchange-demo/provider-profile.yaml" -openshell --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" provider create \ +os --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" provider create \ --name spiffe-token-exchange-demo \ --type spiffe-token-exchange-demo \ --credential "subject_token=${SUBJECT_TOKEN}" -openshell --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox create \ +os --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox create \ --name spiffe-token-exchange-demo \ --provider spiffe-token-exchange-demo \ --keep \ --no-tty \ -- echo "sandbox ready" -openshell --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox exec \ +os --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox exec \ --name spiffe-token-exchange-demo \ --no-tty \ -- curl -sS http://alpha-exchange.default.svc.cluster.local/ -openshell --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox exec \ +os --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox exec \ --name spiffe-token-exchange-demo \ --no-tty \ -- curl -sS http://beta-exchange.default.svc.cluster.local/ @@ -218,7 +218,7 @@ usage. Delete the sandbox through OpenShell: ```bash -openshell --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox delete spiffe-token-exchange-demo +os --gateway "$OPENSHELL_GATEWAY" --gateway-endpoint "$GATEWAY" sandbox delete spiffe-token-exchange-demo ``` Delete the demo workloads with Kubernetes: diff --git a/examples/spiffe-token-exchange-demo/demo.sh b/examples/spiffe-token-exchange-demo/demo.sh index 651688cb48..e61fa93be4 100755 --- a/examples/spiffe-token-exchange-demo/demo.sh +++ b/examples/spiffe-token-exchange-demo/demo.sh @@ -56,7 +56,7 @@ TOKEN_PF_PID="" dump_diagnostics() { set +e - printf "\n=== diagnostics: openshell sandbox logs ===\n" >&2 + printf "\n=== diagnostics: os sandbox logs ===\n" >&2 "${OS[@]}" logs "$SANDBOX_NAME" -n 120 --source sandbox >&2 printf "\n=== diagnostics: gateway logs ===\n" >&2 @@ -81,7 +81,7 @@ dump_diagnostics() { cleanup() { if [[ "$KEEP_SANDBOX" != "1" ]]; then - openshell --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT" sandbox delete "$SANDBOX_NAME" >/dev/null 2>&1 || true + os --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT" sandbox delete "$SANDBOX_NAME" >/dev/null 2>&1 || true fi if [[ -n "$PF_PID" ]]; then kill "$PF_PID" >/dev/null 2>&1 || true @@ -155,7 +155,7 @@ sandbox_curl_until() { local output="" for attempt in $(seq 1 12); do - printf "\n$ openshell sandbox exec %s curl (attempt %s)\n" "$label" "$attempt" + printf "\n$ os sandbox exec %s curl (attempt %s)\n" "$label" "$attempt" if output=$("${OS[@]}" sandbox exec --name "$SANDBOX_NAME" --no-tty -- curl -sS --max-time 10 "$url" 2>&1); then printf "%s\n" "$output" if [[ "$output" == *"$expected"* ]]; then @@ -173,7 +173,7 @@ sandbox_curl_until() { exit 1 } -OS=(openshell --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT") +OS=(os --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT") printf "Using OpenShell gateway '%s' at %s\n" "$GATEWAY_NAME" "$GATEWAY_ENDPOINT" diff --git a/examples/spiffe-token-exchange-demo/podman/README.md b/examples/spiffe-token-exchange-demo/podman/README.md index cbc470410c..3f5da4939f 100644 --- a/examples/spiffe-token-exchange-demo/podman/README.md +++ b/examples/spiffe-token-exchange-demo/podman/README.md @@ -214,11 +214,11 @@ GATEWAY_OIDC_LOGIN_SCOPES="openid profile email" \ bash "$OPENSHELL_REPO/examples/spiffe-token-exchange-demo/podman/start-gateway.sh" ``` -The script prints the matching `openshell gateway add ... --oidc-issuer ...` +The script prints the matching `os gateway add ... --oidc-issuer ...` command after the gateway is ready. You can also run it directly: ```shell -openshell gateway add http://127.0.0.1:8888 \ +os gateway add http://127.0.0.1:8888 \ --name podman-spiffe-demo \ --oidc-issuer https://idp.example.com/realms/openshell \ --oidc-client-id openshell-cli \ @@ -303,7 +303,7 @@ The script deletes demo containers and the sandbox on exit unless you set Manual cleanup: ```shell -openshell --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT" \ +os --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT" \ sandbox delete spiffe-podman-demo podman rm -f \ diff --git a/examples/spiffe-token-exchange-demo/podman/demo.sh b/examples/spiffe-token-exchange-demo/podman/demo.sh index e9492949f9..395c24696c 100755 --- a/examples/spiffe-token-exchange-demo/podman/demo.sh +++ b/examples/spiffe-token-exchange-demo/podman/demo.sh @@ -88,7 +88,7 @@ default_gateway_name() { } GATEWAY_NAME="$(default_gateway_name)" -OS=(openshell --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT") +OS=(os --gateway "$GATEWAY_NAME" --gateway-endpoint "$GATEWAY_ENDPOINT") run() { printf "\n$ %s\n" "$*" @@ -261,7 +261,7 @@ cleanup_container() { dump_diagnostics() { set +e - printf "\n=== diagnostics: openshell sandbox logs ===\n" >&2 + printf "\n=== diagnostics: os sandbox logs ===\n" >&2 "${OS[@]}" logs "$SANDBOX_NAME" -n 120 --source sandbox >&2 printf "\n=== diagnostics: podman containers ===\n" >&2 @@ -561,7 +561,7 @@ sandbox_curl_until() { local output="" for attempt in $(seq 1 18); do - printf "\n$ openshell sandbox exec %s curl (attempt %s)\n" "$label" "$attempt" + printf "\n$ os sandbox exec %s curl (attempt %s)\n" "$label" "$attempt" if output=$("${OS[@]}" sandbox exec --name "$SANDBOX_NAME" --no-tty -- curl -sS --max-time 10 "$url" 2>&1); then printf "%s\n" "$output" if [[ "$output" == *"$expected"* ]]; then @@ -649,7 +649,7 @@ run "${OS[@]}" sandbox create --name "$SANDBOX_NAME" --provider "$PROVIDER_NAME" SANDBOX_ID="$(sandbox_id)" if [[ -z "$SANDBOX_ID" ]]; then - printf "could not determine sandbox ID from openshell sandbox get\n" >&2 + printf "could not determine sandbox ID from os sandbox get\n" >&2 exit 1 fi printf "\nSandbox ID: %s\n" "$SANDBOX_ID" diff --git a/examples/spiffe-token-exchange-demo/podman/start-gateway.sh b/examples/spiffe-token-exchange-demo/podman/start-gateway.sh index d2be7cff15..de26e44521 100755 --- a/examples/spiffe-token-exchange-demo/podman/start-gateway.sh +++ b/examples/spiffe-token-exchange-demo/podman/start-gateway.sh @@ -222,7 +222,7 @@ printf "SPIRE agent Workload API socket: %s\n" "$SPIRE_AGENT_SOCKET_HOST_PATH" if [[ -n "$GATEWAY_OIDC_ISSUER" ]]; then printf "OpenShell gateway OIDC issuer: %s\n" "$GATEWAY_OIDC_ISSUER" printf "Register/login with:\n" - printf " openshell gateway add http://127.0.0.1:%s --name %s --oidc-issuer %s --oidc-client-id %s --oidc-audience %s" \ + printf " os gateway add http://127.0.0.1:%s --name %s --oidc-issuer %s --oidc-client-id %s --oidc-audience %s" \ "$GATEWAY_PORT" "$GATEWAY_ID" "$GATEWAY_OIDC_ISSUER" "$GATEWAY_OIDC_CLIENT_ID" "$GATEWAY_OIDC_AUDIENCE" if [[ -n "$GATEWAY_OIDC_LOGIN_SCOPES" ]]; then printf " --oidc-scopes %s" "$GATEWAY_OIDC_LOGIN_SCOPES" diff --git a/examples/spiffe-token-grant-demo/README.md b/examples/spiffe-token-grant-demo/README.md index 4e10a1f67a..6871f7dcf8 100644 --- a/examples/spiffe-token-grant-demo/README.md +++ b/examples/spiffe-token-grant-demo/README.md @@ -59,26 +59,26 @@ Then run: export XDG_CONFIG_HOME="$(mktemp -d)" export GATEWAY=http://127.0.0.1:8097 -openshell --gateway-endpoint "$GATEWAY" profile import \ +os --gateway-endpoint "$GATEWAY" profile import \ -f examples/spiffe-token-grant-demo/provider-profile.yaml -openshell --gateway-endpoint "$GATEWAY" provider create \ +os --gateway-endpoint "$GATEWAY" provider create \ --name spiffe-token-demo \ --type spiffe-token-demo \ --runtime-credentials -openshell --gateway-endpoint "$GATEWAY" sandbox create \ +os --gateway-endpoint "$GATEWAY" sandbox create \ --name spiffe-token-demo \ --provider spiffe-token-demo \ --no-tty \ -- echo "sandbox ready" -openshell --gateway-endpoint "$GATEWAY" sandbox exec \ +os --gateway-endpoint "$GATEWAY" sandbox exec \ --name spiffe-token-demo \ --no-tty \ -- curl -sS http://alpha.default.svc.cluster.local/ -openshell --gateway-endpoint "$GATEWAY" sandbox exec \ +os --gateway-endpoint "$GATEWAY" sandbox exec \ --name spiffe-token-demo \ --no-tty \ -- curl -sS http://beta.default.svc.cluster.local/ @@ -128,7 +128,7 @@ KUBECONFIG=kubeconfig bash examples/spiffe-token-grant-demo/demo.sh Delete the sandbox through OpenShell: ```bash -openshell --gateway-endpoint "$GATEWAY" sandbox delete spiffe-token-demo +os --gateway-endpoint "$GATEWAY" sandbox delete spiffe-token-demo ``` Delete the demo workloads with Kubernetes: diff --git a/examples/spiffe-token-grant-demo/demo.sh b/examples/spiffe-token-grant-demo/demo.sh index 29df965fee..ccde4a6d7f 100755 --- a/examples/spiffe-token-grant-demo/demo.sh +++ b/examples/spiffe-token-grant-demo/demo.sh @@ -27,7 +27,7 @@ PF_PID="" cleanup() { if [[ "$KEEP_SANDBOX" != "1" ]]; then - openshell --gateway-endpoint "$GATEWAY_ENDPOINT" sandbox delete "$SANDBOX_NAME" >/dev/null 2>&1 || true + os --gateway-endpoint "$GATEWAY_ENDPOINT" sandbox delete "$SANDBOX_NAME" >/dev/null 2>&1 || true fi if [[ -n "$PF_PID" ]]; then kill "$PF_PID" >/dev/null 2>&1 || true @@ -71,7 +71,7 @@ sandbox_curl_until() { local output="" for attempt in $(seq 1 12); do - printf "\n$ openshell sandbox exec %s curl (attempt %s)\n" "$label" "$attempt" + printf "\n$ os sandbox exec %s curl (attempt %s)\n" "$label" "$attempt" if output=$("${OS[@]}" sandbox exec --name "$SANDBOX_NAME" --no-tty -- curl -sS --max-time 10 "$url" 2>&1); then printf "%s\n" "$output" if [[ "$output" == *"$expected"* ]]; then @@ -89,7 +89,7 @@ sandbox_curl_until() { exit 1 } -OS=(openshell --gateway-endpoint "$GATEWAY_ENDPOINT") +OS=(os --gateway-endpoint "$GATEWAY_ENDPOINT") printf "\n$ kubectl -n default create secret generic openshell-spiffe-token-demo --from-literal=access-token-secret=*** --dry-run=client -o yaml | kubectl apply -f -\n" kubectl -n default create secret generic openshell-spiffe-token-demo \ diff --git a/examples/supervisor-middleware-content-guard/README.md b/examples/supervisor-middleware-content-guard/README.md index dd4ee07de4..ab1fc4503f 100644 --- a/examples/supervisor-middleware-content-guard/README.md +++ b/examples/supervisor-middleware-content-guard/README.md @@ -86,7 +86,7 @@ The `network_middlewares` map key `prototype-content-guard` is the stable policy The included policy allows `curl` to POST to `https://httpbin.org/anything` and `https://httpbingo.org/anything`. Only `httpbin.org` matches the middleware selector, where the content guard replaces `prototype-secret` or `internal-only` in the request body: ```shell -openshell sandbox create --policy examples/supervisor-middleware-content-guard/policy.yaml +os sandbox create --policy examples/supervisor-middleware-content-guard/policy.yaml ``` From the sandbox, send a matching request: diff --git a/examples/supervisor-middleware-content-guard/smoke.sh b/examples/supervisor-middleware-content-guard/smoke.sh index e37c8a5317..99f664ceaa 100755 --- a/examples/supervisor-middleware-content-guard/smoke.sh +++ b/examples/supervisor-middleware-content-guard/smoke.sh @@ -544,7 +544,7 @@ require_command mise ROOT_TARGET_DIR="$(cargo_target_dir "$ROOT/Cargo.toml")" EXAMPLE_TARGET_DIR="$(cargo_target_dir "$EXAMPLE_DIR/Cargo.toml")" GATEWAY_BIN="$ROOT_TARGET_DIR/debug/openshell-gateway" -CLI_BIN="$ROOT_TARGET_DIR/debug/openshell" +CLI_BIN="$ROOT_TARGET_DIR/debug/os" MIDDLEWARE_BIN="$EXAMPLE_TARGET_DIR/debug/supervisor-middleware-content-guard" run_setup_step "building gateway" cargo build --quiet -p openshell-gateway --bin openshell-gateway # Always rebuild from this checkout and load into the selected runtime. Native @@ -556,7 +556,7 @@ run_setup_step "building Linux sandbox supervisor image" \ IMAGE_REGISTRY=localhost/openshell-content-guard IMAGE_TAG="$RUN_ID" \ mise run docker:build:supervisor run_setup_step "building content guard" cargo build --quiet --manifest-path "$EXAMPLE_DIR/Cargo.toml" -run_setup_step "building CLI" cargo build --quiet -p openshell-cli --bin openshell +run_setup_step "building CLI" cargo build --quiet -p openshell-cli --bin os generate_gateway_jwt_bundle start_upstream wait_for_upstream diff --git a/examples/sync-files.md b/examples/sync-files.md index d50e4065ed..4dfc03a0a8 100644 --- a/examples/sync-files.md +++ b/examples/sync-files.md @@ -1,26 +1,26 @@ # Syncing Files To and From a Sandbox Move code, data, and artifacts between your local machine and an OpenShell -sandbox using `openshell sandbox upload` and `openshell sandbox download`. +sandbox using `os sandbox upload` and `os sandbox download`. ## Push local files into a sandbox Upload your current project directory into `/sandbox` on the sandbox: ```bash -openshell sandbox upload my-sandbox . +os sandbox upload my-sandbox . ``` Push a specific directory to a custom destination: ```bash -openshell sandbox upload my-sandbox ./src /sandbox/src +os sandbox upload my-sandbox ./src /sandbox/src ``` Push a single file: ```bash -openshell sandbox upload my-sandbox ./config.yaml /sandbox/config.yaml +os sandbox upload my-sandbox ./config.yaml /sandbox/config.yaml ``` ## Pull files from a sandbox @@ -28,13 +28,13 @@ openshell sandbox upload my-sandbox ./config.yaml /sandbox/config.yaml Download sandbox output to your local machine: ```bash -openshell sandbox download my-sandbox /sandbox/output ./output +os sandbox download my-sandbox /sandbox/output ./output ``` Pull results to the current directory: ```bash -openshell sandbox download my-sandbox /sandbox/results +os sandbox download my-sandbox /sandbox/results ``` ## Sync on create @@ -42,7 +42,7 @@ openshell sandbox download my-sandbox /sandbox/results Push all files in the current directory into a new sandbox automatically: ```bash -openshell sandbox create --upload . -- python main.py +os sandbox create --upload . -- python main.py ``` This uploads the current directory into `/sandbox` before the command runs. @@ -51,17 +51,17 @@ This uploads the current directory into `/sandbox` before the command runs. ```bash # Create a sandbox and upload your repo -openshell sandbox create --name dev --upload . +os sandbox create --name dev --upload . # Make local changes, then push them -openshell sandbox upload dev ./src /sandbox/src +os sandbox upload dev ./src /sandbox/src # Run tests inside the sandbox -openshell sandbox connect dev +os sandbox connect dev # (inside sandbox) pytest # Pull test artifacts back -openshell sandbox download dev /sandbox/coverage ./coverage +os sandbox download dev /sandbox/coverage ./coverage ``` ## How it works diff --git a/examples/transparent-tcp-redis/demo.sh b/examples/transparent-tcp-redis/demo.sh index 0d8b24c523..6edcd1d556 100755 --- a/examples/transparent-tcp-redis/demo.sh +++ b/examples/transparent-tcp-redis/demo.sh @@ -31,7 +31,7 @@ cleanup() { # Give the bounded gateway log stream a moment to receive the final # network decision before fetching it and deleting the sandbox. sleep 1 - if sandbox_logs="$(openshell logs "$SANDBOX_NAME" \ + if sandbox_logs="$(os logs "$SANDBOX_NAME" \ --source sandbox \ --since 10m \ -n 500 2>&1)"; then @@ -47,7 +47,7 @@ cleanup() { printf '\nCleaning up...\n' if [[ "$SANDBOX_CREATED" == "1" ]]; then - openshell sandbox delete "$SANDBOX_NAME" >/dev/null 2>&1 || true + os sandbox delete "$SANDBOX_NAME" >/dev/null 2>&1 || true fi if [[ "$REDIS_CREATED" == "1" ]]; then docker rm --force "$REDIS_CONTAINER" >/dev/null 2>&1 || true @@ -82,7 +82,7 @@ if ! docker network inspect "$DOCKER_NETWORK" >/dev/null 2>&1; then exit 1 fi -if ! openshell sandbox list --page-size 1 >/dev/null 2>&1; then +if ! os sandbox list --page-size 1 >/dev/null 2>&1; then printf 'The configured OpenShell gateway is not reachable.\n' >&2 printf 'Start or select a Docker-backed gateway and try again.\n' >&2 exit 1 @@ -93,7 +93,7 @@ if docker container inspect "$REDIS_CONTAINER" >/dev/null 2>&1; then exit 1 fi -if openshell sandbox get "$SANDBOX_NAME" >/dev/null 2>&1; then +if os sandbox get "$SANDBOX_NAME" >/dev/null 2>&1; then printf 'Sandbox %q already exists; choose SANDBOX_NAME or delete it.\n' "$SANDBOX_NAME" >&2 exit 1 fi @@ -129,7 +129,7 @@ fi printf '\nCreating a Docker-backed sandbox with an explicit TCP endpoint policy...\n' SANDBOX_CREATED=1 -run openshell sandbox create \ +run os sandbox create \ --name "$SANDBOX_NAME" \ --policy "$POLICY_FILE" \ --upload "${CLIENT_FILE}:/sandbox" \ @@ -138,7 +138,7 @@ run openshell sandbox create \ -- echo 'sandbox ready' printf '\nRunning native Redis commands from the sandbox...\n' -run openshell sandbox exec \ +run os sandbox exec \ --name "$SANDBOX_NAME" \ --no-tty \ -- python3 /sandbox/redis_client.py "$REDIS_REAL_IP" "$REDIS_CONTAINER" diff --git a/examples/vscode-remote-sandbox.md b/examples/vscode-remote-sandbox.md index d39581ec2f..d8591d7c84 100644 --- a/examples/vscode-remote-sandbox.md +++ b/examples/vscode-remote-sandbox.md @@ -17,7 +17,7 @@ extension so you get a full IDE experience inside the sandbox environment. ### 1. Create and open the sandbox in VS Code ```bash -openshell sandbox create --editor vscode --name my-sandbox +os sandbox create --editor vscode --name my-sandbox ``` This launches VS Code directly into `/sandbox`, keeps the sandbox alive for the @@ -29,7 +29,7 @@ remote session, and installs an OpenShell-managed SSH include file so your main To reopen an existing sandbox in VS Code: ```bash -openshell sandbox connect my-sandbox --editor vscode +os sandbox connect my-sandbox --editor vscode ``` OpenShell maintains the generated `Host openshell-my-sandbox.default` entry in its own @@ -40,7 +40,7 @@ managed SSH config include file. To inspect the generated SSH stanza, print it with: ```bash -openshell sandbox ssh-config my-sandbox +os sandbox ssh-config my-sandbox ``` ### 4. Open VS Code manually @@ -60,7 +60,7 @@ code --remote ssh-remote+openshell-my-sandbox.default /sandbox When you are done, delete the sandbox: ```bash -openshell sandbox delete my-sandbox +os sandbox delete my-sandbox ``` This also removes any active port forwards. diff --git a/install.sh b/install.sh index 2704887cef..7dc86a60d5 100755 --- a/install.sh +++ b/install.sh @@ -940,7 +940,7 @@ start_user_gateway() { if ! as_target_user systemctl --user daemon-reload; then info "could not reach the user systemd manager for ${TARGET_USER}" info "restart the gateway later with: systemctl --user enable openshell-gateway && systemctl --user restart openshell-gateway" - info "then register it with: openshell gateway add https://127.0.0.1:17670 --local --name openshell" + info "then register it with: os gateway add https://127.0.0.1:17670 --local --name openshell" return 0 fi @@ -1081,18 +1081,27 @@ wait_for_local_gateway_listener() { error "local gateway listener did not become reachable at ${_probe_url} within ${_timeout}s" } +# The CLI is `os`; releases before the rename install only `openshell`. +default_register_bin() { + if has_cmd os; then + printf 'os\n' + else + printf 'openshell\n' + fi +} + wait_for_local_gateway_status() { _timeout="${OPENSHELL_INSTALL_GATEWAY_TIMEOUT:-30}" _elapsed=0 _status_output="" - _register_bin="${OPENSHELL_REGISTER_BIN:-openshell}" + _register_bin="${OPENSHELL_REGISTER_BIN:-$(default_register_bin)}" - info "waiting for openshell status to report connected..." + info "waiting for os status to report connected..." while [ "$_elapsed" -lt "$_timeout" ]; do if _status_output="$(as_target_user env NO_COLOR=1 "$_register_bin" status 2>&1)"; then case "$_status_output" in *"Version:"*) - info "openshell status reports connected" + info "os status reports connected" return 0 ;; esac @@ -1103,7 +1112,7 @@ wait_for_local_gateway_status() { [ -z "$_status_output" ] || printf '%s\n' "$_status_output" >&2 dump_local_gateway_diagnostics - error "openshell status did not report connected within ${_timeout}s" + error "os status did not report connected within ${_timeout}s" } remove_local_gateway_registration_from() { @@ -1140,7 +1149,7 @@ remove_snap_gateway_registration() { } register_local_gateway() { - _register_bin="${OPENSHELL_REGISTER_BIN:-openshell}" + _register_bin="${OPENSHELL_REGISTER_BIN:-$(default_register_bin)}" _endpoint="$(local_gateway_endpoint)" if _add_output="$(as_target_user "$_register_bin" gateway add "$_endpoint" --local --name openshell 2>&1)"; then @@ -1573,12 +1582,14 @@ install_macos_homebrew() { if ! as_target_user brew services restart "$_formula_ref"; then warn "could not restart the OpenShell Homebrew service" info "restart it later with: brew services restart ${_formula_ref}" - info "then register it with: openshell gateway add $(local_gateway_endpoint) --local --name openshell" + info "then register it with: os gateway add $(local_gateway_endpoint) --local --name openshell" return 0 fi _brew_prefix="$(as_target_user brew --prefix 2>/dev/null || true)" - if [ -n "$_brew_prefix" ] && [ -x "${_brew_prefix}/bin/openshell" ]; then + if [ -n "$_brew_prefix" ] && [ -x "${_brew_prefix}/bin/os" ]; then + OPENSHELL_REGISTER_BIN="${_brew_prefix}/bin/os" + elif [ -n "$_brew_prefix" ] && [ -x "${_brew_prefix}/bin/openshell" ]; then OPENSHELL_REGISTER_BIN="${_brew_prefix}/bin/openshell" fi diff --git a/nix/test-guest/README.md b/nix/test-guest/README.md index 982a882e39..85a2543a53 100644 --- a/nix/test-guest/README.md +++ b/nix/test-guest/README.md @@ -168,7 +168,7 @@ prepared guest image to a particular build or driver configuration. `openshell-development` expects these copied guest paths: -- `/usr/local/bin/openshell` +- `/usr/local/bin/os` - `/usr/local/bin/openshell-gateway` - `/usr/local/lib/openshell-sandbox.tar` @@ -181,12 +181,12 @@ check the development gateway after the rootless provisioners complete: ```shell nix run .#test-guest -- \ --distro fedora --with podman-rootless --with selinux \ - --copy ./openshell:/usr/local/bin/openshell \ + --copy ./os:/usr/local/bin/os \ --copy ./openshell-gateway:/usr/local/bin/openshell-gateway \ --copy ./openshell-sandbox.tar:/usr/local/lib/openshell-sandbox.tar \ --provision openshell-development \ --provision gateway-podman \ - -- /usr/local/bin/openshell status + -- /usr/local/bin/os status ``` `openshell-rpm` expects OpenShell to have been installed with `--install`. It @@ -260,7 +260,7 @@ Cache command options: Package existing ARM64 Linux binaries with the repository's `package:deb:arm64` mise task: ```shell -OPENSHELL_CLI_BINARY="$PWD/target/aarch64-unknown-linux-musl/release/openshell" \ +OPENSHELL_CLI_BINARY="$PWD/target/aarch64-unknown-linux-musl/release/os" \ OPENSHELL_GATEWAY_BINARY="$PWD/target/aarch64-unknown-linux-gnu/release/openshell-gateway" \ OPENSHELL_DRIVER_VM_BINARY="$PWD/target/aarch64-unknown-linux-gnu/release/openshell-driver-vm" \ OPENSHELL_DEB_VERSION=0.0.0-local \ @@ -275,7 +275,7 @@ nix run .#test-guest -- \ --distro ubuntu-24-04 \ --with docker \ --install artifacts/openshell_0.0.0-local_arm64.deb \ - -- openshell --version + -- os --version ``` For an x86_64 Linux guest, supply x86_64 binaries and use `package:deb:amd64`. The package architecture must match the host and guest architecture. @@ -291,8 +291,8 @@ permission bits. Supply a bare octal mode such as `755` to override them: ```shell nix run .#test-guest -- \ --distro ubuntu-24-04 \ - --copy ./openshell:/usr/local/bin/openshell:755 \ - -- openshell --version + --copy ./os:/usr/local/bin/os:755 \ + -- os --version ``` The destination must be an absolute guest path. Use bare octal permission bits diff --git a/nix/test-guest/provisioners/roles/openshell-development/defaults/main.yml b/nix/test-guest/provisioners/roles/openshell-development/defaults/main.yml index 2aae28bbe8..0b0f611d7e 100644 --- a/nix/test-guest/provisioners/roles/openshell-development/defaults/main.yml +++ b/nix/test-guest/provisioners/roles/openshell-development/defaults/main.yml @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -openshell_development_cli_bin: /usr/local/bin/openshell +openshell_development_cli_bin: /usr/local/bin/os openshell_development_gateway_bin: /usr/local/bin/openshell-gateway openshell_development_sandbox_archive: /usr/local/lib/openshell-sandbox.tar openshell_development_gateway_service: openshell-test-guest-gateway.service diff --git a/nix/test-guest/provisioners/roles/openshell-rpm/defaults/main.yml b/nix/test-guest/provisioners/roles/openshell-rpm/defaults/main.yml index bc9c52b7fa..2bc3686a80 100644 --- a/nix/test-guest/provisioners/roles/openshell-rpm/defaults/main.yml +++ b/nix/test-guest/provisioners/roles/openshell-rpm/defaults/main.yml @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -openshell_rpm_cli_bin: /usr/bin/openshell +openshell_rpm_cli_bin: /usr/bin/os openshell_rpm_gateway_bin: /usr/bin/openshell-gateway openshell_rpm_gateway_service: openshell-gateway.service openshell_rpm_gateway_endpoint: https://127.0.0.1:17670 diff --git a/openshell.spec b/openshell.spec index a226b5eb83..41a100cef7 100644 --- a/openshell.spec +++ b/openshell.spec @@ -111,7 +111,7 @@ sed -i 's/^version = "0.0.0"/version = "%{openshell_cargo_version}"/' Cargo.toml grep -q 'version = "%{openshell_cargo_version}"' Cargo.toml || (echo "ERROR: Cargo.toml version patch failed" && exit 1) %build -test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell" +test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/os" test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-gateway" test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-prover" test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-driver-podman" @@ -125,12 +125,14 @@ test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-driver-docker" %{cargo_license} > LICENSE.dependencies # Build man pages from markdown -pandoc -s -t man deploy/man/openshell.1.md -o openshell.1 +pandoc -s -t man deploy/man/os.1.md -o os.1 pandoc -s -t man deploy/man/openshell-gateway.8.md -o openshell-gateway.8 %install # --- CLI binary --- -install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/%{name}" %{buildroot}%{_bindir}/%{name} +install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/os" %{buildroot}%{_bindir}/os +# Deprecated command name; the CLI prints a rename notice when run through it. +ln -s os %{buildroot}%{_bindir}/%{name} # --- Standalone policy prover --- install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/%{name}-prover" %{buildroot}%{_bindir}/%{name}-prover @@ -210,7 +212,8 @@ install -pm 0644 deploy/rpm/CONFIGURATION.md %{buildroot}%{_docdir}/%{name}-gate install -pm 0644 deploy/rpm/TROUBLESHOOTING.md %{buildroot}%{_docdir}/%{name}-gateway/TROUBLESHOOTING.md # --- Man pages --- -install -Dpm 0644 openshell.1 %{buildroot}%{_mandir}/man1/openshell.1 +install -Dpm 0644 os.1 %{buildroot}%{_mandir}/man1/os.1 +ln -s os.1 %{buildroot}%{_mandir}/man1/openshell.1 install -Dpm 0644 openshell-gateway.8 %{buildroot}%{_mandir}/man8/openshell-gateway.8 # --- Python SDK --- @@ -306,7 +309,9 @@ grep -q 'gateway.toml.default.v1' %{buildroot}%{_userunitdir}/%{name}-gateway.se %license LICENSE.dependencies %license cargo-vendor.txt %doc README.md +%{_bindir}/os %{_bindir}/%{name} +%{_mandir}/man1/os.1* %{_mandir}/man1/openshell.1* %files prover diff --git a/scripts/agents/README.md b/scripts/agents/README.md index 48b3e30a27..85f4ae51a1 100644 --- a/scripts/agents/README.md +++ b/scripts/agents/README.md @@ -94,7 +94,7 @@ Manifest paths support these prefixes: to the sandbox. 14. Reuse or initialize refresh-backed provider credentials when declared by the manifest. -15. Run `openshell sandbox create` from the resulting image reference, with the +15. Run `os sandbox create` from the resulting image reference, with the runtime entrypoint persisted as the detached canonical main process. 16. Mark the sandbox ephemeral unless `--keep` was supplied, allowing the gateway to delete it after the canonical process exits. diff --git a/scripts/bin/openshell b/scripts/bin/openshell deleted file mode 100755 index 15d16db1b1..0000000000 --- a/scripts/bin/openshell +++ /dev/null @@ -1,175 +0,0 @@ -#!/usr/bin/env bash - -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -e - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" -TARGET_DIR="${CARGO_TARGET_DIR:-$PROJECT_ROOT/target}" -BINARY="$TARGET_DIR/debug/openshell" -STATE_FILE="$PROJECT_ROOT/.cache/openshell-build.state" -CALLER_PWD="$PWD" - -# --------------------------------------------------------------------------- -# Fingerprint-based rebuild check -# -# Collect dirty files from git, filter to paths in the openshell-cli dependency -# closure, hash their contents, and compare against a persisted state file. We -# also track HEAD so that branch switches / pulls are detected. -# --------------------------------------------------------------------------- - -needs_build=0 - -if [[ ! -x "$BINARY" ]]; then - needs_build=1 -else - cd "$PROJECT_ROOT" - - # Current HEAD commit (detects branch switches, pulls, rebases) - current_head=$(git rev-parse HEAD 2>/dev/null || echo "unknown") - - # Collect dirty (modified, staged, untracked) files - changed_files=() - while IFS= read -r path; do - changed_files+=("$path") - done < <( - { - git diff --name-only 2>/dev/null - git diff --name-only --cached 2>/dev/null - git ls-files --others --exclude-standard 2>/dev/null - } | sort -u - ) - - # Filter to paths that can affect the openshell-cli binary - matches_cli() { - local path=$1 - case "$path" in - Cargo.toml|Cargo.lock|proto/*) - return 0 ;; - crates/openshell-cli/*|crates/openshell-core/*|crates/openshell-bootstrap/*) - return 0 ;; - crates/openshell-prover/*) - return 0 ;; - crates/openshell-policy/*|crates/openshell-providers/*|crates/openshell-tui/*) - return 0 ;; - *) - return 1 ;; - esac - } - - # Compute a composite fingerprint of matching dirty files - payload="" - for path in "${changed_files[@]}"; do - matches_cli "$path" || continue - if [[ -e "$path" ]]; then - digest=$(shasum -a 256 "$path" | cut -d ' ' -f 1) - else - digest="__MISSING__" - fi - payload+="${path}:${digest}"$'\n' - done - - if [[ -n "$payload" ]]; then - current_fingerprint=$(printf '%s' "$payload" | shasum -a 256 | cut -d ' ' -f 1) - else - current_fingerprint="" - fi - - # Load previous state - previous_head="" - previous_fingerprint="" - if [[ -f "$STATE_FILE" ]]; then - while IFS='=' read -r key value; do - case "$key" in - head) previous_head=$value ;; - fingerprint) previous_fingerprint=$value ;; - esac - done < "$STATE_FILE" - fi - - # Decide whether to rebuild - if [[ "$current_head" != "$previous_head" ]]; then - needs_build=1 - elif [[ "$current_fingerprint" != "$previous_fingerprint" ]]; then - needs_build=1 - fi -fi - -if [[ "$needs_build" == "1" ]]; then - echo "Recompiling openshell..." >&2 - build_args=(--package openshell-cli --quiet) - if ! command -v pkg-config >/dev/null 2>&1 || ! pkg-config --exists z3 >/dev/null 2>&1; then - z3_prefix="" - if command -v brew >/dev/null 2>&1; then - z3_prefix=$(brew --prefix z3 2>/dev/null || true) - fi - - for candidate in "$z3_prefix" /opt/homebrew/opt/z3 /usr/local/opt/z3; do - if [[ -n "$candidate" && -f "$candidate/include/z3.h" && -d "$candidate/lib" ]]; then - echo "Using local Z3 from ${candidate} for CLI build." >&2 - export Z3_SYS_Z3_HEADER="${candidate}/include/z3.h" - export Z3_LIBRARY_PATH_OVERRIDE="${candidate}/lib" - break - fi - done - fi - cargo build "${build_args[@]}" - # Persist state after successful build - mkdir -p "$(dirname "$STATE_FILE")" - cd "$PROJECT_ROOT" - new_head=$(git rev-parse HEAD 2>/dev/null || echo "unknown") - # Recompute fingerprint of remaining dirty files (build may not change them) - post_files=() - while IFS= read -r path; do - post_files+=("$path") - done < <( - { - git diff --name-only 2>/dev/null - git diff --name-only --cached 2>/dev/null - git ls-files --others --exclude-standard 2>/dev/null - } | sort -u - ) - - matches_cli() { - local path=$1 - case "$path" in - Cargo.toml|Cargo.lock|proto/*) - return 0 ;; - crates/openshell-cli/*|crates/openshell-core/*|crates/openshell-bootstrap/*) - return 0 ;; - crates/openshell-prover/*) - return 0 ;; - crates/openshell-policy/*|crates/openshell-providers/*|crates/openshell-tui/*) - return 0 ;; - *) - return 1 ;; - esac - } - - post_payload="" - for path in "${post_files[@]}"; do - matches_cli "$path" || continue - if [[ -e "$path" ]]; then - digest=$(shasum -a 256 "$path" | cut -d ' ' -f 1) - else - digest="__MISSING__" - fi - post_payload+="${path}:${digest}"$'\n' - done - - if [[ -n "$post_payload" ]]; then - new_fingerprint=$(printf '%s' "$post_payload" | shasum -a 256 | cut -d ' ' -f 1) - else - new_fingerprint="" - fi - - cat > "$STATE_FILE" </dev/null || echo "unknown") + + # Collect dirty (modified, staged, untracked) files + changed_files=() + while IFS= read -r path; do + changed_files+=("$path") + done < <( + { + git diff --name-only 2>/dev/null + git diff --name-only --cached 2>/dev/null + git ls-files --others --exclude-standard 2>/dev/null + } | sort -u + ) + + # Filter to paths that can affect the openshell-cli binary + matches_cli() { + local path=$1 + case "$path" in + Cargo.toml|Cargo.lock|proto/*) + return 0 ;; + crates/openshell-cli/*|crates/openshell-core/*|crates/openshell-bootstrap/*) + return 0 ;; + crates/openshell-prover/*) + return 0 ;; + crates/openshell-policy/*|crates/openshell-providers/*|crates/openshell-tui/*) + return 0 ;; + *) + return 1 ;; + esac + } + + # Compute a composite fingerprint of matching dirty files + payload="" + for path in "${changed_files[@]}"; do + matches_cli "$path" || continue + if [[ -e "$path" ]]; then + digest=$(shasum -a 256 "$path" | cut -d ' ' -f 1) + else + digest="__MISSING__" + fi + payload+="${path}:${digest}"$'\n' + done + + if [[ -n "$payload" ]]; then + current_fingerprint=$(printf '%s' "$payload" | shasum -a 256 | cut -d ' ' -f 1) + else + current_fingerprint="" + fi + + # Load previous state + previous_head="" + previous_fingerprint="" + if [[ -f "$STATE_FILE" ]]; then + while IFS='=' read -r key value; do + case "$key" in + head) previous_head=$value ;; + fingerprint) previous_fingerprint=$value ;; + esac + done < "$STATE_FILE" + fi + + # Decide whether to rebuild + if [[ "$current_head" != "$previous_head" ]]; then + needs_build=1 + elif [[ "$current_fingerprint" != "$previous_fingerprint" ]]; then + needs_build=1 + fi +fi + +if [[ "$needs_build" == "1" ]]; then + echo "Recompiling os..." >&2 + build_args=(--package openshell-cli --quiet) + if ! command -v pkg-config >/dev/null 2>&1 || ! pkg-config --exists z3 >/dev/null 2>&1; then + z3_prefix="" + if command -v brew >/dev/null 2>&1; then + z3_prefix=$(brew --prefix z3 2>/dev/null || true) + fi + + for candidate in "$z3_prefix" /opt/homebrew/opt/z3 /usr/local/opt/z3; do + if [[ -n "$candidate" && -f "$candidate/include/z3.h" && -d "$candidate/lib" ]]; then + echo "Using local Z3 from ${candidate} for CLI build." >&2 + export Z3_SYS_Z3_HEADER="${candidate}/include/z3.h" + export Z3_LIBRARY_PATH_OVERRIDE="${candidate}/lib" + break + fi + done + fi + cargo build "${build_args[@]}" + # Persist state after successful build + mkdir -p "$(dirname "$STATE_FILE")" + cd "$PROJECT_ROOT" + new_head=$(git rev-parse HEAD 2>/dev/null || echo "unknown") + # Recompute fingerprint of remaining dirty files (build may not change them) + post_files=() + while IFS= read -r path; do + post_files+=("$path") + done < <( + { + git diff --name-only 2>/dev/null + git diff --name-only --cached 2>/dev/null + git ls-files --others --exclude-standard 2>/dev/null + } | sort -u + ) + + matches_cli() { + local path=$1 + case "$path" in + Cargo.toml|Cargo.lock|proto/*) + return 0 ;; + crates/openshell-cli/*|crates/openshell-core/*|crates/openshell-bootstrap/*) + return 0 ;; + crates/openshell-prover/*) + return 0 ;; + crates/openshell-policy/*|crates/openshell-providers/*|crates/openshell-tui/*) + return 0 ;; + *) + return 1 ;; + esac + } + + post_payload="" + for path in "${post_files[@]}"; do + matches_cli "$path" || continue + if [[ -e "$path" ]]; then + digest=$(shasum -a 256 "$path" | cut -d ' ' -f 1) + else + digest="__MISSING__" + fi + post_payload+="${path}:${digest}"$'\n' + done + + if [[ -n "$post_payload" ]]; then + new_fingerprint=$(printf '%s' "$post_payload" | shasum -a 256 | cut -d ' ' -f 1) + else + new_fingerprint="" + fi + + cat > "$STATE_FILE" </dev/null 2>&1; then +if ! os status >/dev/null 2>&1; then echo -e "${RED}Error: No healthy gateway. Run: mise run gateway:docker${RESET}" exit 1 fi @@ -138,13 +138,13 @@ create_sandbox() { local provider_flag=("$@") echo " Creating sandbox: $name" - openshell sandbox create --name "$name" "${provider_flag[@]}" \ + os sandbox create --name "$name" "${provider_flag[@]}" \ -- sh -c "echo Ready && sleep 3600" >/dev/null 2>&1 & local pid=$! local attempts=0 while [[ $attempts -lt 40 ]]; do - if openshell sandbox list 2>/dev/null | grep -q "$name.*Ready"; then + if os sandbox list 2>/dev/null | grep -q "$name.*Ready"; then echo " Sandbox $name is Ready" SANDBOXES+=("$name") # Kill the blocking create process (sandbox stays alive by default) @@ -171,7 +171,7 @@ sandbox_exec() { shift local ssh_config - ssh_config=$(openshell sandbox ssh-config "$name" 2>/dev/null) + ssh_config=$(os sandbox ssh-config "$name" 2>/dev/null) local ssh_host ssh_host=$(echo "$ssh_config" | grep "^Host " | awk '{print $2}') local ssh_config_file="$POLICY_DIR/ssh_config_${name}" @@ -291,9 +291,9 @@ YAML header "Phase 0: Provider Setup" -openshell provider delete "$PROVIDER_NAME" >/dev/null 2>&1 || true +os provider delete "$PROVIDER_NAME" >/dev/null 2>&1 || true -if openshell provider create \ +if os provider create \ --name "$PROVIDER_NAME" \ --type github \ --credential "GITHUB_TOKEN=$TOKEN" >/dev/null 2>&1; then @@ -312,7 +312,7 @@ header "Phase 1: L4 Allow/Deny (TLS auto-terminated, credential injection)" SB1="smoke-l4" if create_sandbox "$SB1" --provider "$PROVIDER_NAME"; then echo " Setting L4-only policy..." - openshell policy set "$SB1" --policy "$POLICY_L4" >/dev/null 2>&1 + os policy set "$SB1" --policy "$POLICY_L4" >/dev/null 2>&1 echo " Waiting for policy propagation (15s)..." sleep 15 @@ -347,7 +347,7 @@ header "Phase 2: L7 Enforcement (read-only, TLS auto-terminated)" SB2="smoke-l7" if create_sandbox "$SB2" --provider "$PROVIDER_NAME"; then echo " Setting L7 read-only policy..." - openshell policy set "$SB2" --policy "$POLICY_L7_RO" >/dev/null 2>&1 + os policy set "$SB2" --policy "$POLICY_L7_RO" >/dev/null 2>&1 echo " Waiting for policy propagation (15s)..." sleep 15 @@ -382,7 +382,7 @@ header "Phase 3: Credential Injection (provider attached, TLS auto-terminated)" SB3="smoke-cred" if create_sandbox "$SB3" --provider "$PROVIDER_NAME"; then echo " Setting L7 full policy..." - openshell policy set "$SB3" --policy "$POLICY_CRED" >/dev/null 2>&1 + os policy set "$SB3" --policy "$POLICY_CRED" >/dev/null 2>&1 echo " Waiting for policy propagation (15s)..." sleep 15 @@ -412,7 +412,7 @@ header "Phase 4: tls: skip (raw tunnel, no MITM)" SB4="smoke-skip" if create_sandbox "$SB4" --provider "$PROVIDER_NAME"; then echo " Setting tls: skip policy..." - openshell policy set "$SB4" --policy "$POLICY_SKIP" >/dev/null 2>&1 + os policy set "$SB4" --policy "$POLICY_SKIP" >/dev/null 2>&1 echo " Waiting for policy propagation (15s)..." sleep 15 @@ -460,20 +460,20 @@ if [[ ${#SANDBOXES[@]} -gt 0 ]]; then done echo "" echo "Inspect logs with:" - echo " openshell logs --source sandbox" + echo " os logs --source sandbox" echo "" read -r -p "Delete all smoke test sandboxes and provider? [y/N] " answer if [[ "$answer" =~ ^[Yy]$ ]]; then echo "" for sb in "${SANDBOXES[@]}"; do - openshell sandbox delete "$sb" >/dev/null 2>&1 && echo " Deleted $sb" || true + os sandbox delete "$sb" >/dev/null 2>&1 && echo " Deleted $sb" || true done - openshell provider delete "$PROVIDER_NAME" >/dev/null 2>&1 && echo " Deleted provider $PROVIDER_NAME" || true + os provider delete "$PROVIDER_NAME" >/dev/null 2>&1 && echo " Deleted provider $PROVIDER_NAME" || true else echo " Sandboxes left running. Clean up manually:" - echo " openshell sandbox delete --all" - echo " openshell provider delete $PROVIDER_NAME" + echo " os sandbox delete --all" + echo " os provider delete $PROVIDER_NAME" fi fi diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py index 13dd6f2416..297080ced5 100755 --- a/scripts/update_license_headers.py +++ b/scripts/update_license_headers.py @@ -53,7 +53,7 @@ # Extensionless source files that cannot be identified by suffix. FILE_COMMENT_STYLES: dict[str, str] = { - "scripts/bin/openshell": "#", + "scripts/bin/os": "#", } # Some consumer formats do not support comments. Keep SPDX data in diff --git a/snapcraft.yaml b/snapcraft.yaml index 633e27450f..bf355dc439 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -11,7 +11,8 @@ description: | policy-enforced egress routing, credential proxying, and privacy-aware profile-backed model-provider access. - The OpenShell snap ships a CLI (`openshell`), a terminal UI (`openshell.term`), + The OpenShell snap ships a CLI (`openshell.os` with alias `os`, also available + as `openshell`), a terminal UI (`openshell.term`), a standalone policy prover (`openshell.prover` with alias `openshell-prover`), and a managed gateway daemon (`openshell.user-gateway`). The user gateway is disabled by default so that one selected user can run it. @@ -106,8 +107,22 @@ platforms: build-for: [arm64] apps: + # Runs the CLI directly, without the rename notice, until every Store + # installation has the `os` alias. openshell: - command: bin/openshell + command: bin/os + environment: + XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config" + XDG_DATA_HOME: "$SNAP_USER_COMMON/.local/share" + XDG_STATE_HOME: "$SNAP_USER_COMMON/.local/state" + plugs: + - home + - network + - system-observe + os: + command: bin/os + aliases: + - os environment: XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config" XDG_DATA_HOME: "$SNAP_USER_COMMON/.local/share" @@ -117,7 +132,7 @@ apps: - network - system-observe term: - command: bin/openshell term + command: bin/os term desktop: meta/gui/term.desktop environment: XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config" @@ -190,7 +205,7 @@ parts: set -euo pipefail MISSING=() - for bin in openshell openshell-prover openshell-gateway openshell-driver-docker openshell-sandbox openshell-gateway-wrapper; do + for bin in os openshell-prover openshell-gateway openshell-driver-docker openshell-sandbox openshell-gateway-wrapper; do if [ ! -f "$CRAFT_PART_SRC/$bin" ]; then MISSING+=("$bin") fi @@ -206,8 +221,8 @@ parts: exit 1 fi - install -D -m 0755 "$CRAFT_PART_SRC/openshell" \ - "$CRAFT_PART_INSTALL/bin/openshell" + install -D -m 0755 "$CRAFT_PART_SRC/os" \ + "$CRAFT_PART_INSTALL/bin/os" install -D -m 0755 "$CRAFT_PART_SRC/openshell-prover" \ "$CRAFT_PART_INSTALL/bin/openshell-prover" install -D -m 0755 "$CRAFT_PART_SRC/openshell-gateway" \ diff --git a/tasks/scripts/gateway-docker.sh b/tasks/scripts/gateway-docker.sh index e507cc0ba5..4affeaeebb 100644 --- a/tasks/scripts/gateway-docker.sh +++ b/tasks/scripts/gateway-docker.sh @@ -21,8 +21,8 @@ # OPENSHELL_DEV_OTLP_ENDPOINT=http://127.0.0.1:4317 mise run gateway:docker # # After the gateway is running, point the CLI at it with either: -# openshell --gateway docker-dev -# openshell gateway use docker-dev # then plain `openshell ` +# os --gateway docker-dev +# os gateway use docker-dev # then plain `openshell ` set -euo pipefail @@ -225,8 +225,8 @@ echo " namespace: ${SANDBOX_NAMESPACE}" echo " state dir: ${STATE_DIR}" echo echo "Point the CLI at this gateway with one of:" -echo " openshell --gateway ${GATEWAY_NAME} status" -echo " openshell gateway select ${GATEWAY_NAME}" +echo " os --gateway ${GATEWAY_NAME} status" +echo " os gateway select ${GATEWAY_NAME}" echo exec "${GATEWAY_BIN}" \ diff --git a/tasks/scripts/gateway-vm.sh b/tasks/scripts/gateway-vm.sh index e30d0e7e4e..0450486563 100755 --- a/tasks/scripts/gateway-vm.sh +++ b/tasks/scripts/gateway-vm.sh @@ -27,7 +27,7 @@ # # This script also writes ~/.config/openshell/active_gateway so the # `openshell` CLI automatically targets this gateway in subsequent shells. -# No need to run `openshell gateway select`. Inside this repo you can +# No need to run `os gateway select`. Inside this repo you can # override per-developer with OPENSHELL_GATEWAY in `.env` (mise loads it). # An explicit `--gateway` / `--gateway-endpoint` flag still wins. @@ -170,7 +170,7 @@ EOF chown_invoking_user "${config_home}/openshell" } -# Mirror what `openshell gateway select ` does: write the gateway name +# Mirror what `os gateway select ` does: write the gateway name # to $XDG_CONFIG_HOME/openshell/active_gateway. The CLI picks it up as the # default target when neither --gateway nor OPENSHELL_GATEWAY is set. save_active_gateway() { diff --git a/tasks/scripts/package-deb-install.sh b/tasks/scripts/package-deb-install.sh index e2e34ad5cf..5ab3f90a04 100755 --- a/tasks/scripts/package-deb-install.sh +++ b/tasks/scripts/package-deb-install.sh @@ -63,7 +63,7 @@ cargo build --release \ -p openshell-driver-docker echo "==> Building Debian package" -OPENSHELL_CLI_BINARY="${repo_root}/target/release/openshell" \ +OPENSHELL_CLI_BINARY="${repo_root}/target/release/os" \ OPENSHELL_GATEWAY_BINARY="${repo_root}/target/release/openshell-gateway" \ OPENSHELL_PROVER_BINARY="${repo_root}/target/release/openshell-prover" \ OPENSHELL_DRIVER_VM_BINARY="${repo_root}/target/release/openshell-driver-vm" \ @@ -83,7 +83,7 @@ esac echo "==> Installing ${deb_path}" sudo dpkg -i "$deb_path" -openshell --version +os --version openshell-gateway --version openshell-prover --version @@ -94,4 +94,4 @@ systemctl --user is-active --quiet openshell-gateway echo "==> Registering local gateway" remove_existing_gateway_registration -openshell gateway add "$GATEWAY_ENDPOINT" --local --name "$GATEWAY_NAME" +os gateway add "$GATEWAY_ENDPOINT" --local --name "$GATEWAY_NAME" diff --git a/tasks/scripts/package-deb.sh b/tasks/scripts/package-deb.sh index 912c9bfcf4..dae7713d9a 100755 --- a/tasks/scripts/package-deb.sh +++ b/tasks/scripts/package-deb.sh @@ -19,7 +19,7 @@ usage() { Build the openshell Debian package. Required environment: - OPENSHELL_CLI_BINARY Path to openshell + OPENSHELL_CLI_BINARY Path to os OPENSHELL_GATEWAY_BINARY Path to openshell-gateway OPENSHELL_PROVER_BINARY Path to openshell-prover OPENSHELL_DRIVER_VM_BINARY Path to openshell-driver-vm @@ -114,7 +114,9 @@ mkdir -p "$pkgroot/DEBIAN" # --------------------------------------------------------------------------- # Binaries. -stage_binary "$OPENSHELL_CLI_BINARY" "$pkgroot/usr/bin/openshell" +stage_binary "$OPENSHELL_CLI_BINARY" "$pkgroot/usr/bin/os" +# Deprecated command name; the CLI prints a rename notice when run through it. +ln -s os "$pkgroot/usr/bin/openshell" stage_binary "$OPENSHELL_GATEWAY_BINARY" "$pkgroot/usr/bin/openshell-gateway" stage_binary "$OPENSHELL_PROVER_BINARY" "$pkgroot/usr/bin/openshell-prover" stage_binary "$OPENSHELL_DRIVER_VM_BINARY" "$pkgroot/usr/libexec/openshell/openshell-driver-vm" diff --git a/tasks/scripts/release.py b/tasks/scripts/release.py index f41f174b26..6b2cc40760 100644 --- a/tasks/scripts/release.py +++ b/tasks/scripts/release.py @@ -365,7 +365,9 @@ class Openshell < Formula def install odie "OpenShell Homebrew formula currently supports macOS only" unless OS.mac? - bin.install "openshell" + bin.install "os" + # Deprecated command name; the CLI prints a rename notice when run through it. + bin.install_symlink "os" => "openshell" resource("openshell-gateway").stage do bin.install "openshell-gateway" @@ -502,12 +504,13 @@ def caveats brew services restart openshell Register it with the OpenShell CLI: - openshell gateway add https://localhost:{LOCAL_GATEWAY_PORT} --local --name openshell + os gateway add https://localhost:{LOCAL_GATEWAY_PORT} --local --name openshell EOS end test do - assert_match "openshell ", shell_output("#{{bin}}/openshell --version") + assert_match "os ", shell_output("#{{bin}}/os --version") + assert_match "os ", shell_output("OPENSHELL_SUPPRESS_RENAME_WARNING=1 #{{bin}}/openshell --version") assert_match "openshell-prover ", shell_output("#{{bin}}/openshell-prover --version") end end diff --git a/tasks/scripts/release_formula_test.py b/tasks/scripts/release_formula_test.py index faa79a22ed..7753cf6558 100644 --- a/tasks/scripts/release_formula_test.py +++ b/tasks/scripts/release_formula_test.py @@ -80,6 +80,9 @@ def test_generate_homebrew_formula_uses_channel_urls_and_exact_version( assert 'sha256 "' + "e" * 64 + '"' in formula assert 'resource("openshell-prover").stage' in formula assert 'bin.install "openshell-prover"' in formula + assert 'bin.install "os"' in formula + assert 'bin.install_symlink "os" => "openshell"' in formula + assert "#{bin}/os --version" in formula assert "#{bin}/openshell-prover --version" in formula assert "OPENSHELL_COMPUTE_DRIVER: " not in formula assert 'OPENSHELL_GATEWAY_CONFIG: "#{var}/openshell/gateway.toml"' not in formula @@ -118,10 +121,7 @@ def test_generate_homebrew_formula_uses_channel_urls_and_exact_version( assert formula.count("gateway_config.write gateway_config_contents") == 1 assert "gateway_config.atomic_write gateway_config_contents" in formula assert '# compute_driver = "vm"' not in formula - assert ( - "openshell gateway add https://localhost:17670 --local --name openshell" - in formula - ) + assert "os gateway add https://localhost:17670 --local --name openshell" in formula assert 'run opt_libexec/"openshell-gateway-homebrew-service"' in formula assert 'xdg_config_home="${XDG_CONFIG_HOME:-${HOME}/.config}"' in formula assert 'xdg_gateway_config="${xdg_config_home}/openshell/gateway.toml"' in formula diff --git a/tasks/scripts/sandbox.sh b/tasks/scripts/sandbox.sh index 6adc8b2123..d1533087ee 100755 --- a/tasks/scripts/sandbox.sh +++ b/tasks/scripts/sandbox.sh @@ -18,10 +18,10 @@ read -r -a CMD <<< "${usage_command:-claude}" # ------------------------------------------------------------------- # 1. Ensure a gateway is reachable # ------------------------------------------------------------------- -if ! openshell status >/dev/null 2>&1; then +if ! os status >/dev/null 2>&1; then echo "No reachable OpenShell gateway." >&2 echo "Start one in another shell with: mise run gateway:docker" >&2 - echo "Or register/select an existing gateway with: openshell gateway add " >&2 + echo "Or register/select an existing gateway with: os gateway add " >&2 exit 2 fi @@ -30,7 +30,7 @@ fi # ------------------------------------------------------------------- need_create=1 -if openshell sandbox get "${SANDBOX_NAME}" >/dev/null 2>&1; then +if os sandbox get "${SANDBOX_NAME}" >/dev/null 2>&1; then need_create=0 fi @@ -42,13 +42,13 @@ ensure_anthropic_provider() { return fi - if openshell provider get anthropic >/dev/null 2>&1; then + if os provider get anthropic >/dev/null 2>&1; then # Provider already registered — nothing to do. return fi echo "Registering anthropic provider..." - openshell provider create \ + os provider create \ --name anthropic \ --type claude-code \ --credential "ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}" @@ -60,14 +60,14 @@ ensure_anthropic_provider # 4. Create or connect to the sandbox # ------------------------------------------------------------------- PROVIDER_ARGS=() -if openshell provider get anthropic >/dev/null 2>&1; then +if os provider get anthropic >/dev/null 2>&1; then PROVIDER_ARGS+=(--provider anthropic) fi if [[ "${need_create}" == "1" ]]; then echo "Creating sandbox '${SANDBOX_NAME}'..." - openshell sandbox create --name "${SANDBOX_NAME}" "${PROVIDER_ARGS[@]}" --tty -- "${CMD[@]}" + os sandbox create --name "${SANDBOX_NAME}" "${PROVIDER_ARGS[@]}" --tty -- "${CMD[@]}" else echo "Connecting to existing sandbox '${SANDBOX_NAME}'..." - openshell sandbox connect "${SANDBOX_NAME}" + os sandbox connect "${SANDBOX_NAME}" fi diff --git a/tasks/scripts/test-packaging-assets.sh b/tasks/scripts/test-packaging-assets.sh index c19be05281..fe739b2b9a 100755 --- a/tasks/scripts/test-packaging-assets.sh +++ b/tasks/scripts/test-packaging-assets.sh @@ -87,6 +87,8 @@ assert_contains \ 'ExecStartPre=/usr/bin/openshell-gateway generate-certs --output-dir ${OPENSHELL_LOCAL_TLS_DIR} --server-san host.openshell.internal' assert_contains "$spec" 'ExecStartPre=/usr/bin/openshell-gateway config preflight' assert_contains "$spec" '%package prover' +assert_contains "$spec" 'install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/os" %{buildroot}%{_bindir}/os' +assert_contains "$spec" 'ln -s os %{buildroot}%{_bindir}/%{name}' assert_contains "$spec" '%files prover' assert_contains "$spec" '%{_bindir}/%{name}-prover' assert_contains "$spec" 'test -x "${OPENSHELL_PREBUILT_BINARIES_DIR}/openshell-driver-podman"' @@ -233,7 +235,21 @@ assert_contains "$snap_publish_workflow" 'component_args+=(--component "${compon assert_contains "$snap_publish_workflow" 'group: snap-publish-${{ inputs.upload-channel }}-${{ matrix.arch }}' assert_contains "$snap_publish_workflow" 'cancel-in-progress: false' assert_contains "$snap_publish_workflow" 'queue: max' -assert_contains "$snapcraft" 'for bin in openshell openshell-prover openshell-gateway openshell-driver-docker openshell-sandbox openshell-gateway-wrapper; do' +assert_contains "$snapcraft" 'for bin in os openshell-prover openshell-gateway openshell-driver-docker openshell-sandbox openshell-gateway-wrapper; do' +assert_contains "$snapcraft" '"$CRAFT_PART_INSTALL/bin/os"' +# The CLI is `os`; the snap's `openshell` app runs it without the rename notice. +if ! awk ' + /^ openshell:$/ { app = "openshell"; next } + /^ os:$/ { app = "os"; next } + /^ [[:alnum:]_-]+:$/ { app = ""; next } + app == "openshell" && /^ command: bin\/os$/ { openshell_cmd = 1 } + app == "os" && /^ command: bin\/os$/ { os_cmd = 1 } + app == "os" && /^ - os$/ { os_alias = 1 } + END { exit !(openshell_cmd && os_cmd && os_alias) } +' "$snapcraft"; then + echo "FAIL: snap must run bin/os as openshell and as os with the os alias" >&2 + exit 1 +fi assert_contains "$snapcraft" '"$CRAFT_PART_INSTALL/bin/openshell-prover"' if ! awk ' /^ prover:$/ { in_prover = 1; next } @@ -310,11 +326,11 @@ if command -v dpkg-deb >/dev/null 2>&1; then package_work=$(mktemp -d "${TMPDIR:-/tmp}/openshell-package-assets.XXXXXX") trap 'rm -rf "$package_work"' EXIT mkdir -p "$package_work/bin" "$package_work/output" - for binary in openshell openshell-gateway openshell-prover openshell-driver-vm openshell-driver-podman openshell-driver-docker; do + for binary in os openshell-gateway openshell-prover openshell-driver-vm openshell-driver-podman openshell-driver-docker; do printf '#!/bin/sh\nexit 0\n' >"$package_work/bin/$binary" chmod +x "$package_work/bin/$binary" done - OPENSHELL_CLI_BINARY="$package_work/bin/openshell" \ + OPENSHELL_CLI_BINARY="$package_work/bin/os" \ OPENSHELL_GATEWAY_BINARY="$package_work/bin/openshell-gateway" \ OPENSHELL_PROVER_BINARY="$package_work/bin/openshell-prover" \ OPENSHELL_DRIVER_VM_BINARY="$package_work/bin/openshell-driver-vm" \ @@ -331,6 +347,16 @@ if command -v dpkg-deb >/dev/null 2>&1; then echo "FAIL: package-deb did not stage the current Debian service" >&2 exit 1 fi + if ! dpkg-deb --fsys-tarfile "$package_work/output/openshell_0.0.0_amd64.deb" \ + | tar -tvf - | grep -E ' \./usr/bin/openshell -> os$' >/dev/null; then + echo "FAIL: package-deb did not link openshell to os" >&2 + exit 1 + fi + if ! dpkg-deb --fsys-tarfile "$package_work/output/openshell_0.0.0_amd64.deb" \ + | tar -tf - | grep -x './usr/bin/os' >/dev/null; then + echo "FAIL: package-deb did not stage os" >&2 + exit 1 + fi if ! dpkg-deb --fsys-tarfile "$package_work/output/openshell_0.0.0_amd64.deb" \ | tar -tf - | grep -x './usr/bin/openshell-prover' >/dev/null; then echo "FAIL: package-deb did not stage openshell-prover" >&2 diff --git a/tasks/scripts/windows-msvc.ps1 b/tasks/scripts/windows-msvc.ps1 index d4ba97e196..54e3ba0a97 100644 --- a/tasks/scripts/windows-msvc.ps1 +++ b/tasks/scripts/windows-msvc.ps1 @@ -512,7 +512,7 @@ function Invoke-Lint([string] $RustTarget) { function Invoke-Build([string] $RustTarget) { Invoke-VsCargo ` -RustTarget $RustTarget ` - -CargoArgs "cargo build --release --target $RustTarget --bin openshell-gateway --bin openshell $Z3WorkspaceFeatures" ` + -CargoArgs "cargo build --release --target $RustTarget --bin openshell-gateway --bin os $Z3WorkspaceFeatures" ` -LogName "build-$RustTarget-release.log" } diff --git a/tasks/term.toml b/tasks/term.toml index aa66f020d4..c5f76f325c 100644 --- a/tasks/term.toml +++ b/tasks/term.toml @@ -5,10 +5,10 @@ [term] description = "Launch the OpenShell TUI" -run = "openshell term" +run = "os term" hide = true ["term:dev"] description = "Launch the OpenShell TUI with hot-reload on file changes" -run = "cargo watch -s 'openshell term'" +run = "cargo watch -s 'os term'" hide = true diff --git a/tasks/test.toml b/tasks/test.toml index c795f77cac..4d3b660703 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -399,7 +399,7 @@ run = "e2e/rust/e2e-docker.sh" description = "Run #2821 existing inspected-endpoint auto-approval regression" run = [ "cargo build -p openshell-cli", - "e2e/with-docker-gateway.sh bash -lc 'target/debug/openshell settings set --global --key agent_policy_proposals_enabled --value true --yes && OPENSHELL_BIN=$PWD/target/debug/openshell bash e2e/policy-advisor/existing-endpoint-auto-approve.sh'", + "e2e/with-docker-gateway.sh bash -lc 'target/debug/os settings set --global --key agent_policy_proposals_enabled --value true --yes && OPENSHELL_BIN=$PWD/target/debug/os bash e2e/policy-advisor/existing-endpoint-auto-approve.sh'", ] ["e2e:docker:gpu"] diff --git a/tests/runner/src/collect-k3s.sh b/tests/runner/src/collect-k3s.sh index 3b8408a2a5..faee367c29 100755 --- a/tests/runner/src/collect-k3s.sh +++ b/tests/runner/src/collect-k3s.sh @@ -65,8 +65,8 @@ collect_log() { -o 'custom-columns=NAME:.metadata.name,UID:.metadata.uid,PHASE:.status.phase,CONDITIONS:.status.conditions,CONTAINERS:.status.containerStatuses' collect 'Gateway Services' /usr/local/bin/k3s kubectl --request-timeout=5s -n openshell get services \ -o 'custom-columns=NAME:.metadata.name,TYPE:.spec.type,CLUSTERIP:.spec.clusterIP,SELECTOR:.spec.selector,PORTS:.spec.ports' - collect 'Test client gateway registrations' runuser -u tmachine -- openshell gateway list --output json - collect 'Test client gateway status' runuser -u tmachine -- openshell status --output json + collect 'Test client gateway registrations' runuser -u tmachine -- os gateway list --output json + collect 'Test client gateway status' runuser -u tmachine -- os status --output json collect 'Endpoint readiness' /usr/local/bin/k3s kubectl --request-timeout=5s -n openshell get endpointslices \ -o 'custom-columns=NAME:.metadata.name,PORTS:.ports,ADDRESSES:.endpoints[*].addresses,CONDITIONS:.endpoints[*].conditions' collect 'Gateway events' /usr/local/bin/k3s kubectl --request-timeout=5s -n openshell get events --sort-by=.lastTimestamp diff --git a/tests/runner/src/execute.rs b/tests/runner/src/execute.rs index 9432f6a629..7ef0f3841e 100644 --- a/tests/runner/src/execute.rs +++ b/tests/runner/src/execute.rs @@ -661,8 +661,8 @@ mod tests { "-n agent-sandbox-system logs", "-n openshell get pods", "-n openshell get services", - "openshell gateway list --output json", - "openshell status --output json", + "os gateway list --output json", + "os status --output json", "-n openshell get endpointslices", "-n openshell get events", "-n openshell logs", diff --git a/tests/suites/conformance/src/cli.rs b/tests/suites/conformance/src/cli.rs index 9f87643763..443f31a909 100644 --- a/tests/suites/conformance/src/cli.rs +++ b/tests/suites/conformance/src/cli.rs @@ -21,7 +21,7 @@ const ATTACH_BEFORE_EXIT: &str = "sleep 5"; /// `ssh -tt`, as it does when run from a terminal. const TERMINAL_MODES: [(&str, &str); 2] = [("--no-tty", ""), ("--tty", "t")]; -/// `openshell status` succeeds, and a sandbox created with the CLI is +/// `os status` succeeds, and a sandbox created with the CLI is /// retrievable and Ready, appears in `sandbox list`, runs `sandbox exec`, and is /// gone from `sandbox list` after `sandbox delete`. #[testkit::test] diff --git a/tests/suites/conformance/src/port_forward.rs b/tests/suites/conformance/src/port_forward.rs index 1bc05e7abd..93ff123413 100644 --- a/tests/suites/conformance/src/port_forward.rs +++ b/tests/suites/conformance/src/port_forward.rs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -//! Port forwarding with `openshell forward`. +//! Port forwarding with `os forward`. //! //! Ported from the `port_forward` e2e test. diff --git a/tests/suites/conformance/src/settings.rs b/tests/suites/conformance/src/settings.rs index 632356fc09..c6f3007e71 100644 --- a/tests/suites/conformance/src/settings.rs +++ b/tests/suites/conformance/src/settings.rs @@ -26,7 +26,7 @@ async fn sandbox_setting_round_trip(cx: &mut Context) -> testkit::Result { let global = read_global_setting(cx, KEY).await?; testkit::ensure!( global == UNSET, - "the gateway sets {KEY} globally ({global}), which hides sandbox values; delete it with `openshell settings delete --global --key {KEY}`" + "the gateway sets {KEY} globally ({global}), which hides sandbox values; delete it with `os settings delete --global --key {KEY}`" ); let sandbox = cx .sandbox("sr") diff --git a/tests/suites/features/oidc-auth/tests/oidc_auth.rs b/tests/suites/features/oidc-auth/tests/oidc_auth.rs index e73754b5aa..9f6a3d54a7 100644 --- a/tests/suites/features/oidc-auth/tests/oidc_auth.rs +++ b/tests/suites/features/oidc-auth/tests/oidc_auth.rs @@ -382,7 +382,7 @@ async fn workspace_user_denied_management(cx: &mut Context) -> Result { .failure()?; let report = compact(&denied.report_text()); let remediation = compact(&format!( - "openshell workspace member add --workspace '{}' --subject '{}' --role admin", + "os workspace member add --workspace '{}' --subject '{}' --role admin", ws.name(), user.subject() )); diff --git a/tests/support/host-server/src/tcp.rs b/tests/support/host-server/src/tcp.rs index ef45a30680..63fdb9edb4 100644 --- a/tests/support/host-server/src/tcp.rs +++ b/tests/support/host-server/src/tcp.rs @@ -93,7 +93,7 @@ impl TcpServer { /// Connect to `port` on the test host's loopback, send `request`, and return /// what arrives until the other end closes. For a port the test reaches from -/// the host, such as one `openshell forward` listens on. +/// the host, such as one `os forward` listens on. pub async fn exchange(port: u16, request: &[u8]) -> Result> { #[allow( clippy::disallowed_methods, diff --git a/tests/support/keycloak/src/browser.rs b/tests/support/keycloak/src/browser.rs index ec48ec4afb..b9b365b036 100644 --- a/tests/support/keycloak/src/browser.rs +++ b/tests/support/keycloak/src/browser.rs @@ -26,7 +26,7 @@ const URL_TIMEOUT: Duration = Duration::from_secs(15); const FINISH_TIMEOUT: Duration = Duration::from_secs(30); const CURL_MAX_TIME: &str = "10"; -/// A finished `openshell gateway add --oidc-issuer` browser login. +/// A finished `os gateway add --oidc-issuer` browser login. pub struct BrowserLogin { /// The URL the CLI opened in the browser. pub authorization_url: Url, diff --git a/tests/support/keycloak/src/session.rs b/tests/support/keycloak/src/session.rs index d98eda01cb..9ec76abee3 100644 --- a/tests/support/keycloak/src/session.rs +++ b/tests/support/keycloak/src/session.rs @@ -98,7 +98,7 @@ impl Session { } } -/// Write the CLI configuration `openshell gateway add --oidc-issuer` and a +/// Write the CLI configuration `os gateway add --oidc-issuer` and a /// login would: the registration, the token, and the gateway's CA, with no /// client certificate. fn write_cli_session( diff --git a/tests/testkit/README.md b/tests/testkit/README.md index 5195b87262..65e511d018 100644 --- a/tests/testkit/README.md +++ b/tests/testkit/README.md @@ -82,7 +82,7 @@ fails. A killed test process skips cleanup, so names are unique to the run. script with `python3 -c` and fails unless it exits 0. Exec output has `success()`, `failure()`, `expect_stdout()`, and `last_json()` for the last JSON object or array line of stdout, such as a client script's result. -- `cx.cli_sandbox(suffix)` for a sandbox only `openshell sandbox create` +- `cx.cli_sandbox(suffix)` for a sandbox only `os sandbox create` can make, such as one with `policy_yaml(...)` or `--no-keep`. `create()` detaches and returns the `Sandbox`, `create_ready()` also waits for Ready, and `run()` returns the attached CLI output. @@ -204,7 +204,7 @@ Tests find the gateway the same way the `openshell` CLI does: that endpoint. A URL no gateway is registered for is used as is: plaintext, or TLS without a client certificate. 2. `OPENSHELL_GATEWAY`: the name of a gateway registered with the CLI. -3. The CLI's active gateway, set by `openshell gateway select`. +3. The CLI's active gateway, set by `os gateway select`. A registered gateway's endpoint and auth mode come from `$XDG_CONFIG_HOME/openshell/gateways//metadata.json`. For mTLS, the CA diff --git a/tests/testkit/testkit/src/cli.rs b/tests/testkit/testkit/src/cli.rs index 6d87467bf6..da4c851395 100644 --- a/tests/testkit/testkit/src/cli.rs +++ b/tests/testkit/testkit/src/cli.rs @@ -94,7 +94,7 @@ impl Cli { } } - /// Check that the CLI reaches the gateway: `openshell status` must report + /// Check that the CLI reaches the gateway: `os status` must report /// it connected. pub async fn check_connected(&self) -> Result { let output = self.run(["status", "--output", "json"]).await?.success()?; diff --git a/tests/testkit/testkit/src/cli_sandbox.rs b/tests/testkit/testkit/src/cli_sandbox.rs index eeb4f9a640..0f84fe24ee 100644 --- a/tests/testkit/testkit/src/cli_sandbox.rs +++ b/tests/testkit/testkit/src/cli_sandbox.rs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -//! Sandboxes created through `openshell sandbox create`, for tests of what +//! Sandboxes created through `os sandbox create`, for tests of what //! only the CLI offers, such as `--policy` files, `--no-keep`, or an attached //! main command. @@ -10,7 +10,7 @@ use crate::context::{Handles, Sandbox}; use crate::error::{Result, ResultExt}; use crate::yaml_file::YamlFile; -/// A sandbox to create with `openshell sandbox create`. Start one with +/// A sandbox to create with `os sandbox create`. Start one with /// [`Context::cli_sandbox`](crate::Context::cli_sandbox). /// /// The sandbox is tracked for cleanup before the CLI runs, so a create the diff --git a/tests/testkit/testkit/src/gateway.rs b/tests/testkit/testkit/src/gateway.rs index 5773f924c8..082a671915 100644 --- a/tests/testkit/testkit/src/gateway.rs +++ b/tests/testkit/testkit/src/gateway.rs @@ -8,7 +8,7 @@ //! with that endpoint. A URL no gateway is registered for is used as is: //! plaintext, or TLS without a client certificate. //! 2. `OPENSHELL_GATEWAY`: the name of a gateway registered with the CLI. -//! 3. The CLI's active gateway, set by `openshell gateway select`. +//! 3. The CLI's active gateway, set by `os gateway select`. //! //! A registered gateway's endpoint and auth mode come from its //! `metadata.json`. For mTLS, the CA and client certificate come from its @@ -70,7 +70,7 @@ impl Gateway { Error::msg(format!( "no gateway selected; set {GATEWAY_ENV} to a registered gateway, \ {ENDPOINT_ENV} to a gateway URL, or select one with \ - `openshell gateway select`" + `os gateway select`" )) })?; let metadata = openshell_bootstrap::load_gateway_metadata(&name) diff --git a/tests/testkit/testkit/src/logs.rs b/tests/testkit/testkit/src/logs.rs index ce486fcc5b..eb37a79d9e 100644 --- a/tests/testkit/testkit/src/logs.rs +++ b/tests/testkit/testkit/src/logs.rs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 -//! A sandbox's supervisor logs, as `openshell logs --source sandbox` shows +//! A sandbox's supervisor logs, as `os logs --source sandbox` shows //! them. use std::fmt; @@ -13,7 +13,7 @@ use crate::context::Sandbox; use crate::error::{Result, ResultExt as _}; use crate::poll::{Poll, poll_until}; -/// The most lines [`Sandbox::logs`] returns, as `openshell logs -n 500`. +/// The most lines [`Sandbox::logs`] returns, as `os logs -n 500`. const LINES: u32 = 500; /// How long [`Sandbox::logs_until`] waits. The supervisor pushes its logs to /// the gateway in batches, so a line can appear a few seconds after the event. @@ -35,7 +35,7 @@ impl Logs { } /// Whether a line contains `needle` in its level, target, message, or a - /// field name or value, as `openshell logs` prints the line. + /// field name or value, as `os logs` prints the line. pub fn contains(&self, needle: &str) -> bool { self.lines .iter() @@ -43,7 +43,7 @@ impl Logs { } } -/// One line per log line, as `openshell logs` prints them. +/// One line per log line, as `os logs` prints them. impl fmt::Display for Logs { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for line in &self.lines { @@ -83,7 +83,7 @@ impl fmt::Display for Line<'_> { } impl Sandbox { - /// The last 500 lines the sandbox's supervisor logged, as `openshell logs + /// The last 500 lines the sandbox's supervisor logged, as `os logs /// -n 500 --source sandbox` returns them. pub async fn logs(&self) -> Result { let grpc = self.handles().grpc(); diff --git a/tests/tmachine/ansible/playbooks/drivers/podman/e2e.yaml b/tests/tmachine/ansible/playbooks/drivers/podman/e2e.yaml index a9270a0922..e66d087193 100644 --- a/tests/tmachine/ansible/playbooks/drivers/podman/e2e.yaml +++ b/tests/tmachine/ansible/playbooks/drivers/podman/e2e.yaml @@ -54,26 +54,26 @@ # the gateway as openshell, using the package default network and namespace. - name: Detect the installer ansible.builtin.stat: - path: /usr/local/bin/openshell + path: /usr/local/bin/os register: podman_e2e_binaries_cli - name: Select the gateway under test ansible.builtin.set_fact: podman_e2e_binaries: "{{ podman_e2e_binaries_cli.stat.exists }}" - podman_e2e_cli: "{{ '/usr/local/bin/openshell' if podman_e2e_binaries_cli.stat.exists else '/usr/bin/openshell' }}" + podman_e2e_cli: "{{ '/usr/local/bin/os' if podman_e2e_binaries_cli.stat.exists else '/usr/bin/os' }}" podman_e2e_gateway: "{{ 'tmachine' if podman_e2e_binaries_cli.stat.exists else 'openshell' }}" - name: Remove any previous OpenShell gateway registration when: podman_e2e_binaries ansible.builtin.command: - argv: [/usr/local/bin/openshell, gateway, remove, tmachine] + argv: [/usr/local/bin/os, gateway, remove, tmachine] changed_when: false failed_when: false - name: Register the configured OpenShell gateway when: podman_e2e_binaries ansible.builtin.command: - argv: [/usr/local/bin/openshell, gateway, add, http://127.0.0.1:17670, --local, --name, tmachine] + argv: [/usr/local/bin/os, gateway, add, http://127.0.0.1:17670, --local, --name, tmachine] - name: Run Podman E2E archive tests ansible.builtin.command: diff --git a/tests/tmachine/ansible/playbooks/openshell-k3s-ha.yaml b/tests/tmachine/ansible/playbooks/openshell-k3s-ha.yaml index 3518cc1a7f..f587dbf58d 100644 --- a/tests/tmachine/ansible/playbooks/openshell-k3s-ha.yaml +++ b/tests/tmachine/ansible/playbooks/openshell-k3s-ha.yaml @@ -95,7 +95,7 @@ - name: Remove baseline guest gateway registration become: false ansible.builtin.command: - argv: [/usr/local/bin/openshell, gateway, remove, tmachine] + argv: [/usr/local/bin/os, gateway, remove, tmachine] - name: Register guest gateway ansible.builtin.include_role: diff --git a/tests/tmachine/ansible/playbooks/openshell-k3s.yaml b/tests/tmachine/ansible/playbooks/openshell-k3s.yaml index 7a1fab8ed1..4e3a2f7f17 100644 --- a/tests/tmachine/ansible/playbooks/openshell-k3s.yaml +++ b/tests/tmachine/ansible/playbooks/openshell-k3s.yaml @@ -13,7 +13,7 @@ - name: Install OpenShell CLI ansible.builtin.copy: src: "{{ openshell_cli_binary }}" - dest: /usr/local/bin/openshell + dest: /usr/local/bin/os mode: "0755" - name: Create OpenShell artifact directory diff --git a/tests/tmachine/ansible/playbooks/openshell.yaml b/tests/tmachine/ansible/playbooks/openshell.yaml index 003c5df024..4749afe77b 100644 --- a/tests/tmachine/ansible/playbooks/openshell.yaml +++ b/tests/tmachine/ansible/playbooks/openshell.yaml @@ -13,7 +13,7 @@ become: true ansible.builtin.copy: src: "{{ openshell_cli_binary }}" - dest: /usr/local/bin/openshell + dest: /usr/local/bin/os mode: "0755" - name: Install OpenShell gateway diff --git a/tests/tmachine/ansible/playbooks/upgrade/deb.sh b/tests/tmachine/ansible/playbooks/upgrade/deb.sh index ddda1865f7..bb68595ade 100755 --- a/tests/tmachine/ansible/playbooks/upgrade/deb.sh +++ b/tests/tmachine/ansible/playbooks/upgrade/deb.sh @@ -22,7 +22,7 @@ diagnostics() { set +e echo "=== upgrade failed; diagnostics ===" >&2 dpkg-query --show --showformat='${Package} ${Version}\n' openshell >&2 - openshell --version >&2 + os --version >&2 systemctl --user status "${unit}" --no-pager >&2 journalctl --user -u "${unit}" --no-pager -n 100 >&2 sudo -n docker images >&2 @@ -47,6 +47,13 @@ if [ "${after}" != "${candidate}" ]; then exit 1 fi +# The CLI is os; the openshell command remains a link to it. +os --version >/dev/null +if [ "$(readlink -f "$(command -v openshell)")" != "$(readlink -f "$(command -v os)")" ]; then + echo "openshell does not resolve to the os binary after the upgrade" >&2 + exit 1 +fi + # Select the candidate's runtime images, which carry the tmachine tag. mkdir -p "${HOME}/.config/openshell" ( diff --git a/tests/tmachine/ansible/playbooks/upgrade/rpm.sh.j2 b/tests/tmachine/ansible/playbooks/upgrade/rpm.sh.j2 index 0952d98721..48d6b03b5f 100755 --- a/tests/tmachine/ansible/playbooks/upgrade/rpm.sh.j2 +++ b/tests/tmachine/ansible/playbooks/upgrade/rpm.sh.j2 @@ -40,7 +40,7 @@ diagnostics() { set +e echo "=== upgrade failed; diagnostics ===" >&2 versions_of openshell openshell-gateway >&2 - openshell --version >&2 + os --version >&2 as_gateway_user systemctl --user status "${unit}" --no-pager >&2 as_gateway_user journalctl --user -u "${unit}" --no-pager -n 100 >&2 as_gateway_user podman images >&2 @@ -92,6 +92,13 @@ if [ "${after}" != "${candidate}" ]; then exit 1 fi +# The CLI is os; the openshell command remains a link to it. +os --version >/dev/null +if [ "$(readlink -f "$(command -v openshell)")" != "$(readlink -f "$(command -v os)")" ]; then + echo "openshell does not resolve to the os binary after the upgrade" >&2 + exit 1 +fi + # Give the package's own restart a moment to show, then restart only if it # didn't happen. # TODO: measure whether the package's restart is already visible when dnf diff --git a/tests/tmachine/ansible/roles/openshell_diagnostics/files/collect-k3s.sh b/tests/tmachine/ansible/roles/openshell_diagnostics/files/collect-k3s.sh index 63e3193b21..734d4f0227 100644 --- a/tests/tmachine/ansible/roles/openshell_diagnostics/files/collect-k3s.sh +++ b/tests/tmachine/ansible/roles/openshell_diagnostics/files/collect-k3s.sh @@ -65,8 +65,8 @@ collect_log() { -o 'custom-columns=NAME:.metadata.name,UID:.metadata.uid,PHASE:.status.phase,CONDITIONS:.status.conditions,CONTAINERS:.status.containerStatuses' collect 'Gateway Services' /usr/local/bin/k3s kubectl --request-timeout=5s -n openshell get services \ -o 'custom-columns=NAME:.metadata.name,TYPE:.spec.type,CLUSTERIP:.spec.clusterIP,SELECTOR:.spec.selector,PORTS:.spec.ports' - collect 'Test client gateway registrations' runuser -u tmachine -- openshell gateway list --output json - collect 'Test client gateway status' runuser -u tmachine -- openshell status --output json + collect 'Test client gateway registrations' runuser -u tmachine -- os gateway list --output json + collect 'Test client gateway status' runuser -u tmachine -- os status --output json collect 'Endpoint readiness' /usr/local/bin/k3s kubectl --request-timeout=5s -n openshell get endpointslices \ -o 'custom-columns=NAME:.metadata.name,PORTS:.ports,ADDRESSES:.endpoints[*].addresses,CONDITIONS:.endpoints[*].conditions' collect 'Gateway events' /usr/local/bin/k3s kubectl --request-timeout=5s -n openshell get events --sort-by=.lastTimestamp diff --git a/tests/tmachine/artifacts.nix b/tests/tmachine/artifacts.nix index f28d7b1444..9e4539cce3 100644 --- a/tests/tmachine/artifacts.nix +++ b/tests/tmachine/artifacts.nix @@ -180,7 +180,7 @@ rec { # Fail as the release does if a musl binary is not fully static. tasks/scripts/verify-static-binary.sh \ - target/${muslToolchain.target}/debug/openshell \ + target/${muslToolchain.target}/debug/os \ target/${muslToolchain.target}/debug/openshell-sandbox \ target/${muslToolchain.target}/debug/openshell-prover @@ -191,8 +191,8 @@ rec { -p openshell-supervisor install -D -m 0755 \ - target/${muslToolchain.target}/debug/openshell \ - artifacts/binaries/${muslToolchain.target}/openshell + target/${muslToolchain.target}/debug/os \ + artifacts/binaries/${muslToolchain.target}/os install -D -m 0755 \ target/${muslToolchain.target}/debug/openshell-sandbox \ @@ -382,7 +382,7 @@ rec { cd "$root" package_version="''${OPENSHELL_DEB_VERSION:-0.0.0-local}" - OPENSHELL_CLI_BINARY="$root/artifacts/binaries/${muslToolchain.target}/openshell" \ + OPENSHELL_CLI_BINARY="$root/artifacts/binaries/${muslToolchain.target}/os" \ OPENSHELL_GATEWAY_BINARY="$root/artifacts/binaries/${gnuToolchain.target}/openshell-gateway" \ OPENSHELL_PROVER_BINARY="$root/artifacts/binaries/${muslToolchain.target}/openshell-prover" \ OPENSHELL_DRIVER_VM_BINARY="$root/artifacts/binaries/${gnuToolchain.target}/openshell-driver-vm" \ @@ -421,7 +421,7 @@ rec { rpm_release="''${OPENSHELL_RPM_RELEASE:-$(python3 tasks/scripts/release.py get-version --dev --rpm-release)}" for binary in \ - artifacts/binaries/${muslToolchain.target}/openshell \ + artifacts/binaries/${muslToolchain.target}/os \ artifacts/binaries/${gnuToolchain.target}/openshell-gateway \ artifacts/binaries/${gnuToolchain.target}/openshell-driver-podman \ artifacts/binaries/${gnuToolchain.target}/openshell-driver-docker \ @@ -441,7 +441,7 @@ rec { | docker run --rm -i \ --platform linux/${dockerArch} \ --volume "$root:/repo:ro" \ - --volume "$root/artifacts/binaries/${muslToolchain.target}/openshell:/binaries/openshell:ro" \ + --volume "$root/artifacts/binaries/${muslToolchain.target}/os:/binaries/os:ro" \ --volume "$root/artifacts/binaries/${gnuToolchain.target}/openshell-gateway:/binaries/openshell-gateway:ro" \ --volume "$root/artifacts/binaries/${gnuToolchain.target}/openshell-driver-podman:/binaries/openshell-driver-podman:ro" \ --volume "$root/artifacts/binaries/${gnuToolchain.target}/openshell-driver-docker:/binaries/openshell-driver-docker:ro" \ diff --git a/tests/tmachine/config.nix b/tests/tmachine/config.nix index 78558ab064..29e2850b7b 100644 --- a/tests/tmachine/config.nix +++ b/tests/tmachine/config.nix @@ -92,7 +92,7 @@ let e2ePythonImage = "../../artifacts/images/openshell-e2e-python-dev.tar"; k3sInputs = { agent_sandbox_version = "0.5.0"; - openshell_cli_binary = "../../artifacts/binaries/${muslTarget}/openshell"; + openshell_cli_binary = "../../artifacts/binaries/${muslTarget}/os"; openshell_e2e_python_image = e2ePythonImage; openshell_gateway_image = "../../artifacts/images/openshell-gateway-tmachine.tar"; openshell_helm_chart = "../../artifacts/helm/openshell-0.0.0.tgz"; @@ -241,7 +241,7 @@ let "ansible/playbooks/gateway.yaml" ]; inputs = { - openshell_cli_binary = "../../artifacts/binaries/${muslTarget}/openshell"; + openshell_cli_binary = "../../artifacts/binaries/${muslTarget}/os"; openshell_gateway_binary = "../../artifacts/binaries/${gnuTarget}/openshell-gateway"; openshell_e2e_python_image = e2ePythonImage; openshell_supervisor_image = "../../artifacts/images/openshell-supervisor-tmachine.tar"; From dd23d1d459989e47027a34d8cb2a8ee51ba51a94 Mon Sep 17 00:00:00 2001 From: Jim Meyer Date: Thu, 3 Dec 2026 12:16:35 -0800 Subject: [PATCH 2/3] docs: use the os command in docs, skills, and examples Document the rename on the installation page, including the snap's `openshell.os` app and `os` alias and the variable that hides the rename notice. Snap instructions keep `openshell`, which runs the CLI without the notice until the Store grants the `os` alias. Completion help writes the files that bash, fish, and zsh load for `os`. Signed-off-by: Jim Meyer --- .agents/agents/gator/README.md | 2 +- .../build-openshell-mxc-windows/SKILL.md | 6 +- .agents/skills/create-github-pr/SKILL.md | 2 +- .agents/skills/helm-dev-environment/SKILL.md | 18 +- .../skills/launch-openshell-gator/SKILL.md | 24 +- .agents/skills/test-release-canary/SKILL.md | 8 +- .agents/skills/tui-development/SKILL.md | 24 +- CONTRIBUTING.md | 12 +- README.md | 2 +- TESTING.md | 4 +- crates/openshell-cli/src/main.rs | 8 +- crates/openshell-driver-vm/README.md | 2 +- deploy/man/openshell-gateway.8.md | 4 +- docs/CONTRIBUTING.mdx | 2 +- docs/_components/CommandTerminal.tsx | 2 +- docs/about/installation.mdx | 6 +- docs/about/run-your-first-agent.mdx | 14 +- docs/about/support-matrix.mdx | 2 +- docs/extensibility/drivers.mdx | 2 +- docs/extensibility/overview.mdx | 2 +- docs/how-it-works/gateways/authentication.mdx | 26 +- docs/how-it-works/gateways/configuration.mdx | 16 +- .../gateways/container-deployment.mdx | 22 +- docs/how-it-works/gateways/overview.mdx | 46 +-- docs/how-it-works/inference.mdx | 42 +-- docs/how-it-works/policies/advisor.mdx | 26 +- docs/how-it-works/policies/cedar.mdx | 14 +- docs/how-it-works/policies/default-policy.mdx | 8 +- .../how-it-works/policies/manage-policies.mdx | 82 ++--- docs/how-it-works/policies/network-rules.mdx | 26 +- docs/how-it-works/policies/prover.mdx | 2 +- docs/how-it-works/policies/schema.mdx | 4 +- docs/how-it-works/providers/aws.mdx | 14 +- docs/how-it-works/providers/google.mdx | 42 +-- docs/how-it-works/providers/overview.mdx | 76 ++--- docs/how-it-works/providers/profiles.mdx | 144 ++++----- docs/how-it-works/sandboxes/overview.mdx | 194 ++++++------ docs/how-it-works/sandboxes/runtimes.mdx | 14 +- docs/how-it-works/sandboxes/templates.mdx | 16 +- docs/how-it-works/workspaces.mdx | 48 +-- docs/index.mdx | 2 +- docs/kubernetes/access-control.mdx | 2 +- docs/kubernetes/high-availability.mdx | 6 +- docs/kubernetes/ingress.mdx | 14 +- docs/kubernetes/openshift.mdx | 12 +- docs/kubernetes/setup.mdx | 4 +- docs/kubernetes/workspaces.mdx | 6 +- docs/observability/accessing-logs.mdx | 12 +- docs/observability/ocsf-json-export.mdx | 10 +- docs/observability/overview.mdx | 6 +- docs/security/best-practices.mdx | 10 +- docs/tutorials/first-network-policy.mdx | 14 +- docs/tutorials/github-push-access.mdx | 30 +- .../microsoft-graph-provider-refresh.mdx | 14 +- docs/tutorials/run-pi-with-openrouter.mdx | 24 +- docs/upgrade/0-1-0.mdx | 10 +- e2e/rust/src/harness/binary.rs | 2 +- skills/debug-inference/SKILL.md | 28 +- skills/debug-openshell-cluster/SKILL.md | 54 ++-- .../references/supervisor-middleware.md | 2 +- skills/generate-sandbox-policy/SKILL.md | 8 +- skills/openshell-cli/SKILL.md | 294 +++++++++--------- 62 files changed, 787 insertions(+), 785 deletions(-) diff --git a/.agents/agents/gator/README.md b/.agents/agents/gator/README.md index 93ada2e640..68019ff1b6 100644 --- a/.agents/agents/gator/README.md +++ b/.agents/agents/gator/README.md @@ -21,7 +21,7 @@ The agent-root entry point is `.agents/agents/gator/run.sh`. "Run gator on PR 1536 and keep watching until it closes or merges." ``` -By default the launcher uses `.agents/agents/gator/Dockerfile` as the sandbox image source. It builds `.agents/agents/gator/` as the image context, so gator-specific image files such as `policy.yaml` and `bin/gh` stay with the gator agent. The launcher bakes a task-independent prompt template, skills, subagents, and shared runtime files into `/etc/openshell/agent-payload`, then passes the resulting image reference to `openshell sandbox create`. +By default the launcher uses `.agents/agents/gator/Dockerfile` as the sandbox image source. It builds `.agents/agents/gator/` as the image context, so gator-specific image files such as `policy.yaml` and `bin/gh` stay with the gator agent. The launcher bakes a task-independent prompt template, skills, subagents, and shared runtime files into `/etc/openshell/agent-payload`, then passes the resulting image reference to `os sandbox create`. The PR assignment, operator test authorization, harness selection, watch mode, and polling interval are runtime inputs, not rendered image contents. The launcher supplies the non-secret assignment as `OPENSHELL_AGENT_TASK` in the canonical process command. The supervisor assembles the prompt once in memory and sends it to each harness cycle on stdin; cycles do not read task instructions from an agent-writable file. Assignment text is literal data, so shell syntax and template tokens inside it are not evaluated. Do not put credentials in assignments; use providers. Runtime command metadata can contain the assignment. This separates reusable tooling from per-run instructions; it does not make prompt instructions a security boundary. diff --git a/.agents/skills/build-openshell-mxc-windows/SKILL.md b/.agents/skills/build-openshell-mxc-windows/SKILL.md index 04eb87ae57..438f5d2dac 100644 --- a/.agents/skills/build-openshell-mxc-windows/SKILL.md +++ b/.agents/skills/build-openshell-mxc-windows/SKILL.md @@ -117,7 +117,7 @@ In scope: - Refreshing a Windows checkout to the latest upstream GitHub `windows`. - Maintaining `tasks/windows.toml` and `tasks/scripts/windows-msvc.ps1`. - Running x64 and ARM64 MSVC checks. -- Building x64 and ARM64 release binaries for `openshell-gateway`, `openshell`, +- Building x64 and ARM64 release binaries for `openshell-gateway`, `os`, `openshell-supervisor`, and `openshell-windows-sandbox`. - Running workspace tests on a native x64 or ARM64 host. - Running focused unsupported-driver contract tests. @@ -451,7 +451,7 @@ suite, and report a verified unsupported-host rejection independently from positive admission coverage. The real `forwarding` E2E scenario uses a native test-only echo agent inside MXC and -`openshell forward service` to verify two exact request/reply exchanges through +`os forward service` to verify two exact request/reply exchanges through the gateway, supervisor, and boundary. Dynamic ports and a per-workload nonce avoid mistaking unrelated listeners for success. This is managed-ingress coverage, not evidence that direct host ingress is fenced. Use @@ -461,7 +461,7 @@ using `windows:build:mxc-fixtures` (or its `:x64` / `:arm64` variant). This fixt is not one of the four production deliverables; do not package it in releases. The `service-forwarding` scenario uses its HTTP mode to test named endpoint exposure, two exact GET responses through gateway routing, and HTTP 404 after -endpoint deletion. This is distinct from `openshell forward service`; neither +endpoint deletion. This is distinct from `os forward service`; neither scenario tests file upload or exclusive ingress enforcement. The real integration HTTPS test runs the same authenticated gateway harness with diff --git a/.agents/skills/create-github-pr/SKILL.md b/.agents/skills/create-github-pr/SKILL.md index 22c6af5277..e5e46232cf 100644 --- a/.agents/skills/create-github-pr/SKILL.md +++ b/.agents/skills/create-github-pr/SKILL.md @@ -203,7 +203,7 @@ gh pr create \ --body "$(cat <<'EOF' ## Summary -Add `--page-size` and `--page-token` flags to `openshell sandbox list` for continuation-token pagination. +Add `--page-size` and `--page-token` flags to `os sandbox list` for continuation-token pagination. ## Related Issue diff --git a/.agents/skills/helm-dev-environment/SKILL.md b/.agents/skills/helm-dev-environment/SKILL.md index 170bdd7c16..1854c10edb 100644 --- a/.agents/skills/helm-dev-environment/SKILL.md +++ b/.agents/skills/helm-dev-environment/SKILL.md @@ -223,9 +223,9 @@ Both members share the single k3d node, so exercise Pod failures: ```bash export KUBECONFIG=kubeconfig OPENSHELL_GATEWAY_ENDPOINT=https://localhost:8090 -openshell sandbox create --detach --name ha-probe -- sh -c 'echo $$ > /sandbox/main.pid; exec sleep infinity' -openshell sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid -openshell sandbox get ha-probe # note the sandbox ID +os sandbox create --detach --name ha-probe -- sh -c 'echo $$ > /sandbox/main.pid; exec sleep infinity' +os sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid +os sandbox get ha-probe # note the sandbox ID # Supervisor logs name the instance by its route, not its sandbox ID. kubectl get sandboxes.agents.x-k8s.io -A -l openshell.ai/sandbox-name=ha-probe \ -o jsonpath='{.items[0].metadata.annotations.openshell\.ai/sandbox-runtime-supervisor-session}' @@ -238,7 +238,7 @@ kubectl -n openshell logs -l app.kubernetes.io/name=openshell,app.kubernetes.io/ -c openshell-gateway --prefix --tail=200 | grep 'taking over a shared sandbox instance' kubectl -n openshell logs -l openshell.ai/sandbox-id=,openshell.ai/boundary-role=workload \ --tail=200 | grep -E 'sandbox-supervisor-|Supervisor takeover confirmed' -openshell sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid # same PID +os sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid # same PID ``` A plain `kubectl delete pod` exercises the graceful leave instead: the member @@ -387,13 +387,13 @@ active, so the forwarding task uses local port `8090` for the gateway. In a second terminal, confirm that the gateway is registered and active: ```bash -openshell gateway list +os gateway list ``` **Plaintext (default Skaffold deploy):** ```bash -openshell sandbox list +os sandbox list ``` **With mTLS enabled** — extract the client cert the PKI hook wrote to the cluster, @@ -413,7 +413,7 @@ The server cert SANs include `localhost` and `127.0.0.1`, so hostname verificati passes over a port-forward without any extra flags: ```bash -openshell sandbox list --gateway-endpoint https://localhost:8090 +os sandbox list --gateway-endpoint https://localhost:8090 ``` --- @@ -481,12 +481,12 @@ KUBECONFIG=kubeconfig kubectl get svc -A \ -l gateway.envoyproxy.io/owning-gateway-name=openshell KUBECONFIG=kubeconfig kubectl -n port-forward \ svc/ 8080:80 -openshell gateway add http://127.0.0.1:8080 --name openshell --local +os gateway add http://127.0.0.1:8080 --name openshell --local ``` When running e2e tests manually through Envoy, register gateway metadata (as above) instead of relying only on `OPENSHELL_GATEWAY_ENDPOINT`; some tests call -`openshell gateway info` and expect metadata for the active gateway. +`os gateway info` and expect metadata for the active gateway. ### Kubernetes E2E Notes diff --git a/.agents/skills/launch-openshell-gator/SKILL.md b/.agents/skills/launch-openshell-gator/SKILL.md index 0a6f187424..6eb9f1bedf 100644 --- a/.agents/skills/launch-openshell-gator/SKILL.md +++ b/.agents/skills/launch-openshell-gator/SKILL.md @@ -57,7 +57,7 @@ command -v jq command -v ruby ``` -The local `openshell` wrapper may recompile the CLI. If that fails, fix the local build or ask the operator before changing unrelated source. +The local `os` wrapper may recompile the CLI. If that fails, fix the local build or ask the operator before changing unrelated source. ### Step 3: Verify GitHub Auth @@ -103,13 +103,13 @@ the runtime task contract; legacy baked-task images fail startup. See Use the target gateway from the operator request or current session context. Do not assume a gateway name. If the operator did not specify one, list registered gateways and ask before launching when the correct target is ambiguous. ```bash -openshell gateway list +os gateway list gateway_name="" [[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; } -openshell --gateway "$gateway_name" status -openshell --gateway "$gateway_name" sandbox list +os --gateway "$gateway_name" status +os --gateway "$gateway_name" sandbox list ``` Expected result: status returns successfully and sandbox listing completes. If the gateway is unreachable, the runtime cannot create sandboxes, or sandbox listing hangs, switch to `debug-openshell-cluster` and fix the gateway before launching gator. @@ -122,7 +122,7 @@ Avoid duplicate gators for the same PR unless intentionally replacing a stuck or gateway_name="" [[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; } -openshell --gateway "$gateway_name" sandbox list +os --gateway "$gateway_name" sandbox list ``` Look for names like `gtr-pr--watch`. If one exists, inspect its log before deleting or relaunching. @@ -131,7 +131,7 @@ Look for names like `gtr-pr--watch`. If one exists, inspect its log befo Never paste raw operator text into shell arguments such as `--gateway`, `--name`, `--from`, issue numbers, or PR numbers. Normalize values before constructing launch commands. -Use the operator-specified gateway or a gateway selected from `openshell gateway list`: +Use the operator-specified gateway or a gateway selected from `os gateway list`: ```bash gateway_name="" @@ -180,7 +180,7 @@ sandbox_name="gtr-pr-${pr_number}-watch" The launcher queries the gateway's selected compute driver and prepares the image through the selected build/import/publish or prebuilt path before importing provider profiles, configuring provider credentials and refresh, and starting the agent supervisor as the sandbox's canonical main process. The detached main process survives loss of the host CLI connection and reconnects to a restarted gateway. Unless `--keep` is set, the sandbox is marked ephemeral so the gateway deletes it after the canonical main process exits and its terminal result is finalized. `CONTAINER_ENGINE`, when set, must match Docker/Podman gateways or Docker for k3d imports; registry builds for Kubernetes may use either local engine. -The launcher streams image-build and provisioning output until the detached workload is ready, then exits. Use `openshell logs ` or the TUI for runtime output. +The launcher streams image-build and provisioning output until the detached workload is ready, then exits. Use `os logs ` or the TUI for runtime output. ### Launch An Issue Or Issue/PR Pair @@ -325,11 +325,11 @@ sandbox_name="" [[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; } [[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; } -openshell --gateway "$gateway_name" sandbox list -openshell --gateway "$gateway_name" sandbox get "$sandbox_name" +os --gateway "$gateway_name" sandbox list +os --gateway "$gateway_name" sandbox get "$sandbox_name" ``` -If `sandbox get` is not supported by the local CLI shape, use `openshell sandbox --help` and follow the current command help. +If `sandbox get` is not supported by the local CLI shape, use `os sandbox --help` and follow the current command help. ### Interpret Common Sentinels @@ -365,7 +365,7 @@ sandbox_name="" [[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; } [[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; } -openshell --gateway "$gateway_name" sandbox delete "$sandbox_name" +os --gateway "$gateway_name" sandbox delete "$sandbox_name" ./.agents/agents/gator/run.sh \ --gateway "$gateway_name" \ --name "$sandbox_name" \ @@ -379,7 +379,7 @@ When relaunching after a same-SHA infrastructure failure, say that the prior att ### Gateway Unreachable -Symptoms: `openshell status` fails, `sandbox list` fails, sandbox remains pending, image build never starts. +Symptoms: `os status` fails, `sandbox list` fails, sandbox remains pending, image build never starts. Action: load `debug-openshell-cluster` and diagnose the gateway/driver. Do not keep retrying gator launches against a dead gateway. diff --git a/.agents/skills/test-release-canary/SKILL.md b/.agents/skills/test-release-canary/SKILL.md index cda617194f..b277bd1f7f 100644 --- a/.agents/skills/test-release-canary/SKILL.md +++ b/.agents/skills/test-release-canary/SKILL.md @@ -119,8 +119,8 @@ kubectl wait --namespace openshell \ --timeout=300s kubectl port-forward --namespace openshell svc/openshell 8080:8080 & -openshell gateway add http://127.0.0.1:8080 --local --name kind -openshell status +os gateway add http://127.0.0.1:8080 --local --name kind +os status ``` Keep `pkiInitJob.enabled=true` (the chart default), even when @@ -137,13 +137,13 @@ Loopback registration auto-derives the gateway name to `openshell` if `--name` i |---|---|---| | `macos`/`ubuntu-deb`/`fedora` job fails on `install.sh` | Dev release missing an asset, checksum mismatch, or `install.sh` regression on this branch. | Job log around the `curl … install.sh \| sh` step. | | Sandbox create or exec fails | Published sandbox and supervisor artifacts are missing, incompatible, or cannot establish the protected runtime channel. | Gateway logs plus Docker, Podman, VM, snap, or Kubernetes runtime diagnostics for the job. | -| `macos`/`ubuntu-deb`/`fedora` job fails on `openshell status` | Local gateway service did not start (systemd/brew/podman). Often a driver issue. | Service logs in the job log; `OPENSHELL_COMPUTE_DRIVER` env in the "Ensure …" step. | +| `macos`/`ubuntu-deb`/`fedora` job fails on `os status` | Local gateway service did not start (systemd/brew/podman). Often a driver issue. | Service logs in the job log; `OPENSHELL_COMPUTE_DRIVER` env in the "Ensure …" step. | | `ubuntu-snap-system-docker` fails during `install.sh` | System Docker was unavailable to the runner user, the edge revision or automatic interfaces were unavailable, or the user gateway did not become reachable. | Failure diagnostics dump system Docker, snap service/connection/change state, user and legacy gateway journals, snap logs, and port 17670 listeners. | | `ubuntu-snap-system-docker` fails during the prover checks | The prover artifact is missing or packaged for the wrong architecture, `openshell.prover` is not exposed, missing the alias to `openshell-prover`, or not permitted to read the test policies, or its solver linkage is not runnable. | The `Install and check status` and `Check a policy boundary with the snap prover` steps, plus `snap info openshell` and `snap connections openshell`. | | `ubuntu-snap-docker-preflight` unexpectedly succeeds | The installer no longer fails before installing the OpenShell snap when Docker is absent or supplied by the Docker snap. | Inspect `install.log`, `docker-snap.log`, `snap list`, and snapd changes. | | `kubernetes` job fails on `helm install --wait` | Chart did not deploy in 5 min — usually image pull failure or readiness probe failing. | "Diagnostics on failure" step dumps `helm status`, manifest, pod describe, pod logs. | | `kubernetes` job fails on `kubectl wait` | Gateway pod stuck `CrashLoopBackOff` or `ImagePullBackOff`. | Diagnostics dump; check `:dev` image existence at `quay.io/ai-openshell/gateway`. | -| `kubernetes` job fails on `openshell gateway add` or `status` | Port-forward not reachable, or CLI/gateway proto mismatch. | `port-forward.log` and `openshell gateway list` in the diagnostics dump. | +| `kubernetes` job fails on `os gateway add` or `status` | Port-forward not reachable, or CLI/gateway proto mismatch. | `port-forward.log` and `os gateway list` in the diagnostics dump. | The `kubernetes` job's diagnostics step (only runs `if: failure()`) emits, in order: helm status, rendered manifest, `kubectl get all`, pod descriptions, pod logs (200 lines per container), port-forward log, gateway list, CLI version. Read it top-to-bottom — most failures fall out by the manifest or pod logs. diff --git a/.agents/skills/tui-development/SKILL.md b/.agents/skills/tui-development/SKILL.md index cae3b3ef5e..987d8db3c2 100644 --- a/.agents/skills/tui-development/SKILL.md +++ b/.agents/skills/tui-development/SKILL.md @@ -13,7 +13,7 @@ Comprehensive reference for any agent working on the OpenShell TUI. The OpenShell TUI is a ratatui-based terminal UI for the OpenShell platform. It provides a keyboard-driven interface for managing gateways, sandboxes, and logs — the same operations available via the `openshell` CLI, but with a live, interactive dashboard. -- **Launched via:** `openshell term` or `mise run term` +- **Launched via:** `os term` or `mise run term` - **Crate:** `crates/openshell-tui/` - **Key dependencies:** - `ratatui` (workspace version) — uses `frame.area()` for the drawable terminal area @@ -170,7 +170,7 @@ Phase 1: GetSandboxLogs → 500 initial lines → send via Event::LogLines Phase 2: WatchSandbox(follow_logs: true) → live tail → send via Event::LogLines ``` -**Sandboxes**: Fetched via `ListSandboxes` in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow `next_page_token` until empty so the dashboard reflects the complete collection. The NOTES column summarizes active `ConfigurationInvalid` readiness conditions as `Invalid config` before port forwards and clears the note on refresh after repair. Full diagnostics remain available through `openshell sandbox get -o json`. Timed-out provisioning attempts show `Provisioning timed out` with cleanup pending or compute reclaimed, preserving port forwards. The sandbox detail pane wraps the full configuration error in its Notes field. +**Sandboxes**: Fetched via `ListSandboxes` in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow `next_page_token` until empty so the dashboard reflects the complete collection. The NOTES column summarizes active `ConfigurationInvalid` readiness conditions as `Invalid config` before port forwards and clears the note on refresh after repair. Full diagnostics remain available through `os sandbox get -o json`. Timed-out provisioning attempts show `Provisioning timed out` with cleanup pending or compute reclaimed, preserving port forwards. The sandbox detail pane wraps the full configuration error in its Notes field. **Providers**: Fetched via `ListProviders` in the background collection-refresh task. Provider profiles are fetched per-workspace via `ListProviderProfiles` and cached in a `ProviderProfileCache` keyed by `(workspace, profile_id)`. Follow each list RPC's `next_page_token` until empty. @@ -232,7 +232,7 @@ Colors and styles are defined in `crates/openshell-tui/src/theme.rs` via the `Th Theme mode is controlled by three mechanisms (highest priority first): -1. `--theme dark|light|auto` CLI flag on `openshell term` +1. `--theme dark|light|auto` CLI flag on `os term` 2. `OPENSHELL_THEME` environment variable 3. Auto-detection via `COLORFGBG` env var (falls back to dark) @@ -315,18 +315,18 @@ The `confirm_delete` flag in `App` gates destructive key handling — while true ### CLI parity -TUI actions should parallel `openshell` CLI commands so users have familiar mental models: +TUI actions should parallel `os` CLI commands so users have familiar mental models: | CLI Command | TUI Equivalent | | --- | --- | -| `openshell sandbox list` | Sandbox table on Dashboard | -| `openshell sandbox delete ` | `[d]` on sandbox detail, then `[y]` to confirm | -| `openshell sandbox create` | `[c]` on sandbox panel to open create form | -| `openshell sandbox connect` | `[s]` on sandbox policy view to launch SSH shell | -| `openshell logs ` | `[l]` on sandbox detail to open log viewer | -| `openshell provider list` | Provider table on Dashboard (middle pane) | -| `openshell provider create` | `[c]` on provider panel | -| `openshell status` | Status in title bar + gateway list | +| `os sandbox list` | Sandbox table on Dashboard | +| `os sandbox delete ` | `[d]` on sandbox detail, then `[y]` to confirm | +| `os sandbox create` | `[c]` on sandbox panel to open create form | +| `os sandbox connect` | `[s]` on sandbox policy view to launch SSH shell | +| `os logs ` | `[l]` on sandbox detail to open log viewer | +| `os provider list` | Provider table on Dashboard (middle pane) | +| `os provider create` | `[c]` on provider panel | +| `os status` | Status in title bar + gateway list | When adding new TUI features, check what the CLI offers and maintain consistency. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index deba2e2729..2f59993863 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,7 +86,7 @@ Public skills live in `skills/` and work without an OpenShell source checkout. I | `debug-inference` | Diagnose attached-provider inference, native endpoints, and migration from the retired managed endpoint | | `generate-sandbox-policy` | Generate YAML sandbox policies from requirements or API documentation | -Public skills use `openshell --help` for installed command syntax and published OpenShell documentation for product concepts and configuration. They must not depend on repository-relative source or documentation files. +Public skills use `os --help` for installed command syntax and published OpenShell documentation for product concepts and configuration. They must not depend on repository-relative source or documentation files. ### Agent Skills for Contributors @@ -360,18 +360,18 @@ features, so use per-package checks to verify that Cedar is excluded. The `experimental` build flag includes Cedar. Build the gateway and supervisor with `--features experimental`, or use published Release Dev artifacts. -## Building the `openshell` CLI +## Building the `os` CLI -Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will +Inside this repository, `os` is a local shortcut script at `scripts/bin/os`. The script will 1. Build `openshell-cli` if needed. 2. Run the local debug CLI binary under `target/debug/os`. -Because `mise` adds `scripts/bin` to `PATH` for this project, you can run `openshell` directly from the repo. +Because `mise` adds `scripts/bin` to `PATH` for this project, you can run `os` directly from the repo. The deprecated `openshell` name links to the same script. ```bash -openshell --help -openshell sandbox create -- codex +os --help +os sandbox create -- codex ``` ### Rust build cache diff --git a/README.md b/README.md index 0752ddaf13..7f8cc59be9 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You need Linux, macOS on Apple Silicon, or Windows with WSL 2 (experimental), pl ```shell curl -LsSf https://raw.githubusercontent.com/ai-openshell/openshell/main/install.sh | sh -openshell sandbox create --name demo +os sandbox create --name demo ``` The installer sets up the CLI and a local gateway. The default sandbox image is minimal Ubuntu with no agent installed. To run a real agent, follow [Run Your First Agent](https://docs.nvidia.com/openshell/latest/about/run-your-first-agent): it runs OpenCode against a free OpenRouter model and shows how to approve new access as the agent needs it. diff --git a/TESTING.md b/TESTING.md index 741f7d8940..2c83baee4e 100644 --- a/TESTING.md +++ b/TESTING.md @@ -512,7 +512,7 @@ maintainer where to add it. Do not add new tests to `e2e/rust/`. You can edit or remove existing tests. See [Where a new test goes](#where-a-new-test-goes) for alternatives. -Rust-based e2e tests that exercise the `openshell` CLI binary as a subprocess. +Rust-based e2e tests that exercise the `os` CLI binary as a subprocess. They live in the `openshell-e2e` crate and use a shared harness for sandbox lifecycle management, output parsing, and cleanup. @@ -1017,7 +1017,7 @@ The harness (`e2e/rust/src/harness/`) provides: | Module | Purpose | |---|---| -| `binary` | Builds and resolves the `openshell` binary from the workspace | +| `binary` | Builds and resolves the `os` binary from the workspace | | `container` | Container-engine selection and support containers for proxy tests | | `gateway` | Managed gateway restart controls for gateway-owned e2e runs | | `sandbox` | `SandboxGuard` RAII type — creates sandboxes and deletes them on drop | diff --git a/crates/openshell-cli/src/main.rs b/crates/openshell-cli/src/main.rs index 93f2077524..3ed1105922 100644 --- a/crates/openshell-cli/src/main.rs +++ b/crates/openshell-cli/src/main.rs @@ -759,22 +759,22 @@ shell before testing whether completions are working. First, ensure that you install `bash-completion` using your package manager. mkdir -p ~/.local/share/bash-completion/completions - os completions bash > ~/.local/share/bash-completion/completions/openshell + os completions bash > ~/.local/share/bash-completion/completions/os On macOS with Homebrew (install bash-completion first): mkdir -p $(brew --prefix)/etc/bash_completion.d - os completions bash > $(brew --prefix)/etc/bash_completion.d/openshell.bash-completion + os completions bash > $(brew --prefix)/etc/bash_completion.d/os.bash-completion \x1b[1mFISH\x1b[0m mkdir -p ~/.config/fish/completions - os completions fish > ~/.config/fish/completions/openshell.fish + os completions fish > ~/.config/fish/completions/os.fish \x1b[1mZSH\x1b[0m mkdir -p ~/.zfunc - os completions zsh > ~/.zfunc/_openshell + os completions zsh > ~/.zfunc/_os Then add the following to your .zshrc before compinit: diff --git a/crates/openshell-driver-vm/README.md b/crates/openshell-driver-vm/README.md index f675fe3845..69e44e5347 100644 --- a/crates/openshell-driver-vm/README.md +++ b/crates/openshell-driver-vm/README.md @@ -331,7 +331,7 @@ The RPM gateway package is configured for the Podman driver. On Apple Silicon macOS, `install.sh` stages the generated `openshell.rb` formula from the selected release in the `nvidia/openshell` Homebrew tap. -Homebrew installs `openshell`, `openshell-gateway`, and the self-contained +Homebrew installs `os` (with an `openshell` link), `openshell-gateway`, and the self-contained `openshell-driver-vm` with its embedded native supervisor. It ad-hoc signs the driver with the Hypervisor entitlement in `post_install` and owns the `brew services` gateway lifecycle. The service also leaves `OPENSHELL_DRIVERS` unset diff --git a/deploy/man/openshell-gateway.8.md b/deploy/man/openshell-gateway.8.md index a9bf03771f..45a2a8f276 100644 --- a/deploy/man/openshell-gateway.8.md +++ b/deploy/man/openshell-gateway.8.md @@ -303,8 +303,8 @@ Start the gateway as a systemd user service: Check gateway health from the CLI: - openshell gateway add --local https://127.0.0.1:17670 - openshell status + os gateway add --local https://127.0.0.1:17670 + os status Override the API port in TOML: diff --git a/docs/CONTRIBUTING.mdx b/docs/CONTRIBUTING.mdx index 59ea16d927..58e50b9a26 100644 --- a/docs/CONTRIBUTING.mdx +++ b/docs/CONTRIBUTING.mdx @@ -127,7 +127,7 @@ These patterns are common in LLM-generated text and erode trust with technical r - Use `shell` code blocks for copyable CLI examples. Do not prefix commands with `$`: ```shell - openshell gateway add http://127.0.0.1:18080 --local --name local + os gateway add http://127.0.0.1:18080 --local --name local ``` - Use `text` code blocks for transcripts, log output, and examples that should not be copied verbatim. diff --git a/docs/_components/CommandTerminal.tsx b/docs/_components/CommandTerminal.tsx index 27247b7be1..892fc2546d 100644 --- a/docs/_components/CommandTerminal.tsx +++ b/docs/_components/CommandTerminal.tsx @@ -46,7 +46,7 @@ export function CommandTerminal({ command }: { command: string }) {
$ - openshell sandbox create + os sandbox create
diff --git a/docs/about/installation.mdx b/docs/about/installation.mdx index 4dae020cf3..8b34dc08ba 100644 --- a/docs/about/installation.mdx +++ b/docs/about/installation.mdx @@ -21,9 +21,11 @@ curl -LsSf https://raw.githubusercontent.com/ai-openshell/openshell/main/install The script picks a package for your platform and starts the gateway. Confirm the CLI can reach it: ```shell -openshell status +os status ``` +The CLI command is `os`. Earlier releases named it `openshell`. That name still runs the same command and prints a rename notice to standard error, and it will be removed in a future release. Set `OPENSHELL_SUPPRESS_RENAME_WARNING=1` to hide the notice in scripts you have not updated yet. + To install a specific release, set `OPENSHELL_VERSION` to a release tag. Release artifacts are also on the [GitHub Releases](https://github.com/ai-openshell/openshell/releases) page. ## Prerelease and Development Builds @@ -168,7 +170,7 @@ The global command prevents automatic activation for other users but does not st systemctl --user disable --now snap.openshell.user-gateway.service ``` -The snap installs the standalone policy prover as `openshell.prover` with an alias to `openshell-prover`. Installs of locally-built snaps will not have the alias. The prover reads local policy files through the `home` interface and does not connect to the gateway. +The snap installs the CLI as `openshell` and as `openshell.os` with an alias to `os`, and the standalone policy prover as `openshell.prover` with an alias to `openshell-prover`. Installs of locally-built snaps will not have the aliases. The snap's `openshell` command does not print the rename notice. The prover reads local policy files through the `home` interface and does not connect to the gateway. The gateway runs at `https://127.0.0.1:17670`. It reads `~/snap/openshell/common/.config/openshell/gateway.toml` when that file exists. Its database defaults to `~/snap/openshell/common/.local/state/openshell/gateway/openshell.db`, and its TLS material lives under `~/snap/openshell/common/.local/state/openshell/tls`. Register it from the same user account: diff --git a/docs/about/run-your-first-agent.mdx b/docs/about/run-your-first-agent.mdx index a5e00faba1..ef23598ca5 100644 --- a/docs/about/run-your-first-agent.mdx +++ b/docs/about/run-your-first-agent.mdx @@ -25,10 +25,10 @@ it and [create a provider](/how-it-works/providers/overview#create-a-provider) that stores its credentials. ```shell -openshell profile import \ +os profile import \ --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/openrouter.yaml -openshell provider create \ +os provider create \ --name openrouter \ --type openrouter \ --from-existing @@ -54,7 +54,7 @@ servers, or other destinations. provider, and pass the agent command after `--`: ```shell -openshell sandbox create \ +os sandbox create \ --name my-agent \ --from ghcr.io/anomalyco/opencode:latest \ --provider openrouter \ @@ -80,16 +80,16 @@ proposal to the gateway. The gateway checks each proposal with the List pending proposals from the host: ```shell -openshell rule get my-agent --status pending +os rule get my-agent --status pending ``` Approve a proposal when its rule matches the access you intend to grant, or reject it with a reason: ```shell -openshell rule approve my-agent --chunk-id +os rule approve my-agent --chunk-id -openshell rule reject my-agent \ +os rule reject my-agent \ --chunk-id \ --reason "Not needed for this task." ``` @@ -99,7 +99,7 @@ policy, so you can list them again and approve them one after another. To approve every pending proposal in one step, run: ```shell -openshell rule approve-all my-agent +os rule approve-all my-agent ``` `rule approve-all` skips proposals with a security flag unless you add diff --git a/docs/about/support-matrix.mdx b/docs/about/support-matrix.mdx index 73ba85efb7..5fbdb369ee 100644 --- a/docs/about/support-matrix.mdx +++ b/docs/about/support-matrix.mdx @@ -57,7 +57,7 @@ OpenShell publishes multi-architecture gateway images for `linux/amd64` and `lin | Windows (WSL 2 + Docker Desktop) | x86_64 | Experimental | | [Native Windows (MXC)](#windows) | x86_64 and ARM64 | `windows` branch | -On Linux, the `openshell` CLI is a static musl binary and does not require glibc at runtime. +On Linux, the `os` CLI is a static musl binary and does not require glibc at runtime. ### Windows diff --git a/docs/extensibility/drivers.mdx b/docs/extensibility/drivers.mdx index 5dc88b76d5..c0a56aa468 100644 --- a/docs/extensibility/drivers.mdx +++ b/docs/extensibility/drivers.mdx @@ -61,7 +61,7 @@ socket_path = "/run/openshell/example-compute.sock" ``` Start the driver, then start or restart the gateway with this configuration. Use -`openshell gateway info` from a CLI connected to that gateway to verify the +`os gateway info` from a CLI connected to that gateway to verify the active driver and negotiated capabilities. See the [Extension Driver configuration reference](/how-it-works/gateways/configuration#extension-driver) for configuration details. diff --git a/docs/extensibility/overview.mdx b/docs/extensibility/overview.mdx index d252f62e34..ea2ed5c23a 100644 --- a/docs/extensibility/overview.mdx +++ b/docs/extensibility/overview.mdx @@ -125,7 +125,7 @@ For example, a supervisor middleware `Describe` response includes: } ``` -Use `openshell gateway info` to inspect the negotiated extension families, +Use `os gateway info` to inspect the negotiated extension families, implementation versions, protocol versions, and capabilities active on a gateway. diff --git a/docs/how-it-works/gateways/authentication.mdx b/docs/how-it-works/gateways/authentication.mdx index 9c05a5bf5d..53cf9f29fe 100644 --- a/docs/how-it-works/gateways/authentication.mdx +++ b/docs/how-it-works/gateways/authentication.mdx @@ -25,9 +25,9 @@ The CLI loads gateway metadata from `~/.config/openshell/gateways//metadat ## Authentication Status -`openshell status` reports gateway reachability and authentication separately. The public health RPC determines whether the gateway is connected and supplies its version. The CLI then calls the existing protected gateway-info capability query to verify the configured credentials. An authorization denial still confirms that the gateway authenticated the caller. +`os status` reports gateway reachability and authentication separately. The public health RPC determines whether the gateway is connected and supplies its version. The CLI then calls the existing protected gateway-info capability query to verify the configured credentials. An authorization denial still confirms that the gateway authenticated the caller. -For example, an expired bearer token can produce `Status: Connected` and `Authentication: Failed`. This means the gateway is healthy but protected commands cannot use the current credentials. Run `openshell gateway login ` to re-authenticate. When a gateway predates the gateway-info capability query, the CLI reports `Authentication: Unverified` rather than treating a successful public health check as proof of authentication. +For example, an expired bearer token can produce `Status: Connected` and `Authentication: Failed`. This means the gateway is healthy but protected commands cannot use the current credentials. Run `os gateway login ` to re-authenticate. When a gateway predates the gateway-info capability query, the CLI reports `Authentication: Unverified` rather than treating a successful public health check as proof of authentication. ## Authentication Modes @@ -51,7 +51,7 @@ Set these environment variables before starting the gateway: For local access, the server certificate must be valid for the endpoint the CLI uses. Include `localhost`, `127.0.0.1`, and `::1` in the certificate SANs when users connect to a local gateway through loopback. Package-managed local gateways generate this bundle automatically for the `openshell` gateway name. Homebrew registers `https://localhost:17670`; Debian and RPM use `https://127.0.0.1:17670`. -When you register a package-managed local gateway with `openshell gateway add --local --name openshell`, the CLI refreshes its mTLS bundle from the package-managed TLS directory. +When you register a package-managed local gateway with `os gateway add --local --name openshell`, the CLI refreshes its mTLS bundle from the package-managed TLS directory. On Homebrew, the gateway service also mirrors the gateway CA into `$HOME/.local/state/openshell/homebrew/tls` before startup so Docker Desktop can bind-mount gateway trust into supervisor containers. The driver does not mount the user client certificate or private key. The CLI loads its mTLS bundle from `~/.config/openshell/gateways//mtls/`: @@ -201,14 +201,14 @@ HTTP hostname or non-loopback address. Register an OIDC gateway with the CLI: ```shell -openshell gateway add https://gateway.example.com \ +os gateway add https://gateway.example.com \ --name production \ --oidc-issuer https://idp.example.com/realms/openshell \ --oidc-client-id openshell-cli \ --oidc-audience openshell-cli ``` -When you register or log in to an OIDC gateway, the CLI uses the Authorization Code flow with PKCE. It opens a browser, receives the authorization code on a localhost callback, exchanges the code for tokens, and stores the token bundle under the gateway credential directory. After `openshell gateway logout`, the next browser login asks the identity provider for a fresh login prompt so you can choose a different browser user instead of silently reusing the previous session. If `OPENSHELL_OIDC_CLIENT_SECRET` is set, the CLI uses the client credentials flow instead. Use that mode for CI and other non-interactive automation. The CLI renews an expired client credentials token by repeating the grant, so keep the variable set for as long as the commands run. +When you register or log in to an OIDC gateway, the CLI uses the Authorization Code flow with PKCE. It opens a browser, receives the authorization code on a localhost callback, exchanges the code for tokens, and stores the token bundle under the gateway credential directory. After `os gateway logout`, the next browser login asks the identity provider for a fresh login prompt so you can choose a different browser user instead of silently reusing the previous session. If `OPENSHELL_OIDC_CLIENT_SECRET` is set, the CLI uses the client credentials flow instead. Use that mode for CI and other non-interactive automation. The CLI renews an expired client credentials token by repeating the grant, so keep the variable set for as long as the commands run. Official Python, TypeScript, and Go SDKs can perform renewable client-credentials authentication directly. Configure the service account at the identity provider @@ -268,7 +268,7 @@ The connection flow: For a headless environment, set `OPENSHELL_NO_BROWSER=1` before registering or logging in to the gateway. When this variable is set and `OPENSHELL_OIDC_CLIENT_SECRET` is not configured, the CLI uses the Device Authorization Grant (RFC 8628) with S256 PKCE. This flow prompts the user to visit a verification URL on any device with a browser and enter a displayed code. The CLI polls the token endpoint until the user completes authorization. This requires the OIDC client to have the device authorization grant enabled on the identity provider. 1. The CLI loads the stored OIDC token bundle. -2. If the access token is expired or near expiry, the CLI refreshes it with the OIDC scopes saved in the gateway metadata. If refresh fails, the command stops before sending a protected request and directs you to run `openshell gateway login `. +2. If the access token is expired or near expiry, the CLI refreshes it with the OIDC scopes saved in the gateway metadata. If refresh fails, the command stops before sending a protected request and directs you to run `os gateway login `. 3. The CLI connects to the gateway and attaches `authorization: Bearer ` metadata to each gRPC request. 4. The gateway validates the JWT signature, issuer, audience, expiration, subject, and key ID against the issuer's JWKS. 5. The gateway extracts roles and optional scopes from the configured claim paths. @@ -303,14 +303,14 @@ Supervisor-to-gateway RPCs do not use user OIDC tokens or mTLS user identity. TL Re-authenticate an OIDC gateway with: ```shell -openshell gateway login production +os gateway login production ``` Inspect the identity the gateway validated: ```shell -openshell whoami -openshell whoami --output json +os whoami +os whoami --output json ``` The output includes the stable subject used for workspace membership, the @@ -324,7 +324,7 @@ a workspace. For membership commands, refer to For gateways behind a reverse proxy that handles authentication (e.g. Cloudflare Access), the CLI uses a browser-based login flow and routes traffic through a WebSocket tunnel. The tunnel is disabled by default; enable it with `enable_websocket_tunnel = true` under `[openshell.gateway]` (Helm: `server.enableWebsocketTunnel=true`). -**Registration flow** (`openshell gateway add https://gateway.example.com`): +**Registration flow** (`os gateway add https://gateway.example.com`): 1. The CLI stores gateway metadata with the edge authentication mode. 2. Opens your browser to the gateway's authentication endpoint. @@ -342,7 +342,7 @@ For gateways behind a reverse proxy that handles authentication (e.g. Cloudflare This is transparent to the user. All CLI commands work the same regardless of whether the gateway uses mTLS, OIDC, or edge authentication. -**Re-authentication**: If the token expires, run `openshell gateway login` to open the browser flow again and update the stored token. +**Re-authentication**: If the token expires, run `os gateway login` to open the browser flow again and update the stored token. ### Browser Login Callbacks @@ -358,7 +358,7 @@ When the CLI runs inside a container, the wrapper cannot know a randomly chosen For example, a wrapper running the CLI in a container sets both variables and publishes the fixed port to host loopback only: ```shell -OPENSHELL_CALLBACK_PORT=18080 OPENSHELL_CALLBACK_BIND_ADDRESS=0.0.0.0 openshell gateway login +OPENSHELL_CALLBACK_PORT=18080 OPENSHELL_CALLBACK_BIND_ADDRESS=0.0.0.0 os gateway login ``` The browser-facing callback URL derives from the bound address, so the callback matches the listener: IPv4 binds (including the default and `0.0.0.0`) use `http://127.0.0.1:/callback`, and IPv6 binds use the bracketed RFC 8252 loopback form `http://[::1]:/callback`. Identity providers that allowlist loopback redirects for native apps must include the `[::1]` form for IPv6 binds. The bundled Keycloak realm allows only `http://127.0.0.1:*` and `http://localhost:*`, because Keycloak rejects a port wildcard on an IPv6 literal, so IPv6 binds against it need an exact `http://[::1]:/callback` redirect URI added to the `openshell-cli` client. @@ -379,7 +379,7 @@ trusted reverse proxy or tunnel that handles TLS termination externally. Register a plaintext gateway with an explicit `http://` endpoint: ```shell -openshell gateway add http://127.0.0.1:17670 --local +os gateway add http://127.0.0.1:17670 --local ``` For Kubernetes local development, the Helm Skaffold overlay enables `[openshell.gateway.auth] allow_unauthenticated_users = true` so a port-forwarded plaintext gateway works without OIDC or mTLS user credentials. Leave this disabled for shared and production clusters. diff --git a/docs/how-it-works/gateways/configuration.mdx b/docs/how-it-works/gateways/configuration.mdx index ae7fd229ec..fa558991f5 100644 --- a/docs/how-it-works/gateways/configuration.mdx +++ b/docs/how-it-works/gateways/configuration.mdx @@ -795,10 +795,10 @@ flag attests that they are retired. Before rolling back to a release without workspace secrets: 1. Set `enable_workspace_secrets = false`. -2. For each row of `openshell provider refresh status` with a value in the - `MATERIAL_SECRETS` column, run `openshell provider refresh inline-secrets` +2. For each row of `os provider refresh status` with a value in the + `MATERIAL_SECRETS` column, run `os provider refresh inline-secrets` for that provider and credential key. Retry it if a mint is in progress. -3. Run `openshell secret list` in each workspace and find every secret another +3. Run `os secret list` in each workspace and find every secret another service reads directly through `RevealSecret`. These include all secrets whose `REFRESH ENDPOINTS` column shows `reveal-only`, and any refresh-enabled secret that a control-plane service also reveals. Provider @@ -1101,7 +1101,7 @@ the trace UI to local port `18888`. When Skaffold has deployed a Kubernetes gateway, the task also forwards it to local port `8090`; otherwise it continues with the collector ports only. The Skaffold run task registers the forwarded gateway under the worktree-specific k3d cluster name; select it with -`openshell gateway select `. The local Podman, Docker, and VM gateway +`os gateway select `. The local Podman, Docker, and VM gateway tasks export spans and OCSF log records to the forwarded receiver automatically. @@ -1175,13 +1175,13 @@ protocol = "http/protobuf" headers = { x-mlflow-experiment-id = "0" } ``` -While the relay is active, the sandbox runtime sets `OTEL_EXPORTER_OTLP_ENDPOINT=http://192.0.0.8:4318` and `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` in every workload process, and sets `OTEL_EXPORTER_OTLP_COMPRESSION` and `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` to `none`, so a standard OpenTelemetry SDK exports without configuration. These are lowest-precedence defaults. They are not set when the sandbox creation request or an environment passed to `openshell sandbox exec` names `OTEL_EXPORTER_OTLP_ENDPOINT` or `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, or when the image `ENV` names one for the main process, since `openshell sandbox exec` sessions do not inherit the image environment, and an endpoint the workload sets itself, for example with a shell `export`, takes precedence over them. A workload that exports elsewhere does so subject to the sandbox's network policy, and its traces carry no relay attribution. Provider credentials cannot redirect traces. While the relay is off, nothing is injected. Because the generic endpoint is set, an SDK that also exports metrics or logs sends them to the relay, which answers with an empty OTLP success and discards them. To keep metrics and logs, point those exporters elsewhere with `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` and `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`. The address is a reserved label rather than a network destination: the supervisor serves it inside the sandbox boundary and forwards accepted batches to the collector over the configured `protocol`. The collector's address is never visible inside the sandbox. +While the relay is active, the sandbox runtime sets `OTEL_EXPORTER_OTLP_ENDPOINT=http://192.0.0.8:4318` and `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` in every workload process, and sets `OTEL_EXPORTER_OTLP_COMPRESSION` and `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` to `none`, so a standard OpenTelemetry SDK exports without configuration. These are lowest-precedence defaults. They are not set when the sandbox creation request or an environment passed to `os sandbox exec` names `OTEL_EXPORTER_OTLP_ENDPOINT` or `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, or when the image `ENV` names one for the main process, since `os sandbox exec` sessions do not inherit the image environment, and an endpoint the workload sets itself, for example with a shell `export`, takes precedence over them. A workload that exports elsewhere does so subject to the sandbox's network policy, and its traces carry no relay attribution. Provider credentials cannot redirect traces. While the relay is off, nothing is injected. Because the generic endpoint is set, an SDK that also exports metrics or logs sends them to the relay, which answers with an empty OTLP success and discards them. To keep metrics and logs, point those exporters elsewhere with `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` and `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`. The address is a reserved label rather than a network destination: the supervisor serves it inside the sandbox boundary and forwards accepted batches to the collector over the configured `protocol`. The collector's address is never visible inside the sandbox. Every forwarded resource carries `openshell.sandbox.id`, with the same value as the supervisor's own spans, and `openshell.telemetry.source=agent`. Values the agent supplies for those two keys are replaced at the resource level; span and scope attributes pass through unchanged, so filter and join on the resource attributes. Filter on `openshell.telemetry.source` to separate agent traces from infrastructure traces, and join on `openshell.sandbox.id` to correlate them. Agents must export traces as OTLP/HTTP protobuf with compression disabled. The relay answers 415 to JSON bodies and to any `Content-Encoding` other than `identity`, 413 to bodies larger than 2 MiB, to requests with more than 512 `ResourceSpans` entries, and to requests whose resource attributes exceed 8192 in number or 256 KiB in total, 408 to requests whose body does not arrive within 30 seconds, and 503 with `Retry-After` while its buffer of 32 batches is full, which standard SDKs retry with backoff. Error responses carry a protobuf `google.rpc.Status` whose message states the reason. While the relay is off, connections to the relay address are refused immediately. -Delivery is best-effort. The relay answers 200 once a batch is buffered and makes one export attempt per batch, so a batch is lost if the collector is unavailable at that moment. The supervisor logs the first failed export and a periodic summary of failures. Before the sandbox reports that its main process exited, and before a suspended sandbox's supervisor exits, the relay flushes buffered batches for up to 5 seconds, and skips that wait when its most recent export failed. It keeps serving `openshell sandbox exec` sessions after the main process exits and flushes once more when the sandbox is torn down. +Delivery is best-effort. The relay answers 200 once a batch is buffered and makes one export attempt per batch, so a batch is lost if the collector is unavailable at that moment. The supervisor logs the first failed export and a periodic summary of failures. Before the sandbox reports that its main process exited, and before a suspended sandbox's supervisor exits, the relay flushes buffered batches for up to 5 seconds, and skips that wait when its most recent export failed. It keeps serving `os sandbox exec` sessions after the main process exits and flushes once more when the sandbox is torn down. ### Tuning @@ -1273,7 +1273,7 @@ Upgrade the gateway and all supervisors before relying on `allowlist` or `exact` The gateway connects to every registered service and validates `Describe` before it starts. The service must therefore be running before the gateway. Policy creation and full policy updates call `ValidateConfig`; an unavailable service or invalid middleware configuration rejects the policy before persistence. -Startup also requires compatible [extension protocol metadata](/extensibility/overview#protocol-negotiation). Upgrade legacy gateways and operator-run services together during a coordinated outage; neither mixed legacy/current pairing is supported. A service rejects a gateway that omits peer metadata, and a gateway rejects a service that omits metadata, uses another protocol major, or requires unsupported gateway capabilities. Protected `GetGatewayInfo` and `openshell gateway info` report the resulting non-secret snapshot. +Startup also requires compatible [extension protocol metadata](/extensibility/overview#protocol-negotiation). Upgrade legacy gateways and operator-run services together during a coordinated outage; neither mixed legacy/current pairing is supported. A service rejects a gateway that omits peer metadata, and a gateway rejects a service that omits metadata, uses another protocol major, or requires unsupported gateway capabilities. Protected `GetGatewayInfo` and `os gateway info` report the resulting non-secret snapshot. `max_payload_bytes` is the shared operator limit for inspectable logical payloads across the bindings authorized for this service. It caps HTTP request and response units, replacement bodies, and complete WebSocket text messages and replacements. Whole-response inspection uses it as the stage's total body limit. Streaming response inspection applies it to each unit. HTTP hook bindings that advertise a zero limit are excluded from the limit comparison and always get no body modes. The value must be greater than zero, unless every authorized binding is such a binding. Otherwise it must be no larger than each remaining binding's advertised `max_payload_bytes` capability, and no larger than the 4 MiB platform maximum. OpenShell rejects oversized values instead of silently clamping them. Binary WebSocket messages are not exposed to V1 middleware, so this field does not limit binary pass-through. Middleware gRPC servers should allow messages of at least 4 MiB plus 293 KiB so a maximum-size payload and its protobuf envelope fit on the transport. @@ -1316,7 +1316,7 @@ Bindings that include `post_commit` must resolve to `failure_policy = "fail_open `provider_profile_sources` selects the exact ordered provider-profile source set. Omit it to use imported profiles only. Use `{ type = "user" }` and `{ type = "interceptor", name = "" }` entries to compose a catalog. An interceptor entry must reference a configured service whose manifest advertises `provider_profiles = true`. Selecting only an interceptor makes that catalog authoritative; include `{ type = "user" }` explicitly to compose imported profiles with it. Empty or duplicate source lists, unknown interceptor names, and duplicate normalized profile IDs fail closed. Source order controls collection and diagnostics, not override precedence. -OpenShell ships no profiles inside the gateway binary. A gateway with nothing imported reaches ready and serves an empty catalog; import the profiles it needs with `openshell provider profile import`. The `builtin` source type was removed and a configuration that still names it is rejected at startup. +OpenShell ships no profiles inside the gateway binary. A gateway with nothing imported reaches ready and serves an empty catalog; import the profiles it needs with `os provider profile import`. The `builtin` source type was removed and a configuration that still names it is rejected at startup. For an authoritative interceptor catalog, select only that interceptor: diff --git a/docs/how-it-works/gateways/container-deployment.mdx b/docs/how-it-works/gateways/container-deployment.mdx index 91ae73eea4..fce4437a03 100644 --- a/docs/how-it-works/gateways/container-deployment.mdx +++ b/docs/how-it-works/gateways/container-deployment.mdx @@ -76,19 +76,19 @@ creating sandbox containers. Register the gateway with the CLI. If running on the same machine, use `--local`: ```shell -openshell gateway add http://127.0.0.1:8080 --local --name local +os gateway add http://127.0.0.1:8080 --local --name local ``` If registering from a different machine on the same network, use the host IP and `--remote`: ```shell -openshell gateway add http://HOST_IP:8080 --remote --name remote +os gateway add http://HOST_IP:8080 --remote --name remote ``` Confirm the CLI can reach the gateway: ```shell -openshell status +os status ``` @@ -146,7 +146,7 @@ docker run -d \ Register the gateway with mTLS: ```shell -openshell gateway add https://127.0.0.1:8080 --local --name local +os gateway add https://127.0.0.1:8080 --local --name local ``` ## Docker Compose @@ -170,14 +170,14 @@ The `init` service runs first and writes the sandbox JWT signing keys to `/var/l Register the gateway with the CLI. If registering from the same machine: ```shell -openshell gateway add http://127.0.0.1:8080 --local --name local +os gateway add http://127.0.0.1:8080 --local --name local ``` If registering from a different machine on the same network, replace `HOST_IP` with the machine's LAN address: ```shell -openshell gateway add http://HOST_IP:8080 --remote --name remote +os gateway add http://HOST_IP:8080 --remote --name remote ``` ### Enable mTLS @@ -192,7 +192,7 @@ The `init` service already writes the server, client, and CA certificates to `/v docker compose -f deploy/docker/docker-compose.yml up -d ``` -Then copy the client bundle to `~/.config/openshell/gateways/local/mtls/`, where the CLI loads it (refer to [Gateway Authentication](/how-it-works/gateways/authentication#mtls)). The files are owned by root, so copy them with `sudo` and hand them to your user. If you registered the plaintext gateway as `local`, run `openshell gateway remove local` first. +Then copy the client bundle to `~/.config/openshell/gateways/local/mtls/`, where the CLI loads it (refer to [Gateway Authentication](/how-it-works/gateways/authentication#mtls)). The files are owned by root, so copy them with `sudo` and hand them to your user. If you registered the plaintext gateway as `local`, run `os gateway remove local` first. ```shell mtls=~/.config/openshell/gateways/local/mtls @@ -201,7 +201,7 @@ sudo cp /var/lib/openshell/tls/ca.crt \ /var/lib/openshell/tls/client/tls.crt \ /var/lib/openshell/tls/client/tls.key "$mtls"/ sudo chown "$USER" "$mtls"/* -openshell gateway add https://127.0.0.1:8080 --local --name local +os gateway add https://127.0.0.1:8080 --local --name local ``` ## Using Podman @@ -264,11 +264,11 @@ The gateway takes a few seconds to start listening. Register it with the CLI and ```shell OPENSHELL_LOCAL_TLS_DIR="$data_dir/tls" \ - openshell gateway add https://127.0.0.1:8080 --local --name local -openshell status + os gateway add https://127.0.0.1:8080 --local --name local +os status ``` -The CLI imports its client certificates from `OPENSHELL_LOCAL_TLS_DIR`. Without it, the CLI reads `~/.local/state/openshell/tls`, which can hold another gateway's certificates and fails with `BadSignature`. If a gateway named `local` is already registered, run `openshell gateway remove local` first. +The CLI imports its client certificates from `OPENSHELL_LOCAL_TLS_DIR`. Without it, the CLI reads `~/.local/state/openshell/tls`, which can hold another gateway's certificates and fails with `BadSignature`. If a gateway named `local` is already registered, run `os gateway remove local` first. To publish a different host port, set `grpc_endpoint` to the host address under `[openshell.drivers.podman]` in a gateway TOML file. For example, with `-p 127.0.0.1:9090:8080`, the file needs only `version = 2` under `[openshell]` and `grpc_endpoint = "https://127.0.0.1:9090"`. Save it as `$data_dir/gateway.toml`, add `-e OPENSHELL_GATEWAY_CONFIG="$data_dir/gateway.toml"` to the gateway command, and register the gateway at `https://127.0.0.1:9090`. The [gateway configuration reference](/how-it-works/gateways/configuration#podman) lists the other Podman options. diff --git a/docs/how-it-works/gateways/overview.mdx b/docs/how-it-works/gateways/overview.mdx index 093f73517a..9bbfa8d5b4 100644 --- a/docs/how-it-works/gateways/overview.mdx +++ b/docs/how-it-works/gateways/overview.mdx @@ -40,7 +40,7 @@ For driver setup, including Docker, Podman, MicroVM, and Kubernetes paths, refer ## Configure Service Forwarding -Sandbox service routing is enabled for gateways by default. Users expose long-running sandbox services with `openshell service expose`, and the gateway routes browser traffic from the printed service URL to the loopback port inside the sandbox. +Sandbox service routing is enabled for gateways by default. Users expose long-running sandbox services with `os service expose`, and the gateway routes browser traffic from the printed service URL to the loopback port inside the sandbox. Loopback gateways use `openshell.localhost` service URLs. OpenShell prints a URL in the form `http://--.openshell.localhost:/`, or `http://----.openshell.localhost:/` when a service name is provided. @@ -56,24 +56,24 @@ For remote or non-loopback gateways, browser service URLs remain HTTPS and requi ## Register an Existing Gateway -Use `openshell gateway add` to register any reachable gateway endpoint so the CLI can target it. +Use `os gateway add` to register any reachable gateway endpoint so the CLI can target it. Register a plaintext local endpoint, such as a trusted port-forward: ```shell -openshell gateway add http://127.0.0.1:8080 --local --name local +os gateway add http://127.0.0.1:8080 --local --name local ``` Register a gateway behind an authenticated reverse proxy: ```shell -openshell gateway add https://gateway.example.com --name production +os gateway add https://gateway.example.com --name production ``` This opens your browser for the proxy's login flow when the gateway uses edge authentication. If the token expires later, re-authenticate with: ```shell -openshell gateway login production +os gateway login production ``` For direct mTLS endpoints, place the CLI client certificate bundle in the gateway credential directory described in [Gateway Authentication](/how-it-works/gateways/authentication), then register or select that gateway name. @@ -82,50 +82,50 @@ For direct mTLS endpoints, place the CLI client certificate bundle in the gatewa One gateway is always the active gateway. All CLI commands target it by default. `gateway add` sets the new gateway as active. -The active gateway is the persisted default. The `-g` flag and the `OPENSHELL_GATEWAY` environment variable override it when commands resolve a gateway. If `OPENSHELL_GATEWAY` is set to a different gateway, `openshell gateway select ` still saves the new default and warns that the current shell continues to use the environment value until you unset or update it. +The active gateway is the persisted default. The `-g` flag and the `OPENSHELL_GATEWAY` environment variable override it when commands resolve a gateway. If `OPENSHELL_GATEWAY` is set to a different gateway, `os gateway select ` still saves the new default and warns that the current shell continues to use the environment value until you unset or update it. -Installers can seed read-only gateway entries for package-managed local services. By default the CLI reads these from `/etc/openshell`, using the same `active_gateway` plus `gateways//metadata.json` layout as per-user config. Packages can override that system config root with a non-empty absolute `OPENSHELL_SYSTEM_GATEWAY_DIR` when needed; empty or relative values fall back to `/etc/openshell` and log a warning. These entries appear in `openshell gateway list` and can be selected like user registrations. `openshell gateway list` and `openshell term` label each gateway as `user` or `system` so you can see which config layer owns it. `openshell gateway remove` removes only per-user registrations. Register a per-user gateway with the same name when you need to shadow an installer-provided default. +Installers can seed read-only gateway entries for package-managed local services. By default the CLI reads these from `/etc/openshell`, using the same `active_gateway` plus `gateways//metadata.json` layout as per-user config. Packages can override that system config root with a non-empty absolute `OPENSHELL_SYSTEM_GATEWAY_DIR` when needed; empty or relative values fall back to `/etc/openshell` and log a warning. These entries appear in `os gateway list` and can be selected like user registrations. `os gateway list` and `os term` label each gateway as `user` or `system` so you can see which config layer owns it. `os gateway remove` removes only per-user registrations. Register a per-user gateway with the same name when you need to shadow an installer-provided default. List all registered gateways. The table shows each gateway's endpoint, type, config source, authentication mode, and remote target when a remote registration has one: ```shell -openshell gateway list +os gateway list ``` Use structured output when you need the complete local registration metadata, including `remote_host` and `resolved_host` for remote registrations: ```shell -openshell gateway list -o json +os gateway list -o json ``` Switch the active gateway: ```shell -openshell gateway select production +os gateway select production ``` Override the active gateway for a single command with `-g`: ```shell -openshell status -g staging +os status -g staging ``` ## Inspect Gateway Status -Use `openshell status` for a live gateway check. It reports gateway +Use `os status` for a live gateway check. It reports gateway reachability, authentication, and the gateway version independently: ```shell -openshell status +os status ``` `Status: Connected` means the public health endpoint responded. `Authentication: Authenticated` confirms the configured credentials also passed the gateway authentication layer. If authentication fails while status -remains connected, run `openshell gateway login ` to refresh the stored +remains connected, run `os gateway login ` to refresh the stored credentials. When you select a gateway by name with `--gateway ` or @@ -140,26 +140,26 @@ field in structured output to determine reachability. For automation or scripting, use `--output json` or `--output yaml` to get machine-readable output: ```shell -openshell status --output json +os status --output json ``` -Use `openshell gateway info` when you need elevated runtime details such as +Use `os gateway info` when you need elevated runtime details such as initialized compute drivers and driver-reported capability versions: ```shell -openshell gateway info +os gateway info ``` Use structured output when scripting against live runtime info: ```shell -openshell gateway info -o json +os gateway info -o json ``` Remove a local CLI registration without stopping the gateway service: ```shell -openshell gateway remove production +os gateway remove production ``` ## Troubleshoot @@ -167,15 +167,15 @@ openshell gateway remove production Check gateway health: ```shell -openshell status -openshell gateway info +os status +os gateway info ``` For Docker-backed local gateways, inspect Docker and the gateway process or container started by your local workflow: ```shell -openshell doctor check -openshell gateway list +os doctor check +os gateway list ``` For Kubernetes gateways, inspect the gateway workload and cluster events: diff --git a/docs/how-it-works/inference.mdx b/docs/how-it-works/inference.mdx index d8be992106..1b35ca4e93 100644 --- a/docs/how-it-works/inference.mdx +++ b/docs/how-it-works/inference.mdx @@ -53,15 +53,15 @@ Lint and import the complete edited profile, then create a provider from its new ID: ```shell -openshell profile lint -f nvidia-native.yaml -openshell profile import -f nvidia-native.yaml +os profile lint -f nvidia-native.yaml +os profile import -f nvidia-native.yaml -openshell provider create \ +os provider create \ --name nvidia-prod \ --type nvidia-native \ --from-existing -openshell sandbox create \ +os sandbox create \ --name inference-demo \ --from registry.example.com/team/python-agent:1.0 \ --provider nvidia-prod \ @@ -103,8 +103,8 @@ starting templates you copy and adapt, not as defaults. ## Attach a Provider to a Running Sandbox ```shell -openshell sandbox provider attach inference-demo nvidia-prod --wait -openshell sandbox provider list inference-demo +os sandbox provider attach inference-demo nvidia-prod --wait +os sandbox provider list inference-demo ``` Running sandboxes poll for provider and effective-policy changes. `--wait` @@ -112,7 +112,7 @@ confirms the sandbox has applied the attachment. Launch a new process so it receives the new credential placeholder: ```shell -openshell sandbox exec --name inference-demo -- python app.py +os sandbox exec --name inference-demo -- python app.py ``` An already-running process does not gain new environment variables. Credential @@ -122,7 +122,7 @@ Use `--wait` to confirm that change before relying on it. Detach the provider to revoke its policy and credential access: ```shell -openshell sandbox provider detach inference-demo nvidia-prod --wait +os sandbox provider detach inference-demo nvidia-prod --wait ``` ## Use a Custom or Self-hosted Endpoint @@ -161,11 +161,11 @@ binaries: Import the profile, create an instance, and attach it: ```shell -openshell profile lint -f ollama-openai.yaml -openshell profile import -f ollama-openai.yaml -openshell provider create --name ollama --type ollama-openai +os profile lint -f ollama-openai.yaml +os profile import -f ollama-openai.yaml +os provider create --name ollama --type ollama-openai -openshell sandbox create \ +os sandbox create \ --name ollama-client \ --from registry.example.com/team/python-agent:1.0 \ --provider ollama \ @@ -200,7 +200,7 @@ explicitly enabled [mTLS operator can retrieve runtime credential values](/how-i Inspect the effective policy, including provider-derived entries: ```shell -openshell policy get inference-demo --full +os policy get inference-demo --full ``` Then run a native request from a new sandbox process. A successful request @@ -209,9 +209,9 @@ and upstream service behavior. If the request is denied: -- Confirm the provider is attached with `openshell sandbox provider list`. +- Confirm the provider is attached with `os sandbox provider list`. - Confirm the caller binary and native endpoint appear in - `openshell policy get --full`. + `os policy get --full`. - If the provider was attached after the process started, launch a new process. - If the sandbox uses a gateway global policy override, add the native endpoint there because a global override suppresses provider-derived policy layers. @@ -238,7 +238,7 @@ should receive that authority. Earlier releases configured one shared route: ```shell -openshell provider create --name nvidia-prod --type nvidia --from-existing +os provider create --name nvidia-prod --type nvidia --from-existing openshell inference set \ --provider nvidia-prod \ --model nvidia/nemotron-3-super-120b-a12b \ @@ -254,15 +254,15 @@ Export the old provider type's profile, edit its ID and access contract, import it, and create a replacement provider from the original credential source: ```shell -openshell profile export nvidia -o yaml > nvidia-native.yaml +os profile export nvidia -o yaml > nvidia-native.yaml # Edit id, display_name, endpoints, and binaries in nvidia-native.yaml. -openshell profile lint -f nvidia-native.yaml -openshell profile import -f nvidia-native.yaml -openshell provider create \ +os profile lint -f nvidia-native.yaml +os profile import -f nvidia-native.yaml +os provider create \ --name nvidia-native-prod \ --type nvidia-native \ --from-existing -openshell sandbox provider attach inference-demo nvidia-native-prod --wait +os sandbox provider attach inference-demo nvidia-native-prod --wait ``` Provider inspection commands do not export stored credential values, and you diff --git a/docs/how-it-works/policies/advisor.mdx b/docs/how-it-works/policies/advisor.mdx index 6d47761b55..e3675c04af 100644 --- a/docs/how-it-works/policies/advisor.mdx +++ b/docs/how-it-works/policies/advisor.mdx @@ -85,7 +85,7 @@ requests that were denied before you enabled the policy advisor. Enable the policy advisor for every sandbox on the gateway: ```shell -openshell settings set --global \ +os settings set --global \ --key agent_policy_proposals_enabled \ --value true \ --yes @@ -95,18 +95,18 @@ To enable it for one sandbox instead, set the key on that sandbox. This works only when the key has no gateway-wide value: ```shell -openshell settings set \ +os settings set \ --key agent_policy_proposals_enabled \ --value true ``` -To check the setting for a sandbox, run `openshell settings get `. +To check the setting for a sandbox, run `os settings get `. The output shows whether the value comes from the gateway, the sandbox, or neither. To let individual sandboxes control the setting again, delete the gateway-wide value: ```shell -openshell settings delete --global \ +os settings delete --global \ --key agent_policy_proposals_enabled \ --yes ``` @@ -118,7 +118,7 @@ them. List a sandbox's pending proposals with the rule each would add, the agent's reason, and the results of the risk checks: ```shell -openshell rule get --status pending +os rule get --status pending ``` A transport-level endpoint (`L4` or `tcp`) sets no HTTP method or path filter of its own. @@ -126,14 +126,14 @@ Approve a proposal when its rule grants only the access you intend. Use the ID from the proposal's `Chunk` line: ```shell -openshell rule approve --chunk-id +os rule approve --chunk-id ``` Otherwise, reject it with a reason. OpenShell sends the reason and the risk check findings to the agent, which can submit a narrower proposal: ```shell -openshell rule reject \ +os rule reject \ --chunk-id \ --reason "Scope this to docs/ paths only." ``` @@ -146,10 +146,10 @@ background. Each change rechecks up to 32 of the newest pending proposals. If a proposal's inputs changed after you listed it, for example because the sandbox's providers changed, `rule approve` rechecks it and stops. Review the -updated proposal with `openshell rule get --status pending`, +updated proposal with `os rule get --status pending`, then approve it again. While a global policy is active, OpenShell cannot approve proposals, including automatically. You can also review proposals in the terminal UI with -`openshell term`, but it rejects proposals without a reason. +`os term`, but it rejects proposals without a reason. ## Approve Proposals Automatically @@ -173,7 +173,7 @@ sandbox can gain access to public hosts without your review. Turn on automatic mode for every sandbox on the gateway: ```shell -openshell settings set --global \ +os settings set --global \ --key proposal_approval_mode \ --value auto \ --yes @@ -183,7 +183,7 @@ To turn it on for one sandbox, set the key on that sandbox, or pass `--approval-mode auto` when you create it: ```shell -openshell sandbox create --name --approval-mode auto +os sandbox create --name --approval-mode auto ``` The accepted values are `manual`, the default, and `auto`. A gateway-wide value @@ -262,7 +262,7 @@ Agents cannot propose `protocol: tcp` or `tls: skip`, because OpenShell cannot inspect that traffic. The API also has no fields for GraphQL operation rules, MCP tool rules, query matchers, credential settings, or endpoint path selectors, and it ignores them if an agent sends them. Review the rule that -`openshell rule get` shows, not the agent's description of it. Add rules that +`os rule get` shows, not the agent's description of it. Add rules that need those fields yourself, as described in [Manage Sandbox Policies](/how-it-works/policies/manage-policies). @@ -305,7 +305,7 @@ new sandboxes do not receive the guide, and denial responses do not mention To follow a proposal in the sandbox log, run: ```shell -openshell logs --since 10m +os logs --since 10m ``` Look for the denied request (`HTTP: ... DENIED`) or blocked connection diff --git a/docs/how-it-works/policies/cedar.mdx b/docs/how-it-works/policies/cedar.mdx index 5570f1a140..44b185376f 100644 --- a/docs/how-it-works/policies/cedar.mdx +++ b/docs/how-it-works/policies/cedar.mdx @@ -22,7 +22,7 @@ OpenShell treats a policy file as Cedar when its extension is `.cedar`, in any c Host selectors, including host globs, must not exceed 253 bytes. -The gateway and the sandbox supervisor must both be built with Cedar support. A gateway built without Cedar rejects Cedar policies on sandbox create and policy update; the CLI displays the gateway error. If it runs on state that already holds Cedar sandboxes, for example after you switch from a development build to a stable one, it refuses to start those sandboxes, deliver their configuration, change their policy or providers, or show their policy. Delete them with `openshell sandbox delete`, or switch back to a development build. A gateway with Cedar support does not deliver a Cedar policy to a supervisor without it. Stable CLIs read, send, and show Cedar policies, but only a gateway with Cedar support accepts them. Gateways predating Cedar support may ignore Cedar fields instead of rejecting them, so use a development gateway and supervisor that support Cedar. +The gateway and the sandbox supervisor must both be built with Cedar support. A gateway built without Cedar rejects Cedar policies on sandbox create and policy update; the CLI displays the gateway error. If it runs on state that already holds Cedar sandboxes, for example after you switch from a development build to a stable one, it refuses to start those sandboxes, deliver their configuration, change their policy or providers, or show their policy. Delete them with `os sandbox delete`, or switch back to a development build. A gateway with Cedar support does not deliver a Cedar policy to a supervisor without it. Stable CLIs read, send, and show Cedar policies, but only a gateway with Cedar support accepts them. Gateways predating Cedar support may ignore Cedar fields instead of rejecting them, so use a development gateway and supervisor that support Cedar. To build Cedar support from source, enable the experimental feature bundle in both binaries: @@ -35,20 +35,20 @@ Deploy both binaries using your runtime's normal configuration, or use published Create a sandbox with a Cedar policy: ```shell -openshell sandbox create --policy ./policy.cedar -- claude +os sandbox create --policy ./policy.cedar -- claude ``` Replace the policy on a running sandbox: ```shell -openshell policy set --policy ./policy.cedar --wait +os policy set --policy ./policy.cedar --wait ``` The CLI sends the file's text to the gateway, which validates it and rejects an invalid policy with the reason. If the sandbox cannot load a revision, the `policy_validation_failure_mode` setting applies as it does for YAML policies. Refer to [Manage Policies](/how-it-works/policies/manage-policies). -`openshell policy get ` prints the Cedar text of a Cedar sandbox's policy. +`os policy get ` prints the Cedar text of a Cedar sandbox's policy. -The CLI does not currently configure middleware, endpoint settings, or a custom process identity for Cedar policies. When one of these, or Landlock compatibility, is set through the policy API, `openshell policy set` with a Cedar file keeps it and replaces only the Cedar source. YAML policies retain their existing configuration sections. +The CLI does not currently configure middleware, endpoint settings, or a custom process identity for Cedar policies. When one of these, or Landlock compatibility, is set through the policy API, `os policy set` with a Cedar file keeps it and replaces only the Cedar source. YAML policies retain their existing configuration sections. ## Policy Model @@ -429,7 +429,7 @@ A provider's token grant applies to a request only when Cedar allows the request A few provider rule forms cannot be expressed in Cedar, and OpenShell compiles them so they withhold tokens rather than grant them: allow rules with `?` in a glob, GraphQL `fields` globs, or an endpoint `path` glob other than `*` or a trailing `/**` grant no token, and deny rules with them withhold tokens more broadly; and a glob with `[`, `{`, or `\` withholds every token. The sandbox logs each such rule when it loads the policy. JSON-RPC requests whose method is not uppercase and hash-only GraphQL persisted queries also get no token. -Use `openshell policy get --full --output json` to inspect the provider credential rules delivered to the sandbox. `--base` omits provider-derived rules. +Use `os policy get --full --output json` to inspect the provider credential rules delivered to the sandbox. `--base` omits provider-derived rules. ```cedar permit ( @@ -451,7 +451,7 @@ when { context.method == "GET" }; - A sandbox cannot switch between YAML and Cedar after creation. Recreate the sandbox to change formats. - Global policies must be YAML. -- Incremental `openshell policy update` merges are not available for Cedar policies. Use `openshell policy set` with the full policy. +- Incremental `os policy update` merges are not available for Cedar policies. Use `os policy set` with the full policy. - Policy templates are not supported. - A policy cannot nest brackets more than 64 deep or chain more than 1,024 operators in one policy. Replace a long `||` chain with a set literal such as `["a", "b"].contains(context.path)`, or split the policy. - A request whose path, query key or value, method, or other inspected field is longer than 16 KiB is denied. diff --git a/docs/how-it-works/policies/default-policy.mdx b/docs/how-it-works/policies/default-policy.mdx index 4c9ab29ff8..6a69fb86cc 100644 --- a/docs/how-it-works/policies/default-policy.mdx +++ b/docs/how-it-works/policies/default-policy.mdx @@ -75,7 +75,7 @@ policy has no `filesystem_policy` section, OpenShell creates one with `include_workdir: true`. The sandbox saves the enriched filesystem policy as a new revision, so the -added paths appear in `openshell policy get --base`. While a global policy is +added paths appear in `os policy get --base`. While a global policy is active, the sandbox adds the paths without saving a revision, so they do not appear in the policy views. OpenShell can reject a replacement policy that removes filesystem paths, so keep the added paths when @@ -118,11 +118,11 @@ To see which policy a sandbox uses, print its base and effective policies. While a global policy is active, both commands show the global policy: ```shell -openshell policy get --base -openshell policy get --full +os policy get --base +os policy get --full ``` Neither view includes the paths that OpenShell grants only at runtime, such as the CA certificate and GPU paths. To confirm what a running sandbox enforces, -check the revision status with `openshell policy list ` and test +check the revision status with `os policy list ` and test requests. diff --git a/docs/how-it-works/policies/manage-policies.mdx b/docs/how-it-works/policies/manage-policies.mdx index d3d1c1a12f..93f6427828 100644 --- a/docs/how-it-works/policies/manage-policies.mdx +++ b/docs/how-it-works/policies/manage-policies.mdx @@ -11,11 +11,11 @@ position: 3 This page shows how to use the OpenShell CLI to manage a sandbox's policy, from setting a policy when you create a sandbox to changing it while the sandbox runs, confirming that the change took effect, and rolling it back. Run -`openshell policy --help` for every command and option. +`os policy --help` for every command and option. ## Check a Policy File Offline -Run `openshell policy lint policy.yaml` before applying an authored policy. +Run `os policy lint policy.yaml` before applying an authored policy. It validates the file locally and exits nonzero for an invalid policy. No gateway or sandbox is required. Schema and conversion errors stop validation; after parsing, safety, credential-binding, ambiguity and built-in middleware @@ -25,7 +25,7 @@ A successful lint uses this CLI version's validation rules. It does not check attached providers, registered external middleware, image identity, or driver requirements, and does not establish that the sandbox will start. To validate an exported policy for reuse, export the authored policy with -`openshell policy get my-sandbox --base`; `--full` includes reserved provider +`os policy get my-sandbox --base`; `--full` includes reserved provider entries. ## Create a Sandbox with a Policy @@ -34,11 +34,11 @@ Pass a policy file when you create a sandbox. Filesystem, Landlock, and process settings take effect only when the sandbox starts, so set them here: ```shell -openshell sandbox create --name my-sandbox --policy ./policy.yaml +os sandbox create --name my-sandbox --policy ./policy.yaml ``` The rest of this page refers to this sandbox as `my-sandbox`. If you omit the -sandbox name from an `openshell policy` command, the CLI uses the sandbox you +sandbox name from an `os policy` command, the CLI uses the sandbox you most recently created, connected to, or ran a command in, and prints its name. To use the same file for every sandbox you create, set @@ -46,7 +46,7 @@ To use the same file for every sandbox you create, set ```shell export OPENSHELL_SANDBOX_POLICY="$PWD/policy.yaml" -openshell sandbox create --name my-sandbox +os sandbox create --name my-sandbox ``` Without either, the sandbox uses a policy from its image or the restrictive @@ -75,8 +75,8 @@ a global policy is active, both views show the global policy. `--base` shows the base policy, and `--full` shows the effective policy: ```shell -openshell policy get my-sandbox --base -openshell policy get my-sandbox --full +os policy get my-sandbox --base +os policy get my-sandbox --full ``` Edit from the base policy, because provider rules belong to their providers, not @@ -87,18 +87,18 @@ To save the effective policy as a YAML file, for example to review it or to check it with the [policy prover](/how-it-works/policies/prover): ```shell -openshell sandbox get my-sandbox --policy-only > effective-policy.yaml +os sandbox get my-sandbox --policy-only > effective-policy.yaml ``` To see each revision of the policy and whether the sandbox loaded it: ```shell -openshell policy list my-sandbox +os policy list my-sandbox ``` ## Add or Remove Network Access -`openshell policy update` adds or removes network rules on a running sandbox. It +`os policy update` adds or removes network rules on a running sandbox. It changes only the `network_policies` section, so you do not need a complete policy file. @@ -106,7 +106,7 @@ For example, to let `curl` in the sandbox make read-only requests to the GitHub API: ```shell -openshell policy update my-sandbox \ +os policy update my-sandbox \ --rule-name github_readonly \ --binary /usr/bin/curl \ --add-endpoint api.github.com:443:read-only:rest:enforce \ @@ -126,7 +126,7 @@ The command fails if the list does not match the rule's binaries, so a new permission cannot reach a binary you did not name: ```shell -openshell policy update my-sandbox \ +os policy update my-sandbox \ --rule-name github_readonly \ --binary /usr/bin/curl \ --add-allow 'api.github.com:443:POST:/repos/*/*/issues' \ @@ -139,7 +139,7 @@ the rule's key under `network_policies`, which can differ from its `name` field. Use `--add-deny` the same way to block a request. To remove the rule: ```shell -openshell policy update my-sandbox --remove-rule github_readonly --wait +os policy update my-sandbox --remove-rule github_readonly --wait ``` To preview a change without applying it, replace `--wait` with `--dry-run`. A @@ -150,7 +150,7 @@ providers add keep the destination. ## Replace the Complete Policy -`openshell policy set` replaces the whole policy. Use it for changes that +`os policy set` replaces the whole policy. Use it for changes that `policy update` cannot make, such as middleware, GraphQL, MCP, or JSON-RPC rules, `tls: skip`, credential bindings, or request signing. The new file replaces every section, so start from the current base policy. @@ -160,7 +160,7 @@ replaces every section, so start from the current base policy. Print the base policy: ```shell -openshell policy get my-sandbox --base +os policy get my-sandbox --base ``` The command prints revision details followed by the policy. Save only the policy @@ -171,7 +171,7 @@ sandbox started. Submit the edited file and wait for the result: ```shell -openshell policy set my-sandbox --policy policy.yaml --wait +os policy set my-sandbox --policy policy.yaml --wait ``` @@ -180,14 +180,14 @@ Save the base policy as JSON: ```shell set -o pipefail -openshell policy get my-sandbox --base --output json \ +os policy get my-sandbox --base --output json \ | jq -e '.policy' > base-policy.json ``` Edit `base-policy.json`, then submit it and wait for the result: ```shell -openshell policy set my-sandbox --policy base-policy.json --wait +os policy set my-sandbox --policy base-policy.json --wait ``` @@ -197,14 +197,14 @@ The next section describes how each part of the new policy takes effect. ## How Changes Take Effect -When you apply a change with `openshell policy update` or -`openshell policy set`, the network sections of the policy take effect in the +When you apply a change with `os policy update` or +`os policy set`, the network sections of the policy take effect in the running sandbox. The startup sections do not: | Change | Effect on a running sandbox | Required action | |---|---|---| | Network rules | The sandbox loads the new rules. Open connections whose rules changed close; other connections stay open. | Apply the change, then retry the request. | -| Middleware in `network_middlewares` | You can add, remove, or reconfigure built-in middleware and external services already registered with the gateway. | Apply the change with `openshell policy set`. | +| Middleware in `network_middlewares` | You can add, remove, or reconfigure built-in middleware and external services already registered with the gateway. | Apply the change with `os policy set`. | | External middleware registration | Policy changes cannot register a service or change its gateway connection settings. | Update the gateway configuration and restart the gateway. | | Added filesystem paths | The saved policy can change, but the running workload keeps its existing filesystem permissions. | Recreate the sandbox. | | Removed filesystem paths, or changed `include_workdir`, Landlock, or process settings | OpenShell rejects the change after the workload starts. | Recreate the sandbox. | @@ -275,12 +275,12 @@ you need before you delete it. Delete the sandbox and create a new one with the edited file: ```shell -openshell sandbox delete my-sandbox -openshell sandbox create --name my-sandbox --policy ./policy.yaml +os sandbox delete my-sandbox +os sandbox create --name my-sandbox --policy ./policy.yaml ``` If the delete command reports that cleanup is pending, wait until -`openshell sandbox get my-sandbox` no longer finds the sandbox before you create +`os sandbox get my-sandbox` no longer finds the sandbox before you create the new one. ## Verify a Change @@ -296,8 +296,8 @@ that the policy was unchanged, or that a newer change replaced yours before it loaded. Confirm the result: ```shell -openshell policy list my-sandbox -openshell policy get my-sandbox --full +os policy list my-sandbox +os policy get my-sandbox --full ``` The latest revision should show `Loaded`, and the effective policy should @@ -311,18 +311,18 @@ tool. ## Roll Back to an Earlier Revision To restore an earlier policy, find the revision in -`openshell policy list my-sandbox` and print its base policy. For example, for +`os policy list my-sandbox` and print its base policy. For example, for revision 2: ```shell -openshell policy get my-sandbox --rev 2 --base +os policy get my-sandbox --rev 2 --base ``` Save the policy YAML from the output as `previous-base.yaml`, review it, and submit it as a new revision: ```shell -openshell policy set my-sandbox --policy previous-base.yaml --wait +os policy set my-sandbox --policy previous-base.yaml --wait ``` Rolling back restores only the policy. It does not restore provider profiles, @@ -338,10 +338,10 @@ role: | Task | Command | |---|---| -| Inspect the current global policy. | `openshell policy get --global --full` | -| Apply a reviewed complete policy. | `openshell policy set --global --policy ./global-policy.yaml` | -| View global policy history. | `openshell policy list --global` | -| Remove the global policy and restore normal policy selection. | `openshell policy delete --global` | +| Inspect the current global policy. | `os policy get --global --full` | +| Apply a reviewed complete policy. | `os policy set --global --policy ./global-policy.yaml` | +| View global policy history. | `os policy list --global` | +| Remove the global policy and restore normal policy selection. | `os policy delete --global` | The set and delete commands ask for confirmation, because each one changes the network access of every sandbox on the gateway. Running sandboxes load a new @@ -361,7 +361,7 @@ and each denied request with its method, path, and reason. Check the sandbox log first: ```shell -openshell logs my-sandbox --since 10m --source sandbox +os logs my-sandbox --since 10m --source sandbox ``` Do not filter this log with `--level warn`, which hides policy events. Compare @@ -378,9 +378,9 @@ code in the response to find the cause: ### A Change Fails to Load -`openshell policy list my-sandbox` shows a revision that the sandbox rejected as +`os policy list my-sandbox` shows a revision that the sandbox rejected as `Failed`, with a shortened error. Run -`openshell policy get my-sandbox --rev ` to see the full error. What happens +`os policy get my-sandbox --rev ` to see the full error. What happens to network access depends on the failure mode described in [How Changes Take Effect](#how-changes-take-effect). With the default, `fail_closed`, the sandbox blocks network traffic until a valid policy loads. Fix the error and submit the @@ -389,7 +389,7 @@ revision](#roll-back-to-an-earlier-revision). ### A New Sandbox Stays in Provisioning -`openshell sandbox create` rejects an invalid policy file. If a new sandbox's +`os sandbox create` rejects an invalid policy file. If a new sandbox's configuration fails when it starts, for example because its image policy is invalid or its providers conflict, the sandbox stays in `Provisioning` and its workload does not start. Its `ConfigurationReady` condition shows the reason @@ -397,19 +397,19 @@ workload does not start. Its `ConfigurationReady` condition shows the reason check the sandbox log for the specific error: ```shell -openshell sandbox get my-sandbox --output json +os sandbox get my-sandbox --output json ``` The same repair window applies when the gateway refuses an image-policy upload or a policy update that adds baseline filesystem paths with `FAILED_PRECONDITION` or `INVALID_ARGUMENT`. After the gateway acknowledges the rejection report, startup waits two seconds, reads a fresh configuration, and retries. If your repair reaches the gateway before that report, startup immediately reads the repaired configuration. The sandbox log records the gateway's reason; repeated refusals of the same write, status code, and configuration are logged once. Authentication and authorization failures still stop startup. -You have the configured repair window (300 seconds by default) to fix the configuration after the supervisor starts admission. Image preparation has its own deadline and does not consume that repair time. Replace the policy with `openshell policy set`, or fix the provider configuration. Until the workload first starts, you can also change filesystem, Landlock, and process settings. Each effective change to the policy, providers, or settings restarts the repair window; writing an unchanged value does not. +You have the configured repair window (300 seconds by default) to fix the configuration after the supervisor starts admission. Image preparation has its own deadline and does not consume that repair time. Replace the policy with `os policy set`, or fix the provider configuration. Until the workload first starts, you can also change filesystem, Landlock, and process settings. Each effective change to the policy, providers, or settings restarts the repair window; writing an unchanged value does not. If the time runs out, the sandbox moves to `Error` with the reason `ProvisioningTimedOut`. Fixing the configuration does not restart it. After you fix it, start the sandbox again. Admission gets a new repair window after preparation: ```shell -openshell sandbox start my-sandbox +os sandbox start my-sandbox ``` ## Next Steps diff --git a/docs/how-it-works/policies/network-rules.mdx b/docs/how-it-works/policies/network-rules.mdx index e9ed7bd495..ffd6ea1e5c 100644 --- a/docs/how-it-works/policies/network-rules.mdx +++ b/docs/how-it-works/policies/network-rules.mdx @@ -154,7 +154,7 @@ rule with `enforcement: audit`, run your workload, then look for violation events in the sandbox log: ```shell -openshell logs my-sandbox --since 5m --source sandbox +os logs my-sandbox --since 5m --source sandbox ``` Do not filter this log with `--level warn`, which hides policy events. When the @@ -195,9 +195,9 @@ The following rules cover common services and protocols. Replace the example hosts, paths, and binaries with your own values, and make sure the sandbox contains the client executable. -When a single `openshell policy update` command can create a rule, the example +When a single `os policy update` command can create a rule, the example shows it. Otherwise, add the YAML under the `network_policies` section of a -complete policy file and apply it with `openshell policy set`, as described in +complete policy file and apply it with `os policy set`, as described in [Replace the Complete Policy](/how-it-works/policies/manage-policies#replace-the-complete-policy). After you apply a rule, [verify the @@ -213,7 +213,7 @@ anything. The `read-only` preset permits `GET`, `HEAD`, and `OPTIONS`. ```shell -openshell policy update my-sandbox \ +os policy update my-sandbox \ --rule-name github_readonly \ --binary /usr/bin/curl \ --add-endpoint api.github.com:443:read-only:rest:enforce \ @@ -241,10 +241,10 @@ github_readonly: Verify an allowed `GET` and a denied `POST`: ```shell -openshell sandbox exec -n my-sandbox --no-login-shell -- \ +os sandbox exec -n my-sandbox --no-login-shell -- \ /usr/bin/curl --silent --show-error --fail \ https://api.github.com/zen -openshell sandbox exec -n my-sandbox --no-login-shell -- \ +os sandbox exec -n my-sandbox --no-login-shell -- \ /usr/bin/curl --silent --show-error \ --request POST https://api.github.com/zen ``` @@ -288,7 +288,7 @@ list the webhooks path and everything under it separately for the same reason. The allow rule grants every HTTP method under the repository path, including writes, so narrow it if the agent needs only specific operations. It does not cover Git transport or GraphQL requests. To add a deny rule to an existing rule -without a complete policy file, use `openshell policy update` with `--add-deny`, +without a complete policy file, use `os policy update` with `--add-deny`, as described in [Add or Remove Network Access](/how-it-works/policies/manage-policies#add-or-remove-network-access). @@ -333,7 +333,7 @@ index, replace the hosts with your index's hosts. For a sandbox with `pip` installed, verify that a download succeeds: ```shell -openshell sandbox exec -n my-sandbox --no-login-shell -- \ +os sandbox exec -n my-sandbox --no-login-shell -- \ /usr/bin/python3 -m pip download --no-deps --dest /tmp/pypi-check requests ``` @@ -366,12 +366,12 @@ replace `access: read-only` with explicit rules that also allow the audit's To set the option on a live sandbox without replacing the policy, add `allow-encoded-slash` to the `--add-endpoint` options segment of -`openshell policy update`, which requires a `rest` or `websocket` endpoint. +`os policy update`, which requires a `rest` or `websocket` endpoint. Verify that a scoped package lookup succeeds: ```shell -openshell sandbox exec -n my-sandbox --no-login-shell -- \ +os sandbox exec -n my-sandbox --no-login-shell -- \ /usr/bin/npm view @types/node version ``` @@ -395,7 +395,7 @@ allows read-only access to an internal API only at addresses in `10.20.0.0/16`: ```shell -openshell policy update my-sandbox \ +os policy update my-sandbox \ --rule-name internal_api \ --binary /usr/bin/curl \ --add-endpoint 'api.internal.example:443:read-only:rest:enforce:allowed-ip=10.20.0.0/16' \ @@ -576,7 +576,7 @@ described in [MCP Version Selection](/how-it-works/policies/schema#mcp-version-selection). Server responses and SSE messages are relayed without MCP policy parsing. Do not put an MCP endpoint on the same host and port as an endpoint that uses a different -protocol. `openshell policy update` rejects this combination. +protocol. `os policy update` rejects this combination. A server that uses the sessionless `2026-07-28` revision has no initialization step. Its clients send their protocol version and capabilities with every @@ -638,7 +638,7 @@ glob: ```shell -openshell policy update my-sandbox \ +os policy update my-sandbox \ --rule-name postgres \ --binary '/usr/lib/postgresql/*/bin/psql' \ --add-endpoint db.internal.example:5432::tcp \ diff --git a/docs/how-it-works/policies/prover.mdx b/docs/how-it-works/policies/prover.mdx index 45b67ea24d..e4ef7a71dd 100644 --- a/docs/how-it-works/policies/prover.mdx +++ b/docs/how-it-works/policies/prover.mdx @@ -120,7 +120,7 @@ To check the policy that a sandbox enforces, save its effective policy and use it as the candidate: ```shell -openshell sandbox get my-sandbox --policy-only > candidate.yaml +os sandbox get my-sandbox --policy-only > candidate.yaml openshell-prover check candidate.yaml --boundary boundary.yaml ``` diff --git a/docs/how-it-works/policies/schema.mdx b/docs/how-it-works/policies/schema.mdx index bb87555ab0..9e03a06d9a 100644 --- a/docs/how-it-works/policies/schema.mdx +++ b/docs/how-it-works/policies/schema.mdx @@ -97,7 +97,7 @@ were applied and skipped. A numeric ID must be from `1` through `4294967294`, so OpenShell rejects root. Each field is independent, so you can set one and let the compute driver choose the other. Docker and Podman use these fields to select the workload identity from the policy passed at creation; omitted fields use the image's `USER`. Kubernetes uses the identity configured for its driver. -MicroVM preserves the driver's resolved overlay owner. An explicit numeric selector must match that owner; `sandbox` names the guest account reconciled to that owner. A conflicting selector fails before the workload starts, and omitted fields accept the driver default. `openshell sandbox get ` reports the resolved UID:GID in its `WorkloadIdentity` condition. This condition reports identity selection, not workload readiness. Sandbox policy updates cannot change process selectors; global policy updates must still match the resolved identity. Ordinary exec uses the same identity as the canonical process. +MicroVM preserves the driver's resolved overlay owner. An explicit numeric selector must match that owner; `sandbox` names the guest account reconciled to that owner. A conflicting selector fails before the workload starts, and omitted fields accept the driver default. `os sandbox get ` reports the resolved UID:GID in its `WorkloadIdentity` condition. This condition reports identity selection, not workload readiness. Sandbox policy updates cannot change process selectors; global policy updates must still match the resolved identity. Ordinary exec uses the same identity as the canonical process. ```yaml showLineNumbers={false} process: @@ -146,7 +146,7 @@ private addresses only through `allowed_ips`. Network policy never authorizes an outbound endpoint whose destination is loopback, link-local, or unspecified, including the cloud metadata address `169.254.169.254`. This does not prevent a workload from connecting to a -sandbox-local service listening on loopback. `openshell policy update` rejects +sandbox-local service listening on loopback. `os policy update` rejects an `allowed_ips` entry that overlaps the blocked ranges, and in a complete policy such an entry blocks every connection to the endpoint. OpenShell also blocks the Kubernetes and etcd control-plane ports 2379, 2380, 6443, 10250, diff --git a/docs/how-it-works/providers/aws.mdx b/docs/how-it-works/providers/aws.mdx index 5cca768861..ce4f6b0032 100644 --- a/docs/how-it-works/providers/aws.mdx +++ b/docs/how-it-works/providers/aws.mdx @@ -21,13 +21,13 @@ Import the `aws` profile first; a gateway serves only the profiles you imported: ```shell -openshell profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/aws.yaml --global +os profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/aws.yaml --global ``` Create a provider with AWS credentials: ```shell -openshell provider create \ +os provider create \ --name aws-prod \ --type aws \ --credential AWS_ACCESS_KEY_ID=AKIA... \ @@ -37,7 +37,7 @@ openshell provider create \ For STS temporary credentials, include the session token: ```shell -openshell provider create \ +os provider create \ --name aws-sts \ --type aws \ --credential AWS_ACCESS_KEY_ID=ASIA... \ @@ -57,15 +57,15 @@ so create the provider with `--runtime-credentials` and no placeholder credential: ```shell -openshell provider create --name my-aws --type aws-s3 --runtime-credentials +os provider create --name my-aws --type aws-s3 --runtime-credentials -openshell provider refresh configure my-aws \ +os provider refresh configure my-aws \ --credential-key AWS_ACCESS_KEY_ID \ --strategy aws-sts-assume-role \ --material role_arn="arn:aws:iam::123456789012:role/SandboxS3Writer" \ --material session_name="openshell-sandbox" -openshell provider refresh rotate my-aws --credential-key AWS_ACCESS_KEY_ID +os provider refresh rotate my-aws --credential-key AWS_ACCESS_KEY_ID ``` The gateway resolves its own AWS credentials using the default credential chain @@ -73,7 +73,7 @@ The gateway resolves its own AWS credentials using the default credential chain running on AWS, provide explicit IAM keys as refresh material: ```shell -openshell provider refresh configure my-aws \ +os provider refresh configure my-aws \ --credential-key AWS_ACCESS_KEY_ID \ --strategy aws-sts-assume-role \ --material role_arn="arn:aws:iam::123456789012:role/SandboxS3Writer" \ diff --git a/docs/how-it-works/providers/google.mdx b/docs/how-it-works/providers/google.mdx index 00ac1b350d..5cae5858cc 100644 --- a/docs/how-it-works/providers/google.mdx +++ b/docs/how-it-works/providers/google.mdx @@ -19,14 +19,14 @@ Import the `google-cloud` profile first; a gateway serves only the profiles you imported: ```shell -openshell profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/google-cloud.yaml --global +os profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/google-cloud.yaml --global ``` If you already have `gcloud` configured with Application Default Credentials, create a provider with automatic credential refresh in one command: ```shell -openshell provider create \ +os provider create \ --name my-gcp \ --type google-cloud \ --from-gcloud-adc \ @@ -48,7 +48,7 @@ Use credentials from `gcloud auth application-default login`. The gateway exchanges the refresh token for short-lived access tokens automatically. ```shell -openshell provider create \ +os provider create \ --name my-gcp \ --type google-cloud \ --config project_id=my-project \ @@ -59,7 +59,7 @@ openshell provider create \ Configure credential refresh with the ADC JSON fields: ```shell -openshell provider refresh configure my-gcp \ +os provider refresh configure my-gcp \ --credential-key GCP_ADC_ACCESS_TOKEN \ --strategy oauth2-refresh-token \ --material client_id=YOUR_CLIENT_ID \ @@ -75,7 +75,7 @@ Find these values in your ADC file at Trigger the first token mint: ```shell -openshell provider refresh rotate my-gcp \ +os provider refresh rotate my-gcp \ --credential-key GCP_ADC_ACCESS_TOKEN ``` @@ -86,7 +86,7 @@ exchanges them for access tokens using the `google-service-account-jwt` strategy. ```shell -openshell provider create \ +os provider create \ --name my-gcp \ --type google-cloud \ --config project_id=my-project \ @@ -95,7 +95,7 @@ openshell provider create \ ``` ```shell -openshell provider refresh configure my-gcp \ +os provider refresh configure my-gcp \ --credential-key GCP_SA_ACCESS_TOKEN \ --strategy google-service-account-jwt \ --material client_email=sa@my-project.iam.gserviceaccount.com \ @@ -104,7 +104,7 @@ openshell provider refresh configure my-gcp \ ``` ```shell -openshell provider refresh rotate my-gcp \ +os provider refresh rotate my-gcp \ --credential-key GCP_SA_ACCESS_TOKEN ``` @@ -187,7 +187,7 @@ endpoints, each API endpoint must bind to that provider instance. Without the binding, OpenShell withholds its access token from the sandbox. The metadata token endpoint returns HTTP `503` when no bound access token is available or the token has expired. Attach the provider, add a credential -binding, and check `openshell provider refresh status my-gcp` before testing +binding, and check `os provider refresh status my-gcp` before testing token discovery. ```yaml @@ -213,9 +213,9 @@ For a running sandbox, export its base policy. Remove the metadata header above the `---` line, add the endpoint and binaries shown above, then apply the file: ```shell -openshell policy get my-sandbox --base > sandbox-policy.yaml +os policy get my-sandbox --base > sandbox-policy.yaml # Edit sandbox-policy.yaml to add the gcp_apis rule shown above. -openshell policy set my-sandbox --policy sandbox-policy.yaml --wait +os policy set my-sandbox --policy sandbox-policy.yaml --wait ``` ## Network Policy @@ -247,7 +247,7 @@ native Vertex endpoint and request format for its selected model. Import the `google-vertex-ai` profile first: ```shell -openshell profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/google-vertex-ai.yaml --global +os profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/google-vertex-ai.yaml --global ``` #### Service Account Key @@ -255,7 +255,7 @@ openshell profile import --url https://raw.githubusercontent.com/ai-openshell/op Create the provider with the JSON key as gateway-only bootstrap material: ```shell -openshell provider create \ +os provider create \ --name vertex-prod \ --type google-vertex-ai \ --credential GOOGLE_SERVICE_ACCOUNT_KEY="$(cat /path/to/key.json)" \ @@ -266,7 +266,7 @@ openshell provider create \ Configure gateway-managed refresh: ```shell -openshell provider refresh configure vertex-prod \ +os provider refresh configure vertex-prod \ --credential-key GOOGLE_VERTEX_AI_SERVICE_ACCOUNT_TOKEN \ --strategy google-service-account-jwt \ --material client_email="sa@my-gcp-project.iam.gserviceaccount.com" \ @@ -284,7 +284,7 @@ For local development: ```shell gcloud auth application-default login -openshell provider create \ +os provider create \ --name vertex-local \ --type google-vertex-ai \ --from-gcloud-adc \ @@ -312,7 +312,7 @@ location aliases such as `GOOGLE_CLOUD_PROJECT`, `ANTHROPIC_VERTEX_PROJECT_ID`, Attach it while creating a sandbox: ```shell -openshell sandbox create \ +os sandbox create \ --from registry.example.com/team/agent:1.0 \ --name vertex-agent \ --provider vertex-local @@ -321,7 +321,7 @@ openshell sandbox create \ Or attach it to an existing sandbox: ```shell -openshell sandbox provider attach vertex-agent vertex-local +os sandbox provider attach vertex-agent vertex-local ``` Launch a new process after runtime attachment so it receives the provider @@ -334,7 +334,7 @@ Claude models use Vertex's publisher-model endpoint. Run a request from a new sandbox process: ```shell -openshell sandbox exec vertex-agent -- sh -lc ' +os sandbox exec vertex-agent -- sh -lc ' token=${GOOGLE_VERTEX_AI_SERVICE_ACCOUNT_TOKEN:-$GOOGLE_VERTEX_AI_TOKEN} curl -X POST \ -H "Authorization: Bearer $token" \ @@ -361,9 +361,9 @@ and timeout in the client. OpenShell does not rewrite them. Inspect the attachment and effective policy: ```shell -openshell sandbox provider list vertex-agent -openshell policy get vertex-agent --full -openshell provider refresh status vertex-local +os sandbox provider list vertex-agent +os policy get vertex-agent --full +os provider refresh status vertex-local ``` Common failures: diff --git a/docs/how-it-works/providers/overview.mdx b/docs/how-it-works/providers/overview.mdx index 4a75daca6f..b69a048263 100644 --- a/docs/how-it-works/providers/overview.mdx +++ b/docs/how-it-works/providers/overview.mdx @@ -61,10 +61,10 @@ Lint and import the profile into your current workspace, then view the available profiles: ```shell -openshell profile lint -f github.yaml -openshell profile import -f github.yaml -openshell profile list -openshell profile describe github +os profile lint -f github.yaml +os profile import -f github.yaml +os profile list +os profile describe github ``` ### Provider Examples @@ -84,14 +84,14 @@ token that has only read permissions. Passing `--credential GITHUB_TOKEN` withou a value reads the token from the environment. ```shell -openshell provider create --name my-github --type github --credential GITHUB_TOKEN +os provider create --name my-github --type github --credential GITHUB_TOKEN ``` Because the profile declares `discovery`, `--from-existing` does the same lookup for every discoverable credential: ```shell -openshell provider create --name my-github --type github --from-existing +os provider create --name my-github --type github --from-existing ``` `--credential GITHUB_TOKEN=` stores an explicit value instead, but @@ -108,7 +108,7 @@ matches your imported profile. Attach `my-github` and make an authenticated request inside the sandbox: ```shell -openshell sandbox create --no-keep --from "$SANDBOX_IMAGE" --provider my-github -- \ +os sandbox create --no-keep --from "$SANDBOX_IMAGE" --provider my-github -- \ sh -c 'curl --fail --silent --show-error -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user' ``` @@ -121,8 +121,8 @@ contribute network policy entries. Each static credential resolves only for endpoints in its profile, or for sandbox policy endpoints explicitly bound to an endpointless profile. -To change the providers on an existing sandbox, use `openshell sandbox provider attach` -or `openshell sandbox provider detach`. See +To change the providers on an existing sandbox, use `os sandbox provider attach` +or `os sandbox provider detach`. See [Attach and Detach Providers](/how-it-works/providers/profiles#attach-and-detach-providers). Provider attachment checks credential inspection against the latest saved sandbox @@ -138,7 +138,7 @@ For profiles with a `discovery` section, pass the imported profile ID to credentials before attaching it: ```shell -openshell sandbox create --no-keep --from "$SANDBOX_IMAGE" --provider github -- \ +os sandbox create --no-keep --from "$SANDBOX_IMAGE" --provider github -- \ sh -c 'curl --fail --silent --show-error -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user' ``` @@ -154,8 +154,8 @@ from the command or from the profile's `binaries` list. List providers in the current workspace and inspect `my-github`: ```shell -openshell provider list -openshell provider get my-github +os provider list +os provider get my-github ``` Use `-o json` or `-o yaml` for machine-readable output. The list envelope contains @@ -167,13 +167,13 @@ to continue. To replace the GitHub token, export the replacement as `GITHUB_TOKEN` and run: ```shell -openshell provider update my-github --credential GITHUB_TOKEN +os provider update my-github --credential GITHUB_TOKEN ``` Add `--wait` to wait for currently attached sandboxes to apply the update: ```shell -openshell provider update my-github --credential GITHUB_TOKEN --wait --timeout 30 --output json +os provider update my-github --credential GITHUB_TOKEN --wait --timeout 30 --output json ``` The result includes a change ID and an outcome for each selected sandbox. @@ -192,7 +192,7 @@ To record when a token expires, pass an RFC3339 timestamp or Unix epoch milliseconds: ```shell -openshell provider update my-github \ +os provider update my-github \ --credential GITHUB_TOKEN \ --credential-expires-at GITHUB_TOKEN=2027-01-01T00:00:00Z ``` @@ -220,10 +220,10 @@ binaries: [/usr/bin/python3] Import it, create a labeled provider, and filter by its labels: ```shell -openshell profile import -f pypi.yaml -openshell provider create --name public-pypi --type pypi --label env=dev --label team=ml -openshell provider list --label-selector env=dev,team=ml -openshell provider get public-pypi +os profile import -f pypi.yaml +os provider create --name public-pypi --type pypi --label env=dev --label team=ml +os provider list --label-selector env=dev,team=ml +os provider get public-pypi ``` A comma-separated selector matches providers with every listed key-value pair. @@ -323,7 +323,7 @@ identity assertion or an upstream credential. Export the profile to inspect its credential boundary: ```shell -openshell profile export github -o yaml +os profile export github -o yaml ``` ## Update or Remove a Profile @@ -332,8 +332,8 @@ To edit the GitHub profile, export it, change the metadata or policy, and keep its `id` and exported `resource_version`: ```shell -openshell profile export github -o yaml > github-profile.yaml -openshell profile update github -f github-profile.yaml +os profile export github -o yaml > github-profile.yaml +os profile update github -f github-profile.yaml ``` Import fails if the profile ID already exists. Use `profile update` for @@ -346,8 +346,8 @@ Then delete the providers and profiles, adding `github` to the provider list if you used the auto-discovery shortcut: ```shell -openshell provider delete my-github public-pypi -openshell profile delete github pypi +os provider delete my-github public-pypi +os profile delete github pypi ``` Both delete commands accept multiple names or IDs. If one deletion fails, @@ -355,7 +355,7 @@ OpenShell attempts the remaining deletions and returns a nonzero exit code. ## Available Provider Types -Run `openshell profile list` to see which profile IDs you can use with `--type`. +Run `os profile list` to see which profile IDs you can use with `--type`. Write your own profile using the [profile schema](/how-it-works/providers/profiles#profile-schema). ## Credential Refresh @@ -368,28 +368,28 @@ and [Dynamic Token Grants](/how-it-works/providers/profiles#dynamic-token-grants ### Shared Secret Material A [workspace secret](/how-it-works/gateways/configuration#workspace-secrets) can -hold a client secret for multiple providers. Create it with `openshell secret create`, +hold a client secret for multiple providers. Create it with `os secret create`, passing `--value-env` for the secret's environment variable and `--allowed-endpoint` -for each permitted token endpoint. Reference it from `openshell provider refresh configure` +for each permitted token endpoint. Reference it from `os provider refresh configure` with `--material-secret KEY=SECRET`. The gateway reads the current value at each mint. Refresh tokens must remain separate for each provider. The gateway operator must enable workspace secrets with `enable_workspace_secrets`. -Rotate the shared value with `openshell secret update --value-file `. +Rotate the shared value with `os secret update --value-file `. The file is stored exactly as read, including any trailing newline, so write it with `printf '%s'`. Each provider uses the new value at its next refresh; -`openshell provider refresh rotate` applies it immediately. +`os provider refresh rotate` applies it immediately. Set the allowed endpoints at creation. A secret without one cannot be used for refresh. The gateway does not follow token endpoint redirects when a workspace secret is in use. Workspace secrets work with the OAuth2, Google service account, and GitHub App installation strategies, not `aws_sts_assume_role`. -Before deleting a referenced secret, use `openshell provider refresh inline-secrets` +Before deleting a referenced secret, use `os provider refresh inline-secrets` to remove the reference without replacing the provider's current grant. Use -`openshell provider refresh status` to find which secrets a provider references. -If credential storage fails during deletion, `openshell secret list` shows the -secret as `deleting`. Rerun `openshell secret delete` to finish the cleanup. +`os provider refresh status` to find which secrets a provider references. +If credential storage fails during deletion, `os secret list` shows the +secret as `deleting`. Rerun `os secret delete` to finish the cleanup. ### Replace a token endpoint with a literal caret @@ -398,9 +398,9 @@ sending credentials. For example, `/a^b` and `/a%5Eb` can reach different handlers on the same server. A secret granted access to `/a^b` needs a new grant to reach `/a%5Eb`. -1. Before upgrading, check each workspace with `openshell secret list` and +1. Before upgrading, check each workspace with `os secret list` and follow any `--page-token`. This lists grants without revealing secret values. - Use `openshell profile list` and `openshell profile export ID` to check + Use `os profile list` and `os profile export ID` to check refresh and dynamic token-grant URLs, including profiles that use inline credentials. Add `--global` to inspect platform profiles. An existing refresh record can still use the URL from an earlier profile revision. @@ -413,10 +413,10 @@ grant to reach `/a%5Eb`. new name, supply the value through `--value-env` or `--value-file`, and set `--allowed-endpoint` to the exact URL the owner approved. A GitHub App grant uses the numeric installation ID. -4. For each affected refresh credential, run `openshell provider refresh +4. For each affected refresh credential, run `os provider refresh configure` with its complete material and any new secret references. Run - `openshell provider refresh rotate NAME --credential-key KEY` and verify a - new successful mint with `openshell provider refresh status NAME`. Restart + `os provider refresh rotate NAME --credential-key KEY` and verify a + new successful mint with `os provider refresh status NAME`. Restart workloads that hold the previous credential handle. Apply the same steps to any old refresh record that reports a literal-caret diff --git a/docs/how-it-works/providers/profiles.mdx b/docs/how-it-works/providers/profiles.mdx index 9b083fe05e..71be045931 100644 --- a/docs/how-it-works/providers/profiles.mdx +++ b/docs/how-it-works/providers/profiles.mdx @@ -34,15 +34,15 @@ Provider profiles include these user-facing features: - An import-only catalog: the gateway serves the profiles you imported and nothing else. A gateway with none imported serves an empty catalog. - Gateway configuration can compose user-managed and interceptor-vended profile sources. Selecting only an interceptor makes its catalog authoritative by omission. - Platform-scoped and workspace-scoped profiles. A workspace profile takes precedence over a platform profile with the same ID inside that workspace, and the platform profile applies outside it. An interceptor-vended profile cannot share an ID with an imported one; that collision fails closed. -- `openshell profile list` and `openshell profile describe` with table, YAML, and JSON output. -- `openshell profile export`, `import`, `update`, `lint`, and `delete` for custom profiles. -- Provider instances created from imported profile IDs with `openshell provider create --type `. +- `os profile list` and `os profile describe` with table, YAML, and JSON output. +- `os profile export`, `import`, `update`, `lint`, and `delete` for custom profiles. +- Provider instances created from imported profile IDs with `os provider create --type `. - Provider instances whose submitted credentials can be stored by a configured gateway credential driver. -- Profile-backed credential discovery for explicit `openshell provider create --from-existing` and `openshell provider update --from-existing` flows. The `google-vertex-ai` profile also supplements discovery with Vertex config env vars such as `VERTEX_AI_PROJECT_ID` and `VERTEX_AI_REGION`. +- Profile-backed credential discovery for explicit `os provider create --from-existing` and `os provider update --from-existing` flows. The `google-vertex-ai` profile also supplements discovery with Vertex config env vars such as `VERTEX_AI_PROJECT_ID` and `VERTEX_AI_REGION`. - Just-in-time effective policy composition from sandbox policy plus attached provider profiles. -- Runtime sandbox provider commands under `openshell sandbox provider list|attach|detach|status`, with an option to wait until the sandbox applies a change. -- Credential refresh configuration with `openshell provider refresh status|configure|rotate|delete`. -- Credential expiry metadata with `openshell provider update --credential-expires-at`; values accept Unix epoch milliseconds or ISO/RFC3339 timestamps. +- Runtime sandbox provider commands under `os sandbox provider list|attach|detach|status`, with an option to wait until the sandbox applies a change. +- Credential refresh configuration with `os provider refresh status|configure|rotate|delete`. +- Credential expiry metadata with `os provider update --credential-expires-at`; values accept Unix epoch milliseconds or ISO/RFC3339 timestamps. - Dynamic token grants that use the sandbox's SPIFFE JWT-SVID as an OAuth2 client assertion and inject short-lived tokens into supported headers for matching profile endpoints. - Endpoint-bound static credential placeholders. The sandbox proxy resolves a static credential only for request hosts, ports, and paths declared by its provider profile or explicitly bound in sandbox policy for an endpointless profile. @@ -255,7 +255,7 @@ The following provider profile design items are not part of the current behavior | Roadmap item | Current behavior | |---|---| | Binary-scoped credential injection | Static placeholder resolution is endpoint-scoped. Dynamic grants in single-route REST and multi-route inspection also require admission by their owning endpoint's policy, including its binary restrictions. L4-only credential forwarding retains endpoint-selector matching. | -| Credential verification on create | `openshell provider create` does not yet probe provider verification endpoints or expose `--no-verify`. | +| Credential verification on create | `os provider create` does not yet probe provider verification endpoints or expose `--no-verify`. | | Automatic credential scope extraction | OpenShell does not yet inspect upstream provider responses to discover credential scopes. | | Policy prover integration | OpenShell does not yet run the policy prover automatically on sandbox startup or block startup based on prover findings. | | Refresh telemetry as OCSF events | Credential refresh logs are secret-safe gateway logs. OCSF refresh events and metrics are future work. | @@ -267,15 +267,15 @@ inference provider and call its native endpoint. A provider profile defines a provider type. It contains metadata, credential declarations, endpoint policy, binary policy, an informational provider category, and optional credential refresh metadata. -Use `openshell profile` to discover, inspect, and manage reusable profile definitions. Use `openshell provider` to manage provider instances and their credential values. Provider profiles are the supported profile type. +Use `os profile` to discover, inspect, and manage reusable profile definitions. Use `os provider` to manage provider instances and their credential values. Provider profiles are the supported profile type. -Existing command names remain supported. `openshell provider list-profiles` is equivalent to `openshell profile list --type provider`, and `openshell provider profile export/import/update/lint/delete` invokes the same handlers as the corresponding `openshell profile` commands. The nested commands retain their existing arguments, output options, and workspace/global flags. New examples use the top-level form. +Existing command names remain supported. `os provider list-profiles` is equivalent to `os profile list --type provider`, and `os provider profile export/import/update/lint/delete` invokes the same handlers as the corresponding `os profile` commands. The nested commands retain their existing arguments, output options, and workspace/global flags. New examples use the top-level form. List available profiles: ```shell -openshell profile list -openshell profile list --type provider -o json +os profile list +os profile list --type provider -o json ``` The default table shows `NAME`, `TYPE`, `CATEGORY`, `SOURCE`, and `SCOPE`. `NAME` is the profile ID used by the other profile commands and by `provider create --type`. The optional `--type provider` filter selects provider profiles. Use `-o json` or `-o yaml` for structured output. @@ -283,8 +283,8 @@ The default table shows `NAME`, `TYPE`, `CATEGORY`, `SOURCE`, and `SCOPE`. `NAME Inspect one profile before creating a provider: ```shell -openshell profile describe github -openshell profile describe github -o yaml +os profile describe github +os profile describe github -o yaml ``` The description shows metadata, credential names and authentication settings, endpoints with their protocols and policy rule counts, allowed binaries, source, and scope. Endpoint details include TLS handling, permission for uninspected credential traffic, and MCP method and tool-name settings. A `tls: skip` endpoint is shown as a raw tunnel without L7 inspection or credential rewrite, even when it declares an L7 protocol and rules. Use JSON or YAML output to inspect the complete rule definitions. The description reads the reusable definition without reading credential values from provider instances. A missing profile ID returns an error. @@ -294,10 +294,10 @@ For MCP endpoints, the text output labels `allow_all_known_mcp_methods` as `Allo List and describe use the selected workspace's effective catalog. Pass the inherited `--workspace` flag to select another workspace, or `--global` to target platform scope. Platform operations require Platform Admin access. ```shell -openshell profile list --workspace team-ml -openshell profile describe github --workspace team-ml -openshell profile list --global -openshell profile describe github --global +os profile list --workspace team-ml +os profile describe github --workspace team-ml +os profile list --global +os profile describe github --global ``` A gateway serves exactly the profiles you imported. OpenShell ships no profiles inside the gateway binary, so a new gateway lists an empty catalog until you import one. When a configured gateway interceptor vends an authoritative provider profile catalog, that catalog becomes the visible source of truth: list, describe, export, provider creation, policy composition, and sandbox provider environment resolution use the interceptor-vended profiles. @@ -317,8 +317,8 @@ profile's `binaries` and `endpoints` match your image and workload, import it directly from the repository: ```shell -openshell profile lint --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/github.yaml -openshell profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/github.yaml --global +os profile lint --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/github.yaml +os profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/github.yaml --global ``` `--url` accepts one HTTP or HTTPS `.yaml`, `.yml`, or `.json` profile. It cannot @@ -335,19 +335,19 @@ but its credential is not injected and its traffic is denied. Lint a local profile before importing it: ```shell -openshell profile lint -f providers/github.yaml +os profile lint -f providers/github.yaml ``` Import one profile file at platform scope: ```shell -openshell profile import -f providers/github.yaml --global +os profile import -f providers/github.yaml --global ``` Import all non-recursive `*.yaml`, `*.yml`, and `*.json` files from a directory: ```shell -openshell profile import --from ./providers --global +os profile import --from ./providers --global ``` Omit `--global` to import into the current workspace instead. @@ -355,7 +355,7 @@ Omit `--global` to import into the current workspace instead. Export a profile as YAML, to edit or to keep before an upgrade: ```shell -openshell profile export github -o yaml --global > github-profile.yaml +os profile export github -o yaml --global > github-profile.yaml ``` Import is create-only. It fails if a custom profile with the same ID already exists. @@ -363,8 +363,8 @@ Import is create-only. It fails if a custom profile with the same ID already exi Update an existing custom profile by exporting the current custom profile, editing the file, and submitting the edited file back: ```shell -openshell profile export github-profile -o yaml > github-profile.yaml -openshell profile update github-profile -f github-profile.yaml +os profile export github-profile -o yaml > github-profile.yaml +os profile update github-profile -f github-profile.yaml ``` Exported custom profiles include `resource_version`. OpenShell requires that version during update so stale files cannot silently overwrite newer profile definitions. The target ID in the command must match the profile ID in the file. Update accepts one file at a time. If an update would make dynamic token grants ambiguous for an attached sandbox, OpenShell rejects it before changing the profile. @@ -372,7 +372,7 @@ Exported custom profiles include `resource_version`. OpenShell requires that ver Delete custom profiles by ID: ```shell -openshell profile delete custom-api custom-alt +os profile delete custom-api custom-alt ``` Export accepts `-o yaml` or `-o json` and defaults to YAML. Lint also accepts `--from ` and asks the gateway to validate the supplied definitions without storing them. Export, import, update, lint, and delete use the selected workspace unless you pass `--global`. @@ -381,7 +381,7 @@ Profile IDs must use lowercase kebab-case with `a-z`, `0-9`, and `-`. No IDs are ### Category Enum -The `category` field supplies the `CATEGORY` column in `openshell profile list`. Use one of these canonical YAML values: +The `category` field supplies the `CATEGORY` column in `os profile list`. Use one of these canonical YAML values: | Value | Use for | |---|---| @@ -530,9 +530,9 @@ import for compatibility. ### Profile Sections -`id`, `display_name`, and `description` identify the profile. `id` is the value passed to `openshell provider create --type`. +`id`, `display_name`, and `description` identify the profile. `id` is the value passed to `os provider create --type`. -`category` supplies the `CATEGORY` column in `openshell profile list`. Use one of the values in the category enum. +`category` supplies the `CATEGORY` column in `os profile list`. Use one of the values in the category enum. `credentials` declares the credential names, environment variables, auth metadata, optional refresh metadata, and optional dynamic token grant metadata for the provider type. The `auth_style` field accepts `basic`, `bearer`, `header`, `query`, `path`, or `path_subtree`. @@ -574,15 +574,15 @@ Profile YAML can declare these refresh strategies: | Strategy | Behavior | |---|---| -| `static` | Current credentials are updated through `openshell provider update`. The gateway does not mint a token. | -| `external` | An external process updates current credentials through `openshell provider update`. The gateway does not mint a token. | +| `static` | Current credentials are updated through `os provider update`. The gateway does not mint a token. | +| `external` | An external process updates current credentials through `os provider update`. The gateway does not mint a token. | | `oauth2_refresh_token` | The gateway exchanges a refresh token for a short-lived access token. | | `oauth2_client_credentials` | The gateway mints a short-lived access token with OAuth2 client credentials. | | `google_service_account_jwt` | The gateway signs a Google service account JWT and exchanges it for an access token. | | `aws_sts_assume_role` | The gateway calls `sts:AssumeRole` and mints `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` in one operation. | | `github_app_installation` | The gateway signs a GitHub App JWT and mints an installation token restricted to explicit repositories and permissions. | -`openshell provider refresh configure` accepts only gateway-mintable strategies: `oauth2-refresh-token`, `oauth2-client-credentials`, `google-service-account-jwt`, `aws-sts-assume-role`, and `github-app-installation`. Use `openshell provider update` for `static` and `external` refresh patterns. +`os provider refresh configure` accepts only gateway-mintable strategies: `oauth2-refresh-token`, `oauth2-client-credentials`, `google-service-account-jwt`, `aws-sts-assume-role`, and `github-app-installation`. Use `os provider update` for `static` and `external` refresh patterns. Gateway-managed refresh strategies use these material keys: @@ -631,9 +631,9 @@ Replace the example IDs with your app client ID, installation ID, and repository ```shell export GITHUB_APP_PRIVATE_KEY="$(cat /secure/path/github-app.pem)" -openshell provider profile import -f github-app.yaml -openshell provider create --name repo-reader --type github-app --runtime-credentials -openshell provider refresh configure repo-reader \ +os provider profile import -f github-app.yaml +os provider create --name repo-reader --type github-app --runtime-credentials +os provider refresh configure repo-reader \ --credential-key GITHUB_TOKEN \ --strategy github-app-installation \ --material client_id=Iv1.example \ @@ -642,25 +642,25 @@ openshell provider refresh configure repo-reader \ --material 'permissions={"contents":"read"}' \ --secret-material-env private_key=GITHUB_APP_PRIVATE_KEY unset GITHUB_APP_PRIVATE_KEY -openshell provider refresh rotate repo-reader --credential-key GITHUB_TOKEN -openshell provider refresh status repo-reader -openshell sandbox create --provider repo-reader +os provider refresh rotate repo-reader --credential-key GITHUB_TOKEN +os provider refresh status repo-reader +os sandbox create --provider repo-reader ``` To share the private key through a workspace secret, enable workspace secrets on the gateway, then create the secret with the concrete installation endpoint: ```shell -openshell secret create github-app-key \ +os secret create github-app-key \ --value-file /secure/path/github-app.pem \ --allowed-endpoint https://api.github.com/app/installations/12345/access_tokens ``` In the refresh configuration above, replace `--secret-material-env private_key=GITHUB_APP_PRIVATE_KEY` with `--material-secret private_key=github-app-key`. -The gateway reads the current key at each mint. Use `openshell secret update +The gateway reads the current key at each mint. Use `os secret update github-app-key --value-file /secure/path/replacement.pem` followed by -`openshell provider refresh rotate repo-reader --credential-key GITHUB_TOKEN` +`os provider refresh rotate repo-reader --credential-key GITHUB_TOKEN` to test key rotation without reconfiguring the provider. The allowed endpoint must contain the installation ID, not `{installation_id}`. @@ -683,11 +683,11 @@ the gateway withholds the other alias while refresh is active. To switch aliases delete the selected alias's refresh configuration first. Deletion retires the minted token from that provider alias. If you already switched aliases on an older gateway and the retired alias is still present, clear it explicitly. For example, after -switching to `GITHUB_TOKEN`, run `openshell provider update repo-reader --credential GH_TOKEN=`. +switching to `GITHUB_TOKEN`, run `os provider update repo-reader --credential GH_TOKEN=`. Older gateways allowed refresh states under `api_token` or both environment aliases. If these states cause a conflict, run -`openshell provider refresh status repo-reader` without a credential filter, +`os provider refresh status repo-reader` without a credential filter, delete the conflicting refresh configurations using their exact reported keys, and configure refresh again. @@ -824,7 +824,7 @@ OpenShell supports two dynamic grant types: Create provider instances for token-grant-only profiles with `--runtime-credentials`. This records an empty provider instance and makes the runtime-resolved credential source explicit: ```shell -openshell provider create \ +os provider create \ --name spiffe-token-demo \ --type spiffe-token-demo \ --runtime-credentials @@ -833,12 +833,12 @@ openshell provider create \ For `token_exchange` profiles, the provider also stores the user subject token referenced by `token_grant.subject_token.credential`. That credential is gateway-only: the sandbox does not receive it as environment material, static credential binding metadata, or workload placeholder ownership. Create or update that provider credential from the current gateway OIDC login with `--from-oidc-token`. This requires an active named gateway that was registered for OIDC. The CLI copies the current OIDC access token and its expiry into the provider. If the stored gateway access token is expired and a refresh token is available, the CLI refreshes it first. OpenShell does not store the OIDC refresh token in the provider. When the stored subject-token credential expires, the gateway rejects intermediate token exchange until the provider is updated with a fresh token. ```shell -openshell provider create \ +os provider create \ --name custom-api \ --type custom-api \ --from-oidc-token -openshell provider update custom-api \ +os provider update custom-api \ --from-oidc-token ``` @@ -909,7 +909,7 @@ A provider instance stores concrete credentials and config for a profile type. ` Create a GitHub provider from an imported `github` profile: ```shell -openshell provider create \ +os provider create \ --name work-github \ --type github \ --credential GITHUB_TOKEN @@ -918,7 +918,7 @@ openshell provider create \ Create a provider from local credentials discovered through the provider profile: ```shell -openshell provider create \ +os provider create \ --name work-claude \ --type claude-code \ --from-existing @@ -933,7 +933,7 @@ back to the retired provider registry. The example `openai` profile discovers Create a provider from another imported profile: ```shell -openshell provider create \ +os provider create \ --name custom-api \ --type custom-api \ --credential CUSTOM_API_TOKEN @@ -943,7 +943,7 @@ Create a provider whose credential is stored by a configured gateway credential driver: ```shell -openshell provider create \ +os provider create \ --name openai-stored \ --type openai \ --credential OPENAI_API_KEY @@ -974,19 +974,19 @@ Provider profiles whose required credentials are fully runtime-resolvable throug Inspect the provider: ```shell -openshell provider get custom-api +os provider get custom-api ``` Update provider credentials: ```shell -openshell provider update custom-api --credential CUSTOM_API_TOKEN +os provider update custom-api --credential CUSTOM_API_TOKEN ``` Set or clear credential expiry metadata: ```shell -openshell provider update custom-api \ +os provider update custom-api \ --credential CUSTOM_API_TOKEN="$CUSTOM_API_TOKEN" \ --credential-expires-at CUSTOM_API_TOKEN=2026-01-01T00:00:00Z ``` @@ -1075,7 +1075,7 @@ The profile YAML strategy values use underscores, while the CLI `--strategy` val Create the provider instance first: ```shell -openshell provider create \ +os provider create \ --name my-graph \ --type microsoft-graph-mail \ --credential MS_GRAPH_ACCESS_TOKEN @@ -1088,7 +1088,7 @@ types whose profile declares compatible credential refresh metadata. Configure OAuth2 client credentials refresh: ```shell -openshell provider refresh configure my-graph \ +os provider refresh configure my-graph \ --credential-key MS_GRAPH_ACCESS_TOKEN \ --strategy oauth2-client-credentials \ --material tenant_id="$MS_TENANT_ID" \ @@ -1101,7 +1101,7 @@ openshell provider refresh configure my-graph \ Configure OAuth2 refresh-token refresh: ```shell -openshell provider refresh configure my-graph \ +os provider refresh configure my-graph \ --credential-key MS_GRAPH_ACCESS_TOKEN \ --strategy oauth2-refresh-token \ --material client_id="$MS_CLIENT_ID" \ @@ -1114,12 +1114,12 @@ openshell provider refresh configure my-graph \ Configure Google service account JWT refresh: ```shell -openshell provider create \ +os provider create \ --name drive-work \ --type google-drive \ --credential GOOGLE_DRIVE_ACCESS_TOKEN -openshell provider refresh configure drive-work \ +os provider refresh configure drive-work \ --credential-key GOOGLE_DRIVE_ACCESS_TOKEN \ --strategy google-service-account-jwt \ --material client_email="$GOOGLE_CLIENT_EMAIL" \ @@ -1138,14 +1138,14 @@ Use `--credential-expires-at` when the current provider credential already has a Force a refresh immediately: ```shell -openshell provider refresh rotate my-graph \ +os provider refresh rotate my-graph \ --credential-key MS_GRAPH_ACCESS_TOKEN ``` Check refresh status: ```shell -openshell provider refresh status my-graph +os provider refresh status my-graph ``` The status table includes `RECOVERY` and `FAILURE_CODE`. Clients should use the @@ -1176,11 +1176,11 @@ No refresh configuration found for provider 'my-graph' credential 'MS_GRAPH_ACCE Delete refresh state for one credential: ```shell -openshell provider refresh delete my-graph \ +os provider refresh delete my-graph \ --credential-key MS_GRAPH_ACCESS_TOKEN ``` -Deleting refresh state clears the provider credential expiry only when that expiry came from the deleted refresh state, including an explicit Unix epoch expiry. If you later set a different expiry manually with `openshell provider update --credential-expires-at`, OpenShell preserves the manual value. +Deleting refresh state clears the provider credential expiry only when that expiry came from the deleted refresh state, including an explicit Unix epoch expiry. If you later set a different expiry manually with `os provider update --credential-expires-at`, OpenShell preserves the manual value. ### Refresh Logs @@ -1202,7 +1202,7 @@ Refresh updates the provider record. Sandboxes receive the updated credential th Attach providers when creating a sandbox with repeated `--provider` flags: ```shell -openshell sandbox create \ +os sandbox create \ --name provider-demo \ --provider work-claude \ --provider work-github \ @@ -1216,13 +1216,13 @@ Updating a custom provider profile affects every provider instance whose `type` Name a provider with `--provider` when creating a sandbox. If no provider has that name and it matches an imported profile ID, the CLI can create the provider from local profile discovery. The trailing sandbox command does not -select a provider. Use `openshell sandbox provider attach` to add an existing +select a provider. Use `os sandbox provider attach` to add an existing provider after creation. List providers attached to a sandbox: ```shell -openshell sandbox provider list provider-demo +os sandbox provider list provider-demo ``` The list output includes provider name, provider type, credential key count, and config key count. @@ -1320,13 +1320,13 @@ network_policies: Inspect the effective policy: ```shell -openshell policy get provider-demo --full +os policy get provider-demo --full ``` Pull the round-trippable base policy without provider entries: ```shell -openshell policy get provider-demo --base +os policy get provider-demo --base ``` Composition follows these rules: @@ -1342,13 +1342,13 @@ Composition follows these rules: Attach an existing provider and wait until the sandbox can use it: ```shell -openshell sandbox provider attach provider-demo work-github --wait --timeout 30 +os sandbox provider attach provider-demo work-github --wait --timeout 30 ``` Detach a provider and wait until the sandbox stops resolving its credentials: ```shell -openshell sandbox provider detach provider-demo work-github --wait --timeout 30 +os sandbox provider detach provider-demo work-github --wait --timeout 30 ``` Attach and detach are idempotent. Attach validates that the provider exists before mutating the sandbox, and provider deletion fails while the provider is attached to any sandbox. @@ -1360,8 +1360,8 @@ Without `--wait`, attach, detach, and update confirm that the gateway saved the Each result includes a change record called a `receipt` in the API. Its ID lets you check the same change later, including after a timeout: ```shell -openshell sandbox provider status provider-demo work-github --output json -openshell sandbox provider status provider-demo work-github --receipt RECEIPT_ID --wait --timeout 30 +os sandbox provider status provider-demo work-github --output json +os sandbox provider status provider-demo work-github --receipt RECEIPT_ID --wait --timeout 30 ``` Replace `RECEIPT_ID` with the `receipt_id` returned by attach, detach, or update. The ID always refers to the original change. If a later change replaces it, the status is `superseded` and the wait ends without reporting success. diff --git a/docs/how-it-works/sandboxes/overview.mdx b/docs/how-it-works/sandboxes/overview.mdx index 123678e9fe..5bd93bd1eb 100644 --- a/docs/how-it-works/sandboxes/overview.mdx +++ b/docs/how-it-works/sandboxes/overview.mdx @@ -17,7 +17,7 @@ A sandbox is the OpenShell data plane: a safe, private execution environment whe Create a sandbox with a single command. For example, to create a sandbox with Claude, run: ```shell -openshell sandbox create --from registry.example.com/your-org/claude-agent:latest -- claude +os sandbox create --from registry.example.com/your-org/claude-agent:latest -- claude ``` The trailing command is the sandbox's canonical main process. OpenShell streams @@ -30,7 +30,7 @@ minimal bases like Alpine. Add `--detach` to create the sandbox without attaching: ```shell -openshell sandbox create --name worker --detach -- ./worker +os sandbox create --name worker --detach -- ./worker ``` Drivers that do not support foreground attachment reject the request before @@ -40,7 +40,7 @@ Use `--restart-policy on-failure` to replace the runtime after a nonzero main process exit, or `--restart-policy always` to replace it after every exit: ```shell -openshell sandbox create --name worker --detach --restart-policy on-failure -- ./worker +os sandbox create --name worker --detach --restart-policy on-failure -- ./worker ``` The default policy is `never`. The gateway starts the first replacement as soon @@ -60,14 +60,14 @@ Use `--no-keep` for an ephemeral command. OpenShell drains stdout and stderr, captures the command result, and deletes the sandbox after the command exits: ```shell -openshell sandbox create --no-keep -- sh -c 'echo done; exit 0' +os sandbox create --no-keep -- sh -c 'echo done; exit 0' ``` Combine `--detach` and `--no-keep` for a background workload whose lifecycle belongs entirely to the gateway: ```shell -openshell sandbox create --detach --no-keep -- ./worker +os sandbox create --detach --no-keep -- ./worker ``` The create command returns after the workload is ready. The gateway keeps the @@ -86,14 +86,14 @@ long system prompt, with `sandbox upload` and read it inside the sandbox. For automation, use `--output json` or `--output yaml` to get machine-readable sandbox metadata after creation: ```shell -openshell sandbox create --output json +os sandbox create --output json ``` Every sandbox requires a gateway. Register or select one before running sandbox commands: ```shell -openshell gateway add http://127.0.0.1:18080 --local --name local -openshell gateway select local +os gateway add http://127.0.0.1:18080 --local --name local +os gateway select local ``` ### CPU and Memory @@ -101,7 +101,7 @@ openshell gateway select local Set per-sandbox CPU and memory amounts with `--cpu` and `--memory`: ```shell -openshell sandbox create --from registry.example.com/your-org/claude-agent:latest --cpu 2 --memory 4Gi -- claude +os sandbox create --from registry.example.com/your-org/claude-agent:latest --cpu 2 --memory 4Gi -- claude ``` CPU values use Kubernetes-style quantities such as `500m`, `1`, or `2.5`. @@ -122,7 +122,7 @@ Nested keys inside each driver block use snake_case. The top-level envelope keys are driver names, such as `kubernetes`, and are not part of the nested schema. ```shell -openshell sandbox create \ +os sandbox create \ --driver-config-json '{"kubernetes":{"pod":{"runtime_class_name":"kata-containers","node_selector":{"pool":"gpu"}}}}' \ -- claude ``` @@ -136,13 +136,13 @@ the same behavior. To request GPU resources, add `--gpu`: ```shell -openshell sandbox create --gpu --from registry.example.com/your-org/gpu-agent:latest -- claude +os sandbox create --gpu --from registry.example.com/your-org/gpu-agent:latest -- claude ``` Request a specific number of GPUs by passing a count to `--gpu`: ```shell -openshell sandbox create --gpu 2 --from registry.example.com/your-org/gpu-agent:latest -- claude +os sandbox create --gpu 2 --from registry.example.com/your-org/gpu-agent:latest -- claude ``` When you omit the count, OpenShell treats the request as `--gpu 1`. @@ -170,7 +170,7 @@ The list must not contain duplicate IDs, and its length must match the effective GPU count: ```shell -openshell sandbox create \ +os sandbox create \ --gpu \ --driver-config-json '{"docker":{"cdi_devices":["nvidia.com/gpu=0"]}}' \ -- claude @@ -184,9 +184,9 @@ built-in default is `nvcr.io/nvidia/base/ubuntu:24.04`. Use `--from` with an explicit OCI image reference or a rootfs tar archive: ```shell -openshell sandbox create --from nvcr.io/nvidia/base/ubuntu:24.04 -openshell sandbox create --from my-registry.example.com/my-image:latest -openshell sandbox create --from ./rootfs.tar +os sandbox create --from nvcr.io/nvidia/base/ubuntu:24.04 +os sandbox create --from my-registry.example.com/my-image:latest +os sandbox create --from ./rootfs.tar ``` `--from` does not expand catalog aliases and does not build local Dockerfiles or @@ -196,18 +196,18 @@ local gateway, then pass the resulting image reference: ```shell # Docker gateway docker build -t my-image:latest . -openshell sandbox create --from my-image:latest +os sandbox create --from my-image:latest # Podman gateway podman build -t localhost/my-image:latest . -openshell sandbox create --from localhost/my-image:latest +os sandbox create --from localhost/my-image:latest ``` For a remote gateway, push the image to a registry that the gateway can pull from and use that registry image reference. -**Pre-0.1.0 breaking change:** `openshell sandbox create --from ./Dockerfile` +**Pre-0.1.0 breaking change:** `os sandbox create --from ./Dockerfile` and directory sources no longer build images. Bare catalog names are no longer expanded. Build or select an image and pass its explicit reference. @@ -223,7 +223,7 @@ docker create --name export-me my-image:latest docker export -o rootfs.tar export-me docker rm export-me -openshell sandbox create --from ./rootfs.tar +os sandbox create --from ./rootfs.tar ``` Rootfs tar sources require a local gateway running the VM compute driver. The @@ -256,13 +256,13 @@ provided. Create a sandbox with the default image: ```shell -openshell sandbox create +os sandbox create ``` Override it with any image visible to the active compute driver: ```shell -openshell sandbox create --from registry.example.com/agents/my-agent:1.0 +os sandbox create --from registry.example.com/agents/my-agent:1.0 ``` Refer to [Default Policy](/how-it-works/policies/default-policy), [Run Your First Agent](/about/run-your-first-agent), and the [bring-your-own-container example](https://github.com/ai-openshell/openshell/tree/main/examples/bring-your-own-container). @@ -272,7 +272,7 @@ Refer to [Default Policy](/how-it-works/policies/default-policy), [Run Your Firs Attach to the canonical main process in a running sandbox: ```shell -openshell sandbox connect my-sandbox +os sandbox connect my-sandbox ``` Press `Ctrl-D` or `Ctrl-P`, then `Ctrl-Q` in sequence to disconnect. The main @@ -302,8 +302,8 @@ is between retry attempts to cancel recovery. Launch VS Code or Cursor directly into the sandbox workspace: ```shell -openshell sandbox create --editor vscode --name my-sandbox -openshell sandbox connect my-sandbox --editor cursor +os sandbox create --editor vscode --name my-sandbox +os sandbox connect my-sandbox --editor cursor ``` When `--editor` is used, OpenShell keeps the sandbox alive and installs an @@ -323,13 +323,13 @@ The supervisor limits pending stdin to 4 MiB per exec channel. If input arrives Run a one-shot command inside a running sandbox without opening an interactive shell: ```shell -openshell sandbox exec -n my-sandbox -- ls -la /workspace +os sandbox exec -n my-sandbox -- ls -la /workspace ``` Pipe stdin into the command: ```shell -echo "hello" | openshell sandbox exec -n my-sandbox -- cat +echo "hello" | os sandbox exec -n my-sandbox -- cat ``` The CLI sends small piped input in one request for compatibility with older @@ -357,7 +357,7 @@ A failed final gRPC status also makes the CLI report failure, even if the remote Run an interactive shell with a TTY: ```shell -openshell sandbox exec -n my-sandbox --tty -- /bin/bash +os sandbox exec -n my-sandbox --tty -- /bin/bash ``` Run `exit` or press `Ctrl-D` to close this separate shell. @@ -381,7 +381,7 @@ By default `sandbox exec` runs the command through a login shell (`bash -lc`), s For automation and managed checks that need predictable output and side effects, pass `--no-login-shell` so those startup files are not sourced before the command runs: ```shell -openshell sandbox exec -n my-sandbox --no-login-shell -- /usr/local/bin/managed-probe +os sandbox exec -n my-sandbox --no-login-shell -- /usr/local/bin/managed-probe ``` In this mode a sandbox user's login startup files cannot write to the command's output, create files, or otherwise affect the requested command before it starts. The command still runs under `bash -c`, which reads `BASH_ENV` if it is set in the command's environment. The default (login-shell) behavior is unchanged when the flag is omitted. @@ -391,7 +391,7 @@ In this mode a sandbox user's login startup files cannot write to the command's Inject environment variables into the sandbox at creation time: ```shell -openshell sandbox create --env API_KEY=sk-test --env DEBUG=1 -- my-agent +os sandbox create --env API_KEY=sk-test --env DEBUG=1 -- my-agent ``` Variables set with `--env` are available to all processes in the sandbox, including the initial command, interactive shells, and exec commands. @@ -400,8 +400,8 @@ Use `--env-from KEY[=ENVVAR]` when the value should come from the CLI process en ```shell export SESSION_TOKEN="..." -openshell sandbox create --env-from SESSION_TOKEN -- my-agent -openshell sandbox create --env-from AGENT_TOKEN=SESSION_TOKEN -- my-agent +os sandbox create --env-from SESSION_TOKEN -- my-agent +os sandbox create --env-from AGENT_TOKEN=SESSION_TOKEN -- my-agent ``` `--env-from` changes only how the CLI receives the value. The resulting variable is still available to processes in the sandbox, just like `--env`. @@ -413,7 +413,7 @@ Choose the suggested profile that matches how you authenticate. For example, whe You can also set per-command environment variables with `sandbox exec`: ```shell -openshell sandbox exec -n my-sandbox --env MY_VAR=hello -- printenv MY_VAR +os sandbox exec -n my-sandbox --env MY_VAR=hello -- printenv MY_VAR ``` Per-command variables override the sandbox-level environment for that command only. @@ -429,20 +429,20 @@ and cannot contain a newline, and all names and values together are limited to Attach labels when you create a sandbox to track ownership, environment, or workflow grouping: ```shell -openshell sandbox create --from registry.example.com/your-org/claude-agent:latest --label env=dev --label team=platform -- claude +os sandbox create --from registry.example.com/your-org/claude-agent:latest --label env=dev --label team=platform -- claude ``` List only the sandboxes that match a label selector: ```shell -openshell sandbox list --selector env=dev -openshell sandbox list --selector env=dev,team=platform +os sandbox list --selector env=dev +os sandbox list --selector env=dev,team=platform ``` Use `--annotation KEY=VALUE` for non-secret metadata that does not fit label limits, such as a file path. Annotation values can contain `/`, spaces, and `=`, and appear in the `annotations` field of `sandbox get -o json` and `sandbox list -o json`. ```shell -openshell sandbox create --annotation "policy-source-file=/home/you/policies/research policy.yaml" -- claude +os sandbox create --annotation "policy-source-file=/home/you/policies/research policy.yaml" -- claude ``` The Python SDK accepts the same gateway labels and selectors. Labels passed to @@ -504,7 +504,7 @@ process starts the server. This example uses a Python image because the not include Python: ```shell -openshell sandbox create \ +os sandbox create \ --name my-sandbox \ --from docker.io/library/python:3.14-slim \ --expose 8080 \ @@ -515,7 +515,7 @@ openshell sandbox create \ The CLI includes the unnamed endpoint in the sandbox create request and prints its URL after the sandbox reaches `Ready`. `--expose` keeps the sandbox after the create command returns and cannot be combined with `--no-keep`. Use -`openshell service expose` to add or update an endpoint later. +`os service expose` to add or update an endpoint later. SDK create methods accept named or unnamed service exposures. An empty service name selects the unnamed endpoint. The returned sandbox includes a service URL @@ -575,13 +575,13 @@ println!("{}", sandbox.service_urls[""]); Expose a service that listens on loopback inside the sandbox: ```shell -openshell service expose my-sandbox 8080 +os service expose my-sandbox 8080 ``` Pass an optional service name to create a named service URL: ```shell -openshell service expose my-sandbox 8080 web +os service expose my-sandbox 8080 web ``` For a native gRPC server or another service that needs HTTP/2 on loopback, @@ -589,7 +589,7 @@ enable the supervisor application listener and expose the service with `--backend-http-version 2`. [Supervisor application listener setup](/how-it-works/gateways/configuration#supervisor-application-listener) ```shell -openshell service expose demo 50051 agent --backend-http-version 2 +os service expose demo 50051 agent --backend-http-version 2 ``` Use the printed HTTPS URL with an HTTP/2 client. The sandbox server must accept @@ -600,14 +600,14 @@ into forwarding one valid bearer credential unchanged when the application performs its own authentication: ```shell -openshell service expose my-sandbox 4500 \ +os service expose my-sandbox 4500 \ --authorization-mode bearer-passthrough ``` For a create-time exposure, use both flags: ```shell -openshell sandbox create \ +os sandbox create \ --expose 4500 \ --expose-authorization-mode bearer-passthrough \ --detach \ @@ -633,7 +633,7 @@ and receive only its SHA-256 verifier: APP_SERVER_TOKEN="$(openssl rand -hex 32)" APP_SERVER_TOKEN_SHA256="$(printf %s "$APP_SERVER_TOKEN" | openssl dgst -sha256 -hex | awk '{print $2}')" -openshell sandbox create \ +os sandbox create \ --name codex-server \ --env "APP_SERVER_TOKEN_SHA256=$APP_SERVER_TOKEN_SHA256" \ --expose 4500 \ @@ -653,20 +653,20 @@ production workloads. It authenticates the handshake before the app-server List exposed endpoints: ```shell -openshell service list +os service list ``` List endpoints for one sandbox: ```shell -openshell service list my-sandbox +os service list my-sandbox ``` Use structured output for automation: ```shell -openshell service list --output json -openshell service list my-sandbox --output yaml +os service list --output json +os service list my-sandbox --output yaml ``` Structured list output contains `services` and `next_page_token` fields. Each @@ -678,15 +678,15 @@ The unnamed service uses an empty `service` string. Pass the returned token to Show or delete one endpoint: ```shell -openshell service get my-sandbox web -openshell service delete my-sandbox web +os service get my-sandbox web +os service delete my-sandbox web ``` Omit the service name to manage the unnamed endpoint: ```shell -openshell service get my-sandbox -openshell service delete my-sandbox +os service get my-sandbox +os service delete my-sandbox ``` @@ -711,20 +711,20 @@ readable composite. List all sandboxes: ```shell -openshell sandbox list +os sandbox list ``` Filter the list by labels when you want a narrower view: ```shell -openshell sandbox list --selector team=platform +os sandbox list --selector team=platform ``` Use `-o json` or `-o yaml` for machine-readable output: ```shell -openshell sandbox list -o json -openshell sandbox list -o yaml +os sandbox list -o json +os sandbox list -o yaml ``` Structured list output contains `sandboxes` and `next_page_token` fields. @@ -733,31 +733,31 @@ Pass the returned token to `--page-token` to continue. Get detailed information about a specific sandbox. The output lists **Policy source** (`sandbox` or `global`), **Revision** (the active policy’s row version for that source), and the formatted active policy YAML: ```shell -openshell sandbox get my-sandbox +os sandbox get my-sandbox ``` For automation, use `--output json` or `--output yaml` to get machine-readable sandbox details: ```shell -openshell sandbox get my-sandbox --output json +os sandbox get my-sandbox --output json ``` Print only the policy YAML for scripting (same effective policy, no metadata): ```shell -openshell sandbox get my-sandbox --policy-only +os sandbox get my-sandbox --policy-only ``` ### Diagnose Failed Calls to Tool Servers -A sandbox can be `Ready` while an agent's call to an external tool server fails with `fetch failed`. Run `openshell sandbox get my-sandbox` and look under `Tool server connections` for the server's address, `Last result`, and `Reported at`. This is available for configured MCP-over-HTTP endpoints and does not change sandbox readiness. +A sandbox can be `Ready` while an agent's call to an external tool server fails with `fetch failed`. Run `os sandbox get my-sandbox` and look under `Tool server connections` for the server's address, `Last result`, and `Reported at`. This is available for configured MCP-over-HTTP endpoints and does not change sandbox readiness. JSON and YAML output include an `endpoint_statuses` list with `last_reported_at`. The protobuf API exposes the same timestamp as `Sandbox.status.endpoint_statuses[].last_reported_time`, which SDKs render in their own time type. Select an endpoint by its address; `endpoint_id` is opaque. For example, use `jq` to select the tool server at `tools.example.com`, path `/mcp`, and port `443`: ```shell -openshell sandbox get my-sandbox --output json | jq -e \ +os sandbox get my-sandbox --output json | jq -e \ --arg host tools.example.com --arg path /mcp --argjson ports '[443]' ' .endpoint_statuses[] | select(.host == $host and .path == $path and .ports == $ports) @@ -788,7 +788,7 @@ Addresses use lowercase hosts, canonical paths, and sorted distinct effective po When OpenShell cannot obtain a required token, the workload receives HTTP 502 with an `x-openshell-request-id` header. The response hides the cause. If you can read the sandbox, inspect its latest failure: ```shell -openshell sandbox get my-sandbox --output json | jq '.last_token_grant_failure' +os sandbox get my-sandbox --output json | jq '.last_token_grant_failure' ``` Match `failure.request_id` to the response header; a newer failure may have replaced the record. It identifies the destination host and port, failure code, stage, and recovery action. Provider and credential names appear when known; credential values never appear. @@ -811,12 +811,12 @@ See [Token Grant Failures](/how-it-works/providers/profiles#token-grant-failures Stream sandbox logs to monitor agent activity and diagnose policy decisions: ```shell -openshell logs my-sandbox +os logs my-sandbox ``` | Flag | Purpose | Example | | ---------- | ---------------------------- | ---------------------------------- | -| `--tail` | Stream logs in real time | `openshell logs my-sandbox --tail` | +| `--tail` | Stream logs in real time | `os logs my-sandbox --tail` | | `--source` | Filter by log source | `--source sandbox` | | `--level` | Filter by severity | `--level warn` | | `--since` | Show logs from a time window | `--since 5m` | @@ -824,14 +824,14 @@ openshell logs my-sandbox OpenShell Terminal combines sandbox status and live logs in a single real-time dashboard: ```shell -openshell term +os term ``` Use the terminal to spot blocked connections marked `action=deny` and provider-related proxy activity. If a connection is blocked unexpectedly, add the host to your network policy or update the attached provider profile. Refer to [Manage Sandbox Policies](/how-it-works/policies/manage-policies) for the workflow. The dashboard has three panels stacked vertically: Gateways, Providers (or Global Settings), and Sandboxes. Navigate within a panel with `Up`/`Down` or `j`/`k`. At a list boundary the cursor overflows into the adjacent panel, skipping empty panels. Use `Tab`/`Shift+Tab` to cycle panels directly. Press `h`/`l` or `Left`/`Right` in the middle panel to switch between the Providers and Global Settings tabs. -The sandbox table’s NOTES column shows `Invalid config` when policy or provider configuration blocks provisioning. Open the sandbox detail view for the full rejection reason, or run `openshell sandbox get -o json`. The note clears after the configuration is repaired; active port forwards remain listed. +The sandbox table’s NOTES column shows `Invalid config` when policy or provider configuration blocks provisioning. Open the sandbox detail view for the full rejection reason, or run `os sandbox get -o json`. The note clears after the configuration is repaired; active port forwards remain listed. Press `c` in the Sandboxes panel to create a sandbox. In the optional Command field, use quotes or backslashes to group arguments containing spaces. For example, `/bin/sh -c "echo GOOD; read x"` prints `GOOD` and waits for Enter. Invalid quoting keeps the form open without creating a sandbox. The field does not expand variables or evaluate shell operators; invoke a shell explicitly with `sh -c` when you need that behavior. @@ -840,16 +840,16 @@ Press `c` in the Sandboxes panel to create a sandbox. In the optional Command fi Forward a local port to a running sandbox to access services inside it, such as a web server or database: ```shell -openshell forward start 8000 my-sandbox -openshell forward start 8000 my-sandbox -d # run in background +os forward start 8000 my-sandbox +os forward start 8000 my-sandbox -d # run in background ``` -OpenShell prints the local URL only after the forward listener is reachable. Background forwards must be tracked locally so `openshell forward list` and `openshell forward stop` can manage them. +OpenShell prints the local URL only after the forward listener is reachable. Background forwards must be tracked locally so `os forward list` and `os forward stop` can manage them. To bind the local side to an IPv6 loopback address, pass it positionally as `[bind_address:]port`. IPv6 addresses are bracketed in both the SSH forward argument and the printed access URL: ```shell -openshell forward start ::1:8000 my-sandbox +os forward start ::1:8000 my-sandbox # Local URL: http://[::1]:8000/ ``` @@ -859,15 +859,15 @@ Foreground forwards end when the command exits; only background forwards appear List and stop active forwards: ```shell -openshell forward list -openshell forward stop 8000 my-sandbox +os forward list +os forward stop 8000 my-sandbox ``` Use JSON or YAML output when inspecting tracked forwards from automation: ```shell -openshell forward list --output json -openshell forward list --output yaml +os forward list --output json +os forward list --output yaml ``` Structured output includes `workspace`, `sandbox`, `bind_address`, `port`, @@ -882,7 +882,7 @@ The default table colorizes the `STATUS` column only when both standard output a You can also forward a port at creation time with `--forward`: ```shell -openshell sandbox create --from registry.example.com/your-org/claude-agent:latest --forward 8000 -- claude +os sandbox create --from registry.example.com/your-org/claude-agent:latest --forward 8000 -- claude ``` @@ -922,7 +922,7 @@ Otherwise stop and start the sandbox so the gateway assigns it a key. Generate an SSH config entry for a sandbox so tools like VS Code Remote-SSH can connect directly: ```shell -openshell sandbox ssh-config my-sandbox +os sandbox ssh-config my-sandbox ``` Append the output to `~/.ssh/config` or use `--editor` on `sandbox create`/`sandbox connect` for automatic setup. @@ -942,9 +942,9 @@ To repair an entry that is still refused: the include file, then use `--editor` on `sandbox connect` for that sandbox. The new entry is named `openshell-.`. - For an entry you pasted into `~/.ssh/config`, replace it with new - `openshell sandbox ssh-config` output. + `os sandbox ssh-config` output. -A replaced entry runs the `openshell` executable that replaced it. If you had +A replaced entry runs the `os` executable that replaced it. If you had changed that path, change it again. After a downgrade, replaced entries stop connecting, because earlier releases do not accept `--known-hosts`. Use `--editor` on `sandbox connect` with the downgraded CLI for each sandbox. @@ -953,14 +953,14 @@ To connect without verification, to a sandbox with no published fingerprint or through such an entry, set `OPENSHELL_SSH_REQUIRE_HOST_KEY` to `0`, `false`, `no`, `n`, or `off`. The connection then goes ahead and prints a warning. Set it in the environment of the program that runs `ssh`: the shell that runs -`openshell`, or the editor. +`os`, or the editor. ## Transfer Files Upload files from your host into the sandbox: ```shell -openshell sandbox upload my-sandbox ./src +os sandbox upload my-sandbox ./src ``` Uploads stream with bounded buffering and wait for the sandbox to consume @@ -986,7 +986,7 @@ its original name, with or without a trailing `/` on the destination. When the destination is a symlink to a directory, the upload writes the file inside the target directory and preserves the symlink. A missing nested destination without a trailing `/` gives the uploaded file its name. For example, -`openshell sandbox upload my-sandbox ./config.json /sandbox/settings.json` +`os sandbox upload my-sandbox ./config.json /sandbox/settings.json` writes `settings.json`. Uploading to an existing `/sandbox/settings` directory writes `settings/config.json`. These rules apply with Git filtering enabled as well. Successful single-file uploads print the resulting path. @@ -994,7 +994,7 @@ as well. Successful single-file uploads print the resulting path. Download files from the sandbox to your host: ```shell -openshell sandbox download my-sandbox output ./local +os sandbox download my-sandbox output ./local ``` When the sandbox-side source is a single file, the destination follows `cp`-style placement: if the destination already exists as a directory or ends with `/`, the file lands inside it as `/`; otherwise the file is written at the exact destination path. @@ -1008,12 +1008,12 @@ directory are also accepted. You can also upload files at creation time with the `--upload` flag on -`openshell sandbox create`. Pass `--upload` multiple times to upload +`os sandbox create`. Pass `--upload` multiple times to upload several paths in a single command. You cannot add a trailing command, so run the workload from the shell that opens or with `sandbox exec`: ```shell -openshell sandbox create --from registry.example.com/your-org/claude-agent:latest --upload ./src:/workspace/src --upload ./config:/workspace/config +os sandbox create --from registry.example.com/your-org/claude-agent:latest --upload ./src:/workspace/src --upload ./config:/workspace/config ``` @@ -1032,8 +1032,8 @@ without filtering. These rules apply to both `sandbox upload` and sandbox. If any upload is rejected, including a missing path or a Git filtering failure, the command exits with an error and creates no sandbox. If a transfer fails after provisioning, the sandbox remains running and earlier uploads may -have completed. Use `openshell sandbox upload` to retry against the existing -sandbox, or `openshell sandbox delete` to remove it. Add `--no-git-ignore` to the +have completed. Use `os sandbox upload` to retry against the existing +sandbox, or `os sandbox delete` to remove it. Add `--no-git-ignore` to the retry only if you intend to upload without filtering. Uploads preserve symlinks, including dangling links, instead of dereferencing @@ -1046,8 +1046,8 @@ Stop compute when you want to retain a sandbox and its persistent workspace without keeping its container, pod, or VM running: ```shell -openshell sandbox stop my-sandbox -openshell sandbox start my-sandbox +os sandbox stop my-sandbox +os sandbox start my-sandbox ``` The name is optional and defaults to the last-used sandbox. Stop stops local @@ -1124,13 +1124,13 @@ Upgrade every gateway before enabling updates. Follow this sequence through the CLI and a generated/raw RPC client. -1. Run `openshell sandbox stop my-sandbox` and wait for `Stopped`. +1. Run `os sandbox stop my-sandbox` and wait for `Stopped`. 2. Call `GetSandbox` with the named `workspace_scope` and sandbox `name`. Read `sandbox.metadata.resource_version` after stop completes. 3. Call `UpdateSandbox` with the same scope and name, the selected update fields, and `expected_resource_version` set to that current, nonzero version. The response is a `SandboxResponse`; the sandbox remains stopped. -4. After the update succeeds, run `openshell sandbox start my-sandbox` to launch +4. After the update succeeds, run `os sandbox start my-sandbox` to launch the new image. With an authenticated Rust SDK `OpenShellClient`, use the separate raw client @@ -1208,13 +1208,13 @@ missing workspaces and authorization failures remain errors. SDK callers can inspect [typed deletion outcomes](/sdk/api-errors#deletion-outcomes). ```shell -openshell sandbox delete my-sandbox +os sandbox delete my-sandbox ``` Delete multiple sandboxes by listing their names in one command: ```shell -openshell sandbox delete sandbox-a sandbox-b +os sandbox delete sandbox-a sandbox-b ``` When a multi-sandbox delete fails for one entry, the CLI reports that sandbox's @@ -1227,7 +1227,7 @@ Every sandbox moves through a defined set of phases: Before workload activation, OpenShell validates the effective policy and matching provider configuration. A rejection keeps the workload unstarted and exposes a -`ConfigurationInvalid` condition in `Provisioning`. Use `openshell sandbox get` +`ConfigurationInvalid` condition in `Provisioning`. Use `os sandbox get` to inspect the diagnostic, then [repair the policy or provider configuration](/how-it-works/policies/manage-policies#a-new-sandbox-stays-in-provisioning). Management operations remain available while startup is blocked. After repair, the supervisor completes startup without recreating the sandbox. Starting a @@ -1248,8 +1248,8 @@ An actual driver response clears the pending flag, including ordinary rejection For `ImagePreparationTimedOut`, inspect image preparation and supervisor startup diagnostics and check whether the configured preparation budget is sufficient. For `ProvisioningTimedOut`, repair the rejected configuration. In either case, wait for cleanup to complete, then explicitly restart: ```shell -openshell sandbox get my-sandbox --output json -openshell sandbox start my-sandbox +os sandbox get my-sandbox --output json +os sandbox start my-sandbox ``` Editing configuration after expiry does not restart compute. An explicit retry gets a new preparation deadline and a separate admission repair window, while static-policy restrictions from any previous activation remain in force. Attempts already active when the gateway is upgraded retain their stored deadline. Timed-out records are retained even for ephemeral creates; use `sandbox delete` when you no longer need the diagnostic or stored state. @@ -1278,7 +1278,7 @@ with reason `MainProcessCompleted`. Nonzero and signal-normalized results use signal exits use the standard `128 + signal` convention. When restart policy selects replacement, `status.restart_count` and `status.next_restart_time` show the attempt number and next deadline. Inspect them with -`openshell sandbox get `. `sandbox stop` cancels a pending replacement; +`os sandbox get `. `sandbox stop` cancels a pending replacement; an explicit later start resets the restart count. Compute runtimes do not apply their own restart policy. diff --git a/docs/how-it-works/sandboxes/runtimes.mdx b/docs/how-it-works/sandboxes/runtimes.mdx index 199894599b..64d6c7140e 100644 --- a/docs/how-it-works/sandboxes/runtimes.mdx +++ b/docs/how-it-works/sandboxes/runtimes.mdx @@ -91,7 +91,7 @@ The gateway does not start or supervise extension drivers. Restrict the socket s ## Size Sandboxes -Use `--cpu`, `--memory`, and `--gpu` on `openshell sandbox create` to request resources. `--gpu` alone requests one GPU; `--gpu COUNT` requests more. +Use `--cpu`, `--memory`, and `--gpu` on `os sandbox create` to request resources. `--gpu` alone requests one GPU; `--gpu COUNT` requests more. | Driver | CPU and memory | GPU | |---|---|---| @@ -104,7 +104,7 @@ Use `--cpu`, `--memory`, and `--gpu` on `openshell sandbox create` to request re `--driver-config-json` passes driver-specific settings that have no dedicated flag. The value is a JSON object keyed by driver name, and the gateway forwards only the block for the active driver: ```shell -openshell sandbox create \ +os sandbox create \ --from registry.example.com/team/claude-code:1.0 \ --driver-config-json '{"kubernetes":{"pod":{"runtime_class_name":"kata-containers"}}}' \ -- claude @@ -176,7 +176,7 @@ Mount existing named volumes or `tmpfs` through driver config. Label volumes so docker volume create --label openshell.ai/sandbox-attachable=true \ --label openshell.ai/sandbox-attachable-workspace=default openshell-work -openshell sandbox create \ +os sandbox create \ --from registry.example.com/team/claude-code:1.0 \ --driver-config-json '{"docker":{"mounts":[{"type":"volume","source":"openshell-work","target":"/sandbox/work","read_only":false}]}}' \ -- claude @@ -261,7 +261,7 @@ If the gateway is briefly unavailable while a VM starts, its supervisor retries ### MicroVM Stop Durability -When you run `openshell sandbox stop` while the main process is running, OpenShell terminates the workload and flushes the guest root filesystem before acknowledging termination. The guest waits up to three seconds for the flush. The host allows up to 22 seconds for supervisor shutdown, then up to five seconds to stop the VM. +When you run `os sandbox stop` while the main process is running, OpenShell terminates the workload and flushes the guest root filesystem before acknowledging termination. The guest waits up to three seconds for the flush. The host allows up to 22 seconds for supervisor shutdown, then up to five seconds to stop the VM. Flush errors and timeouts produce warnings while shutdown continues. If a signal kills the supervisor, the driver warns that the guest flush was not confirmed and recent writes may be lost. A completed stop does not guarantee persistence after a failed or timed-out flush. This flush does not cover stops after the main process has already exited. @@ -270,7 +270,7 @@ Flush errors and timeouts produce warnings while shutdown continues. If a signal The VM driver shares gateway-host directories into the guest with virtiofs. Each entry in `mounts` takes `source` (absolute host directory), `target`, optional `read_only` (default `true`), and optional `type`, which must be `bind` so Docker and Podman bind entries work unchanged: ```shell -openshell sandbox create \ +os sandbox create \ --driver-config-json '{"vm":{"mounts":[{"type":"bind","source":"/srv/datasets","target":"/sandbox/datasets"}]}}' \ -- claude ``` @@ -347,7 +347,7 @@ Workspace storage settings cannot change after a sandbox is created. Delete and Mount existing PersistentVolumeClaims into the agent container through driver config. Any mount under `/sandbox` replaces the default workspace PVC for that sandbox. ```shell -openshell sandbox create \ +os sandbox create \ --from registry.example.com/team/claude-code:1.0 \ --driver-config-json '{ "kubernetes": { @@ -387,7 +387,7 @@ On Docker and Podman, set `process.run_as_user` and `process.run_as_group` in th | Kubernetes | OpenShift SCC namespace annotations, otherwise `1000`. Override with `sandbox_uid` and `sandbox_gid`. | | MicroVM | The image's `sandbox` account, otherwise `1000`. Override with `sandbox_uid` and `sandbox_gid`. | -MicroVM persists the resolved UID:GID with the writable overlay and retains it across restarts, even if driver defaults change. Explicit policy selectors must match that identity. For example, `run_as_user: "10000"` fails when the overlay owner is `1000:1000`; OpenShell reports both values without changing file ownership. The symbolic selector `sandbox` refers to the guest account for that owner, and each omitted selector accepts its driver default. The `WorkloadIdentity` condition in `openshell sandbox get ` shows the resolved pair separately from workload readiness. Canonical and exec processes use this same pair; live policy updates cannot change it. +MicroVM persists the resolved UID:GID with the writable overlay and retains it across restarts, even if driver defaults change. Explicit policy selectors must match that identity. For example, `run_as_user: "10000"` fails when the overlay owner is `1000:1000`; OpenShell reports both values without changing file ownership. The symbolic selector `sandbox` refers to the guest account for that owner, and each omitted selector accepts its driver default. The `WorkloadIdentity` condition in `os sandbox get ` shows the resolved pair separately from workload readiness. Canonical and exec processes use this same pair; live policy updates cannot change it. On Docker and Podman, the image's `WORKDIR` becomes the workspace. Images with no `WORKDIR`, `/`, or `/sandbox` use `/sandbox`. Any other `WORKDIR` must exist in the image and be writable by the sandbox user. Kubernetes and MicroVM always use `/sandbox`. diff --git a/docs/how-it-works/sandboxes/templates.mdx b/docs/how-it-works/sandboxes/templates.mdx index e8f895e504..3cd1fa66ad 100644 --- a/docs/how-it-works/sandboxes/templates.mdx +++ b/docs/how-it-works/sandboxes/templates.mdx @@ -13,7 +13,7 @@ Sandbox workload templates let workspace admins define reusable runtime shapes f ## Create a Template ```shell -openshell sandbox template create gpu-kata \ +os sandbox template create gpu-kata \ --image registry.example.com/agent:latest \ --cpu 2 \ --memory 4Gi \ @@ -30,7 +30,7 @@ For a separate template with driver-specific settings, create it with `--driver-config-json`: ```shell -openshell sandbox template create gpu-kata-custom \ +os sandbox template create gpu-kata-custom \ --image registry.example.com/agent:latest \ --driver-config-json '{"kubernetes":{"pod":{"runtime_class_name":"kata-containers","node_selector":{"pool":"gpu"}}}}' ``` @@ -40,7 +40,7 @@ If you omit `--image`, the gateway applies its default sandbox image when a sand ## Create a Sandbox from a Template ```shell -openshell sandbox create --template gpu-kata --provider github -- claude +os sandbox create --template gpu-kata --provider github -- claude ``` The `--template` flag cannot be combined with inline workload flags such as `--from`, `--cpu`, `--memory`, `--gpu`, `--env`, or `--driver-config-json`. Put those values on the template instead. Create-time policy and provider attachments remain part of the sandbox request, so each sandbox can keep its own access boundary. @@ -48,16 +48,16 @@ The `--template` flag cannot be combined with inline workload flags such as `--f ## Manage Templates ```shell -openshell sandbox template list -openshell sandbox template list --label-selector team=runtime -openshell sandbox template get gpu-kata -openshell sandbox template delete gpu-kata +os sandbox template list +os sandbox template list --label-selector team=runtime +os sandbox template get gpu-kata +os sandbox template delete gpu-kata ``` Use `--all-workspaces` with `sandbox template list` when you need an admin view across workspaces: ```shell -openshell sandbox template list --all-workspaces +os sandbox template list --all-workspaces ``` For JSON or YAML, template list output contains `templates` and diff --git a/docs/how-it-works/workspaces.mdx b/docs/how-it-works/workspaces.mdx index a9753d3396..d4b9650e0d 100644 --- a/docs/how-it-works/workspaces.mdx +++ b/docs/how-it-works/workspaces.mdx @@ -73,8 +73,8 @@ Use the identity validated by the gateway when an administrator needs your membership subject. ```shell -openshell whoami -openshell whoami --output json +os whoami +os whoami --output json ``` The `subject` field is the stable identity used in workspace membership @@ -90,14 +90,14 @@ OIDC users to that workspace automatically. Create a workspace: ```shell -openshell workspace create --name team-ml +os workspace create --name team-ml ``` -Ask the intended Workspace Admin to run `openshell whoami`, then add the +Ask the intended Workspace Admin to run `os whoami`, then add the reported subject: ```shell -openshell workspace member add \ +os workspace member add \ --workspace team-ml \ --subject 'oidc-subject-for-admin' \ --role admin @@ -106,7 +106,7 @@ openshell workspace member add \ The Workspace Admin can add Workspace Users: ```shell -openshell workspace member add \ +os workspace member add \ --workspace team-ml \ --subject 'oidc-subject-for-user' \ --role user @@ -121,9 +121,9 @@ All members can inspect membership in their workspace. Workspace Admins and Platform Admins can remove members. ```shell -openshell workspace member list --workspace team-ml +os workspace member list --workspace team-ml -openshell workspace member remove \ +os workspace member remove \ --workspace team-ml \ --subject 'oidc-subject-for-user' ``` @@ -143,14 +143,14 @@ Attach labels when you create a workspace to track environment or team ownership Repeat `--label` for each key-value pair. ```shell -openshell workspace create --name team-research --label env=dev --label team=ml +os workspace create --name team-research --label env=dev --label team=ml ``` List workspaces that match every key-value pair in a comma-separated selector. Filtering only returns workspaces you are authorized to view. ```shell -openshell workspace list --label-selector env=dev,team=ml +os workspace list --label-selector env=dev,team=ml ``` Inspect a workspace to see its labels. Pass `--output json` or `--output yaml` @@ -158,9 +158,9 @@ to `workspace create`, `workspace get`, or `workspace list` for structured output in automation. ```shell -openshell workspace get team-research -openshell workspace get team-research --output json -openshell workspace list --label-selector env=dev --output json +os workspace get team-research +os workspace get team-research --output json +os workspace list --label-selector env=dev --output json ``` API clients set `CreateWorkspaceRequest.labels` and filter with @@ -174,9 +174,9 @@ Pass `--workspace` to scope a resource operation. The flag is global, so it can appear before or after the subcommand. ```shell -openshell sandbox list --workspace team-ml -openshell provider list --workspace team-ml -openshell sandbox create \ +os sandbox list --workspace team-ml +os provider list --workspace team-ml +os sandbox create \ --workspace team-ml \ --name research \ --from registry.example.com/team/agent-tools:1.0 \ @@ -187,7 +187,7 @@ Set a default for the current shell with `OPENSHELL_WORKSPACE`: ```shell export OPENSHELL_WORKSPACE=team-ml -openshell sandbox list +os sandbox list ``` When `--workspace` is omitted, the CLI intentionally selects the `default` @@ -197,9 +197,9 @@ or all workspaces. Platform Admins can opt into cross-workspace list operations: ```shell -openshell sandbox list --all-workspaces -openshell provider list --all-workspaces -openshell service list --all-workspaces +os sandbox list --all-workspaces +os provider list --all-workspaces +os service list --all-workspaces ``` Workspace-scoped public requests use the `workspace_scope` field with a @@ -239,8 +239,8 @@ configuration. ## Diagnose Access Denials -If `openshell workspace list` returns no rows, the authenticated subject has no -workspace memberships. Run `openshell whoami` and send the `subject` value to +If `os workspace list` returns no rows, the authenticated subject has no +workspace memberships. Run `os whoami` and send the `subject` value to a Platform Admin. Workspace authorization errors include a copyable membership command. A @@ -249,7 +249,7 @@ Admin access, the denial suggests `--role admin`; only a Platform Admin can run that assignment successfully. If the membership is correct but the request is still denied, inspect `roles` -and `scopes` with `openshell whoami --output json`. Confirm that the token has +and `scopes` with `os whoami --output json`. Confirm that the token has the configured OIDC user role and, when scope enforcement is enabled, the scope required by the operation. @@ -259,7 +259,7 @@ Only a Platform Admin can delete a workspace. The `default` workspace cannot be deleted. ```shell -openshell workspace delete team-ml +os workspace delete team-ml ``` A custom workspace must not contain sandboxes, sandbox workload templates, diff --git a/docs/index.mdx b/docs/index.mdx index 1ca5885559..611177185e 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -55,7 +55,7 @@ Install OpenShell and create your first sandbox in two commands. ```shell curl -LsSf https://raw.githubusercontent.com/ai-openshell/openshell/main/install.sh | sh -openshell sandbox create +os sandbox create ``` diff --git a/docs/kubernetes/access-control.mdx b/docs/kubernetes/access-control.mdx index b938c7f5aa..c6a9ccef44 100644 --- a/docs/kubernetes/access-control.mdx +++ b/docs/kubernetes/access-control.mdx @@ -145,5 +145,5 @@ Only enable unauthenticated users when the gateway is not reachable from outside Register the gateway with the CLI using the proxy's public URL. The browser-based login flow runs automatically on first use: ```shell -openshell gateway add https://gateway.example.com --name production +os gateway add https://gateway.example.com --name production ``` diff --git a/docs/kubernetes/high-availability.mdx b/docs/kubernetes/high-availability.mdx index f2edc2952f..0b3c873cf5 100644 --- a/docs/kubernetes/high-availability.mdx +++ b/docs/kubernetes/high-availability.mdx @@ -129,8 +129,8 @@ If you changed the chart's generated names with `nameOverride` or After registering the gateway with the CLI, verify that requests succeed: ```shell -openshell status -openshell sandbox list +os status +os sandbox list ``` ## Protect Voluntary Disruptions @@ -692,7 +692,7 @@ Three values set how many sandboxes the cluster can run: The pool runs at most `replicaCount` × `maxMembersPerGateway` × `maxInstancesPerMember` sandboxes, and never more than 131,072. The gateway places each new sandbox on the supervisor running the fewest. When either -limit is reached, `openshell sandbox create` fails at once with +limit is reached, `os sandbox create` fails at once with `sandbox capacity reached`. Rendering fails when `supervisor.replicas` or `supervisor.autoscaling.maxReplicas` exceeds diff --git a/docs/kubernetes/ingress.mdx b/docs/kubernetes/ingress.mdx index 03b865b28e..3a757a642c 100644 --- a/docs/kubernetes/ingress.mdx +++ b/docs/kubernetes/ingress.mdx @@ -112,8 +112,8 @@ For another Gateway API implementation or an existing Gateway, follow that imple After the `EXTERNAL-IP` is assigned, register the gateway with the CLI: ```shell -openshell gateway add http:// --name production -openshell status +os gateway add http:// --name production +os status ``` This setup is plaintext end-to-end and is intended for development. For external access, terminate TLS at the gateway as shown below. @@ -130,7 +130,7 @@ Envoy Gateway only terminates TLS here — it does not perform OIDC. Do not enab Because Envoy terminates TLS, the OpenShell gateway never sees a client certificate, so client mTLS cannot provide identity on this path. Use OIDC bearer tokens for client identity instead. -For an interactive login on a headless machine, set `OPENSHELL_NO_BROWSER=1` before running `openshell gateway add`. The CLI uses the Device Authorization Grant with S256 PKCE and prompts the user to approve the login from another browser. For unattended agents and CI, set `OPENSHELL_OIDC_CLIENT_SECRET` to use the OAuth2 client-credentials grant instead. The client id comes from `--oidc-client-id` (default `openshell-cli`); pass it explicitly if your identity provider uses a different id. Interactive users with a local browser get the Authorization Code flow with PKCE by default. +For an interactive login on a headless machine, set `OPENSHELL_NO_BROWSER=1` before running `os gateway add`. The CLI uses the Device Authorization Grant with S256 PKCE and prompts the user to approve the login from another browser. For unattended agents and CI, set `OPENSHELL_OIDC_CLIENT_SECRET` to use the OAuth2 client-credentials grant instead. The client id comes from `--oidc-client-id` (default `openshell-cli`); pass it explicitly if your identity provider uses a different id. Interactive users with a local browser get the Authorization Code flow with PKCE by default. ### Provide a TLS certificate @@ -169,11 +169,11 @@ Keep the certificate Secret in the release namespace. Referencing a Secret in an ### Register over HTTPS ```shell -openshell gateway add https://gateway.example.com \ +os gateway add https://gateway.example.com \ --name production \ --oidc-issuer https://keycloak.example.com/realms/openshell \ --oidc-client-id openshell-cli -openshell status +os status ``` See [Authentication](/kubernetes/setup) for OIDC issuer, audience, and roles configuration. @@ -271,7 +271,7 @@ When a Gateway terminates TLS, register its externally reachable `https://` endp The chart creates only a `Gateway` and a `GRPCRoute`. Browser and WebSocket traffic to exposed sandbox services — the URLs printed by -`openshell service expose` — has no chart-managed route. Operators configure +`os service expose` — has no chart-managed route. Operators configure it themselves. Service URLs use a hostname under the gateway's service base domain, which @@ -304,7 +304,7 @@ hostnames are deterministic and unique per gateway, so exact-host `HTTPRoute`/`Ingress` rules route them unambiguously with the single shared wildcard certificate. The hostnames exist only once services are exposed, so the rules must be created as services are exposed — for example by automation -that reads `openshell service list` or the gateway API and reconciles +that reads `os service list` or the gateway API and reconciles exact-host routes per gateway. The chart does not create or manage these routes. diff --git a/docs/kubernetes/openshift.mdx b/docs/kubernetes/openshift.mdx index 492e3d581c..9a1ec1de9d 100644 --- a/docs/kubernetes/openshift.mdx +++ b/docs/kubernetes/openshift.mdx @@ -83,8 +83,8 @@ Forward the gateway port for local evaluation: ```shell oc -n openshell port-forward svc/openshell 8080:8080 -openshell gateway add https://127.0.0.1:8080 --local --name openshift -openshell status +os gateway add https://127.0.0.1:8080 --local --name openshift +os status ``` ## Options for end-to-end TLS @@ -194,11 +194,11 @@ If cert-manager takes longer than 120 seconds to issue certificates, increase th #### Register over HTTPS ```shell -openshell gateway add https://gateway.example.com \ +os gateway add https://gateway.example.com \ --name openshift \ --oidc-issuer https://keycloak.example.com/realms/openshell \ --oidc-client-id openshell-cli -openshell status +os status ``` ### End-to-end TLS using pass-through Route (all OpenShift versions) @@ -239,11 +239,11 @@ Register the gateway with the CLI over OIDC. Remote gateways authenticate CLI users via OIDC, not mTLS — see [Access Control](/kubernetes/access-control): ```shell -openshell gateway add https://gateway.example.com \ +os gateway add https://gateway.example.com \ --name openshift \ --oidc-issuer https://keycloak.example.com/realms/openshell \ --oidc-client-id openshell-cli -openshell gateway login openshift +os gateway login openshift ``` ## Next Steps diff --git a/docs/kubernetes/setup.mdx b/docs/kubernetes/setup.mdx index 7739932729..48fd511c5f 100644 --- a/docs/kubernetes/setup.mdx +++ b/docs/kubernetes/setup.mdx @@ -236,10 +236,10 @@ The server certificate SANs include `localhost` and `127.0.0.1`, so hostname ver In another terminal, register the gateway with the user authentication mode you configured and verify it is reachable. For example, with OIDC: ```shell -openshell gateway add https://127.0.0.1:8080 --local --name k8s \ +os gateway add https://127.0.0.1:8080 --local --name k8s \ --oidc-issuer https://your-idp.example.com/realms/openshell \ --oidc-client-id openshell-cli -openshell status +os status ``` diff --git a/docs/kubernetes/workspaces.mdx b/docs/kubernetes/workspaces.mdx index 2ea0bc77ec..1ffdcc5fde 100644 --- a/docs/kubernetes/workspaces.mdx +++ b/docs/kubernetes/workspaces.mdx @@ -80,8 +80,8 @@ and sandbox `ServiceAccount` when an operation first needs them, such as provisioning a sandbox: ```shell -openshell workspace create --name team-ml -openshell sandbox create --workspace team-ml +os workspace create --name team-ml +os sandbox create --workspace team-ml ``` In an OIDC deployment, assign a Workspace Admin or Workspace User membership @@ -123,7 +123,7 @@ Delete the workspace through OpenShell after removing its sandboxes and other workspace resources: ```shell -openshell workspace delete team-ml +os workspace delete team-ml ``` The gateway asks the Kubernetes driver to delete the managed namespace during diff --git a/docs/observability/accessing-logs.mdx b/docs/observability/accessing-logs.mdx index b02eb01037..54d6263964 100644 --- a/docs/observability/accessing-logs.mdx +++ b/docs/observability/accessing-logs.mdx @@ -10,10 +10,10 @@ Use the CLI or TUI for recent supervisor logs, and compute-driver tooling for su ## CLI -Use `openshell logs` to stream logs from a running sandbox: +Use `os logs` to stream logs from a running sandbox: ```shell -openshell logs smoke-l4 --source sandbox +os logs smoke-l4 --source sandbox ``` The CLI receives logs from the gateway over gRPC. Each line includes a timestamp, source, level, and message: @@ -27,7 +27,7 @@ The CLI receives logs from the gateway over gRPC. Each line includes a timestamp OCSF structured events show `OCSF` as the level. Standard tracing events show `INFO`, `WARN`, or `ERROR`. -Gateway-originated policy mutations also appear in this stream. When the gateway merges `openshell policy update` operations or approves or removes draft policy chunks, it emits `gateway` `OCSF` `CONFIG:*` lines for the affected sandbox so you can see the exact logical change that produced a new policy revision. +Gateway-originated policy mutations also appear in this stream. When the gateway merges `os policy update` operations or approves or removes draft policy chunks, it emits `gateway` `OCSF` `CONFIG:*` lines for the affected sandbox so you can see the exact logical change that produced a new policy revision. ## TUI @@ -45,7 +45,7 @@ podman logs The sandbox runtime also emits OCSF shorthand events, including process-launch and Landlock filesystem events, into these container logs when its diagnostic log filter permits them. These runtime-originated events are not pushed to the gateway log stream or included in the supervisor's JSONL file. Collect workload container logs separately from supervisor logs to retain both sources. -A main process started with a TTY writes only to its attachment; use `openshell sandbox connect` to view that output. Output from `sandbox exec` and SSH sessions does not reach the container log, and `openshell logs` does not include main process output. +A main process started with a TTY writes only to its attachment; use `os sandbox connect` to view that output. Output from `sandbox exec` and SSH sessions does not reach the container log, and `os logs` does not include main process output. When the container runtime falls behind reading the log, the main process blocks on writes, as with any container. @@ -63,7 +63,7 @@ The gateway and compute drivers color their console logs only when the output st ## Loss Awareness and Resume -The watch stream behind `openshell logs` is loss-aware. Each resumable event (log line or platform event) carries an opaque `cursor` token. Status snapshots and warnings carry an empty cursor. +The watch stream behind `os logs` is loss-aware. Each resumable event (log line or platform event) carries an opaque `cursor` token. Status snapshots and warnings carry an empty cursor. Do not parse a cursor. The only supported operation is comparing two cursors observed on the same stream and keeping the greater one as the resume point. That comparison is a plain string comparison in any language. @@ -82,7 +82,7 @@ The gateway merges the log and platform event sources before emitting, so events ## Direct Filesystem Access -The supervisor writes shorthand logs to `/var/log/openshell.YYYY-MM-DD.log` and, when enabled, OCSF JSONL to `/var/log/openshell-ocsf.YYYY-MM-DD.jsonl` in its own filesystem. `openshell sandbox exec` runs in the workload and does not give access to the supervisor's files. +The supervisor writes shorthand logs to `/var/log/openshell.YYYY-MM-DD.log` and, when enabled, OCSF JSONL to `/var/log/openshell-ocsf.YYYY-MM-DD.jsonl` in its own filesystem. `os sandbox exec` runs in the workload and does not give access to the supervisor's files. | Compute driver | Supervisor log location | Local storage lifetime | |---|---|---| diff --git a/docs/observability/ocsf-json-export.mdx b/docs/observability/ocsf-json-export.mdx index 46f541ebd3..4376a92ccc 100644 --- a/docs/observability/ocsf-json-export.mdx +++ b/docs/observability/ocsf-json-export.mdx @@ -79,13 +79,13 @@ Use the `ocsf_json_enabled` setting to toggle JSON export. The setting can be ap Global: ```shell -openshell settings set --global --key ocsf_json_enabled --value true +os settings set --global --key ocsf_json_enabled --value true ``` Per-sandbox: ```shell -openshell settings set my-sandbox --key ocsf_json_enabled --value true +os settings set my-sandbox --key ocsf_json_enabled --value true ``` The setting takes effect on the next poll cycle, by default every 10 seconds. No sandbox restart is required. @@ -93,7 +93,7 @@ The setting takes effect on the next poll cycle, by default every 10 seconds. No To disable: ```shell -openshell settings set --global --key ocsf_json_enabled --value false +os settings set --global --key ocsf_json_enabled --value false ``` ### Windows MXC gateways @@ -141,9 +141,9 @@ podman logs --follow kubectl -n logs -c supervisor --follow ``` -JSON stderr output works independently of writable log storage and the diagnostic log filter. Disabling the setting stops new JSON records. The console writer uses a bounded queue of 1,024 complete lines shared by diagnostics, shorthand, and JSON; when the queue is full, new lines are dropped rather than blocking enforcement. Delivery is best-effort, and retention depends on your runtime and external collector. The gateway log API and `openshell logs` continue to return shorthand. +JSON stderr output works independently of writable log storage and the diagnostic log filter. Disabling the setting stops new JSON records. The console writer uses a bounded queue of 1,024 complete lines shared by diagnostics, shorthand, and JSON; when the queue is full, new lines are dropped rather than blocking enforcement. Delivery is best-effort, and retention depends on your runtime and external collector. The gateway log API and `os logs` continue to return shorthand. -When file logging is available, supervisors also write plain JSONL to `/var/log/openshell-ocsf.YYYY-MM-DD.jsonl` in their own filesystem, separate from the workload. `openshell sandbox exec` cannot read those files. File output requires a writable `/var/log`; a missing file sink does not disable JSON stderr output. +When file logging is available, supervisors also write plain JSONL to `/var/log/openshell-ocsf.YYYY-MM-DD.jsonl` in their own filesystem, separate from the workload. `os sandbox exec` cannot read those files. File output requires a writable `/var/log`; a missing file sink does not disable JSON stderr output. This file contains supervisor-originated events, not the [sandbox-runtime events](/observability/accessing-logs#main-process-output) emitted into workload container logs. diff --git a/docs/observability/overview.mdx b/docs/observability/overview.mdx index d6b5cfe6bd..4c591f8b49 100644 --- a/docs/observability/overview.mdx +++ b/docs/observability/overview.mdx @@ -15,7 +15,7 @@ OpenShell produces three kinds of observability signals: traces, metrics, and OC | Traces | Gateway, compute drivers, sandbox supervisors | OTLP collector | | Agent traces | Agents, relayed by sandbox supervisors | OTLP collector | | Metrics | Gateway | Prometheus scrape, optional OTLP push | -| OCSF events, shorthand | Gateway, sandbox supervisors | Gateway console, `openshell logs`, supervisor log file | +| OCSF events, shorthand | Gateway, sandbox supervisors | Gateway console, `os logs`, supervisor log file | | OCSF events, JSONL | Gateway, sandbox supervisors | Local file | | OCSF events, OTLP | Gateway, sandbox supervisors | OTLP collector | @@ -86,7 +86,7 @@ OCSF events record security-relevant activity, such as network and HTTP policy d ### Shorthand Logs -Shorthand logs are always on. Each event appears as a one-line summary in the gateway console, in the sandbox log stream that `openshell logs` and the TUI read, and in the supervisor's log file. For example, this policy denial is the event a sandbox produces when `curl https://github.com` runs without a network policy that allows `github.com`: +Shorthand logs are always on. Each event appears as a one-line summary in the gateway console, in the sandbox log stream that `os logs` and the TUI read, and in the supervisor's log file. For example, this policy denial is the event a sandbox produces when `curl https://github.com` runs without a network policy that allows `github.com`: ```text [1791996125.789] [sandbox] [OCSF ] [ocsf] NET:OPEN [MED] DENIED /usr/bin/curl(2187) -> github.com:443 [reason:transparent_tcp_policy_denied] @@ -106,7 +106,7 @@ path = "/var/log/openshell/gateway-ocsf.jsonl" ```shell # Supervisor events, for every sandbox. -openshell settings set --global --key ocsf_json_enabled --value true +os settings set --global --key ocsf_json_enabled --value true ``` For the record structure, file locations, and rotation, refer to [OCSF JSON Export](/observability/ocsf-json-export). diff --git a/docs/security/best-practices.mdx b/docs/security/best-practices.mdx index 89df4157b7..a10743e187 100644 --- a/docs/security/best-practices.mdx +++ b/docs/security/best-practices.mdx @@ -24,11 +24,11 @@ If you use [NemoClaw](https://github.com/NVIDIA/NemoClaw), its [Security Best Pr OpenShell applies security controls at two enforcement points. OpenShell locks static controls at sandbox creation and requires destroying and recreating the sandbox to change them. -You can update dynamic controls on a running sandbox with `openshell policy update` or `openshell policy set`. +You can update dynamic controls on a running sandbox with `os policy update` or `os policy set`. | Layer | What it protects | Enforcement point | Changeable at runtime | | --- | --- | --- | --- | -| Network | Unauthorized outbound connections and data exfiltration. | CONNECT proxy + OPA policy engine | Yes. Use `openshell policy update`, `openshell policy set`, or operator approval in the TUI. | +| Network | Unauthorized outbound connections and data exfiltration. | CONNECT proxy + OPA policy engine | Yes. Use `os policy update`, `os policy set`, or operator approval in the TUI. | | Filesystem | System binary tampering, credential theft, config manipulation. | Landlock LSM (kernel level) | No. Requires sandbox re-creation. | | Process | Privilege escalation, fork bombs, dangerous syscalls. | Seccomp BPF + non-root identity without Linux capabilities | No. Requires sandbox re-creation. | | Provider credentials | Credential exposure and unauthorized service access. | Network policy plus profile endpoint binding and proxy substitution | Yes. Attach or detach providers and update dynamic policy. | @@ -49,9 +49,9 @@ If no `network_policies` entry matches the destination host, port, and calling b | Aspect | Detail | |---|---| | Default | All egress denied. Only endpoints listed in `network_policies` can receive traffic. | -| What you can change | Add entries to `network_policies` in the policy YAML. Apply statically at creation (`--policy`) or dynamically (`openshell policy update` for incremental changes, `openshell policy set` for full replacement). | +| What you can change | Add entries to `network_policies` in the policy YAML. Apply statically at creation (`--policy`) or dynamically (`os policy update` for incremental changes, `os policy set` for full replacement). | | Risk if relaxed | Each allowed endpoint is a potential data exfiltration path. The agent can send workspace content, credentials, or conversation history to any reachable host. | -| Recommendation | Add only endpoints the agent needs for its task. Start with a minimal policy and use denied-request logs (`openshell logs --source sandbox`) to identify missing endpoints. | +| Recommendation | Add only endpoints the agent needs for its task. Start with a minimal policy and use denied-request logs (`os logs --source sandbox`) to identify missing endpoints. | ### Network Namespace Isolation @@ -294,7 +294,7 @@ SSH connections travel through the gateway and the supervisor's authenticated co Older gateways, local-development identities and deployments that intercept SSH session creation or revocation use sandbox-scoped session tokens. Older clients can continue to use those tokens on a new gateway. Both modes share the per-sandbox SSH connection limit. The sandbox SSH daemon listens on a local Unix socket accessible to its supervisor. -Service forwards (`openshell forward`) use the same relay path but carry no session token. The gateway authorizes each forwarded connection against the caller's gateway identity and workspace membership, and the per-sandbox service forward limit applies. +Service forwards (`os forward`) use the same relay path but carry no session token. The gateway authorizes each forwarded connection against the caller's gateway identity and workspace membership, and the per-sandbox service forward limit applies. | Aspect | Detail | |---|---| diff --git a/docs/tutorials/first-network-policy.mdx b/docs/tutorials/first-network-policy.mdx index b0b3e61d13..0b70cbb1e6 100644 --- a/docs/tutorials/first-network-policy.mdx +++ b/docs/tutorials/first-network-policy.mdx @@ -38,7 +38,7 @@ bash examples/sandbox-policy-quickstart/demo.sh Start by creating a sandbox with no network policies. This gives you a clean environment to observe default-deny behavior. ```shell -openshell sandbox create \ +os sandbox create \ --name demo \ --from registry.example.com/team/agent-tools:1.0 \ --no-auto-providers @@ -68,7 +68,7 @@ The request fails. By default, all outbound network traffic is denied. The sandb curl: (56) Received HTTP code 403 from proxy after CONNECT ``` -Leave this sandbox shell open and switch to a second terminal on your host for the next steps. The remaining `openshell` commands (checking logs and applying the policy) run on your host, not inside the sandbox. +Leave this sandbox shell open and switch to a second terminal on your host for the next steps. The remaining `os` commands (checking logs and applying the policy) run on your host, not inside the sandbox. Keep the interactive sandbox shell open for the rest of the tutorial. Exiting it stops the sandbox's main process, and with the default restart policy the sandbox is not reconnectable afterward. Add `--no-keep` at creation time if you want the sandbox deleted automatically when you exit. @@ -80,7 +80,7 @@ Keep the interactive sandbox shell open for the rest of the tutorial. Exiting it Every denied connection produces a structured log entry. In your second (host) terminal, query the sandbox logs to confirm the denial and inspect the reason. ```shell -openshell logs demo --since 5m --source sandbox +os logs demo --since 5m --source sandbox ``` You see a line like: @@ -96,7 +96,7 @@ Every denied connection is logged with the destination, the binary that attempte To allow the sandbox to reach the GitHub API, add a network rule that grants `curl` read-only access. Run this command from your host terminal: ```shell -openshell policy update demo \ +os policy update demo \ --rule-name github_api \ --binary /usr/bin/curl \ --add-endpoint api.github.com:443:read-only:rest:enforce \ @@ -120,7 +120,7 @@ network_policies: - path: /usr/bin/curl ``` -To see the complete policy, run `openshell policy get demo --base`. +To see the complete policy, run `os policy get demo --base`. `--wait` waits until the sandbox reports a result for the new policy revision. No restart is required, because network rules reload while the sandbox runs. @@ -170,7 +170,7 @@ The connection succeeded because `api.github.com` is allowed, but the proxy insp Request-level (L7) denials are logged separately from connection-level denials. The log entry includes the exact HTTP method and path that the proxy rejected. Run this from your second (host) terminal, leaving the sandbox shell open: ```shell -openshell logs demo --since 5m --source sandbox +os logs demo --since 5m --source sandbox ``` ```text @@ -189,7 +189,7 @@ To log violations without blocking requests, set `enforcement: audit` instead of Delete the sandbox to free resources. This stops all processes and purges any injected credentials. ```shell -openshell sandbox delete demo +os sandbox delete demo ``` diff --git a/docs/tutorials/github-push-access.mdx b/docs/tutorials/github-push-access.mdx index 392a8fd3d7..1989477aac 100644 --- a/docs/tutorials/github-push-access.mdx +++ b/docs/tutorials/github-push-access.mdx @@ -41,8 +41,8 @@ import them directly. If a path or endpoint grant needs to change, edit a local copy and import it with `-f` instead. ```shell -openshell profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/claude-code.yaml --global -openshell profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/github.yaml --global +os profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/claude-code.yaml --global +os profile import --url https://raw.githubusercontent.com/ai-openshell/openshell/main/providers/github.yaml --global ``` The gateway contains no built-in profiles. Import each profile once per gateway @@ -55,10 +55,10 @@ credential on the same command line exports it only to that command: ```shell ANTHROPIC_API_KEY= \ - openshell provider create --name my-claude --type claude-code --from-existing + os provider create --name my-claude --type claude-code --from-existing GITHUB_TOKEN= \ - openshell provider create --name my-github --type github --from-existing + os provider create --name my-github --type github --from-existing ``` OpenShell stores the credentials through the configured credential driver. The @@ -70,7 +70,7 @@ endpoints allowed by the corresponding profile. In terminal 1, start Claude Code from your image and attach both providers: ```shell -openshell sandbox create \ +os sandbox create \ --name github-demo \ --from registry.example.com/your-org/claude-agent:latest \ --provider my-claude \ @@ -82,9 +82,9 @@ To use an existing sandbox, attach the providers from a host terminal, then start a new agent process so it receives the provider environment variables: ```shell -openshell sandbox provider attach my-claude -openshell sandbox provider attach my-github -openshell sandbox connect +os sandbox provider attach my-claude +os sandbox provider attach my-github +os sandbox connect ``` ## Attempt a Push @@ -108,7 +108,7 @@ not grant the missing network authority. In terminal 2, inspect recent sandbox logs: ```shell -openshell logs github-demo --since 5m --source sandbox +os logs github-demo --since 5m --source sandbox ``` You should see a denial for a request resembling this one: @@ -121,7 +121,7 @@ You should see a denial for a request resembling this one: `my-github` provider. Policy events are INFO-level log records, so do not filter them out with `--level warn`. -You can also run `openshell term` to inspect policy decisions in the terminal +You can also run `os term` to inspect policy decisions in the terminal dashboard. ## Create a Repository-Scoped Policy @@ -130,7 +130,7 @@ dashboard. current one. In terminal 2, print it: ```shell -openshell policy get github-demo --base +os policy get github-demo --base ``` The command prints revision details followed by the policy. Save only the policy @@ -191,7 +191,7 @@ placement and its broader read-only rules. Apply the policy and wait for the new revision to load: ```shell -openshell policy set github-demo --policy github-push.yaml --wait +os policy set github-demo --policy github-push.yaml --wait ``` Network policy changes hot-reload without recreating the sandbox. Provider @@ -203,8 +203,8 @@ Ask the agent to retry the push. Then confirm that the proxy allowed the scoped request: ```shell -openshell logs github-demo --since 5m -openshell policy get github-demo --full +os logs github-demo --since 5m +os policy get github-demo --full ``` The push succeeds for the selected repository. Requests to push to another @@ -215,7 +215,7 @@ repository remain denied. Delete the sandbox when you are finished: ```shell -openshell sandbox delete github-demo +os sandbox delete github-demo ``` diff --git a/docs/tutorials/microsoft-graph-provider-refresh.mdx b/docs/tutorials/microsoft-graph-provider-refresh.mdx index 4c74ac3276..74f2dea67b 100644 --- a/docs/tutorials/microsoft-graph-provider-refresh.mdx +++ b/docs/tutorials/microsoft-graph-provider-refresh.mdx @@ -92,8 +92,8 @@ binaries: Lint and import the profile: ```shell -openshell profile lint -f microsoft-graph-mail.yaml -openshell profile import -f microsoft-graph-mail.yaml +os profile lint -f microsoft-graph-mail.yaml +os profile import -f microsoft-graph-mail.yaml ``` The profile defines the refresh strategy and Graph network policy. The `tenant_id` refresh material selects the Microsoft token endpoint during gateway-managed refresh. @@ -103,7 +103,7 @@ The profile defines the refresh strategy and Graph network policy. The `tenant_i Create the provider with the current Microsoft Graph access token: ```shell -openshell provider create \ +os provider create \ --name microsoft-mail \ --type microsoft-graph-mail \ --credential MS_GRAPH_ACCESS_TOKEN="$MS_GRAPH_ACCESS_TOKEN" @@ -116,7 +116,7 @@ The current CLI requires an initial credential at provider creation time. Refres Configure gateway-managed OAuth2 refresh-token rotation: ```shell -openshell provider refresh configure microsoft-mail \ +os provider refresh configure microsoft-mail \ --credential-key MS_GRAPH_ACCESS_TOKEN \ --strategy oauth2-refresh-token \ --material tenant_id="$MS_TENANT_ID" \ @@ -131,14 +131,14 @@ openshell provider refresh configure microsoft-mail \ Force the first refresh immediately: ```shell -openshell provider refresh rotate microsoft-mail \ +os provider refresh rotate microsoft-mail \ --credential-key MS_GRAPH_ACCESS_TOKEN ``` Check refresh status: ```shell -openshell provider refresh status microsoft-mail \ +os provider refresh status microsoft-mail \ --credential-key MS_GRAPH_ACCESS_TOKEN ``` @@ -149,7 +149,7 @@ The status output shows refresh state, expiry, next refresh, and last refresh ti Launch a sandbox with the Microsoft Graph provider attached: ```shell -openshell sandbox create \ +os sandbox create \ --name microsoft-graph-mail \ --from registry.example.com/team/agent-tools:1.0 \ --provider microsoft-mail \ diff --git a/docs/tutorials/run-pi-with-openrouter.mdx b/docs/tutorials/run-pi-with-openrouter.mdx index fa8d05d498..0899a42405 100644 --- a/docs/tutorials/run-pi-with-openrouter.mdx +++ b/docs/tutorials/run-pi-with-openrouter.mdx @@ -126,11 +126,11 @@ Here's what the main sections do: Check the profile, import it, and create a provider named `openrouter`: ```shell -openshell profile lint -f provider-openrouter.yaml -openshell profile import -f provider-openrouter.yaml +os profile lint -f provider-openrouter.yaml +os profile import -f provider-openrouter.yaml OPENROUTER_API_KEY=your-key \ - openshell provider create \ + os provider create \ --name openrouter \ --type openrouter \ --from-existing @@ -145,7 +145,7 @@ OpenShell to read the key from that variable. Next, create a sandbox from the image, attach the provider, and start Pi: ```shell -openshell sandbox create \ +os sandbox create \ --name pi \ --from pi-agent:local \ --provider openrouter \ @@ -174,13 +174,13 @@ While Pi is running, open another terminal and take a look at the sandbox's status, access, providers, and logs: ```shell -openshell sandbox list -openshell policy get pi --full -openshell sandbox provider list pi -openshell logs pi --tail +os sandbox list +os policy get pi --full +os sandbox provider list pi +os logs pi --tail ``` -`openshell logs` streams the sandbox's activity, including any connections it +`os logs` streams the sandbox's activity, including any connections it blocks. When you're done, type `/quit` in Pi to exit. ## Work on a Local Project @@ -191,7 +191,7 @@ You cannot combine `--upload` with a trailing command, so start Pi from the shell that opens. ```shell -openshell sandbox create \ +os sandbox create \ --name pi-project \ --from pi-agent:local \ --provider openrouter \ @@ -201,7 +201,7 @@ openshell sandbox create \ In the sandbox shell, run `pi`. Pi's changes stay inside the sandbox. To copy them back, run -`openshell sandbox download` from another terminal while Pi is still running. +`os sandbox download` from another terminal while Pi is still running. Refer to [Transfer Files](/how-it-works/sandboxes/overview#transfer-files). ## Clean Up @@ -209,7 +209,7 @@ Refer to [Transfer Files](/how-it-works/sandboxes/overview#transfer-files). When you're finished, delete both sandboxes: ```shell -openshell sandbox delete pi pi-project +os sandbox delete pi pi-project ``` diff --git a/docs/upgrade/0-1-0.mdx b/docs/upgrade/0-1-0.mdx index ddd25b8783..f40a6fc0bd 100644 --- a/docs/upgrade/0-1-0.mdx +++ b/docs/upgrade/0-1-0.mdx @@ -29,8 +29,8 @@ If you run OpenShell for a team, start here. - **Export provider profiles before upgrading.** The gateway no longer includes built-in profiles. Import the saved profiles after the upgrade at the same global or workspace scope. Replace profile aliases such as `claude` and `gh` with the canonical IDs `claude-code` and `github` ([PR #2962](https://github.com/ai-openshell/openshell/pull/2962), [PR #3383](https://github.com/ai-openshell/openshell/pull/3383)). ```shell - openshell provider profile export -o yaml --global > .yaml - openshell profile import --from ./profiles --global + os provider profile export -o yaml --global > .yaml + os profile import --from ./profiles --global ``` - **Migrate `gateway.toml` to schema version 2.** Add the version, replace the plural compute-driver selector, move driver settings under `[openshell.drivers.]`, and apply the renamed Docker, Podman, and VM fields. Validate the file before restarting. See [Gateway Configuration](/how-it-works/gateways/configuration#migrate-to-schema-version-2) for the complete field mapping and [PR #2814](https://github.com/ai-openshell/openshell/pull/2814) for the implementation. @@ -84,12 +84,12 @@ If you use OpenShell through the CLI, policies, APIs, or SDKs, review these chan - **Git filtering failures stop uploads.** `sandbox upload` and `sandbox create --upload` now exit with an error when Git filtering fails or returns no files, instead of uploading the source unfiltered. This includes unavailable Git and broken or inaccessible repositories. Sources confirmed to be outside a Git work tree still upload without filtering, with a warning that `.gitignore` rules are not applied. Update scripts and CI to install Git and fix filtering errors, or pass `--no-git-ignore` when an unfiltered transfer is intended. A rejected creation-time upload leaves the sandbox running; retry with `sandbox upload` or remove it with `sandbox delete` ([PR #3957](https://github.com/ai-openshell/openshell/pull/3957)). -- **Build local images before sandbox creation.** `openshell sandbox create --from` no longer builds a Dockerfile or directory. Build and tag with the gateway's container engine, then pass the image reference. Remote gateways need an image they can pull from a registry ([PR #3214](https://github.com/ai-openshell/openshell/pull/3214)). +- **Build local images before sandbox creation.** `os sandbox create --from` no longer builds a Dockerfile or directory. Build and tag with the gateway's container engine, then pass the image reference. Remote gateways need an image they can pull from a registry ([PR #3214](https://github.com/ai-openshell/openshell/pull/3214)). ```shell docker build -t registry.example.com/team/agent:0.1.0 . docker push registry.example.com/team/agent:0.1.0 - openshell sandbox create --from registry.example.com/team/agent:0.1.0 + os sandbox create --from registry.example.com/team/agent:0.1.0 ``` - **Name providers explicitly.** A trailing sandbox command no longer infers or attaches a provider. Pass `--provider `, and ask the operator to import the referenced profile when it is missing ([PR #3383](https://github.com/ai-openshell/openshell/pull/3383)). @@ -126,6 +126,6 @@ If you use OpenShell through the CLI, policies, APIs, or SDKs, review these chan - **Stop importing persistence messages.** The `StoredProviderProfile`, refresh-state, stored policy revision, and draft-chunk messages move to a private storage package and have no public API replacement ([PR #3169](https://github.com/ai-openshell/openshell/pull/3169)). -- **Replace scripted `gateway info` calls.** The command now returns live, admin-gated runtime state. Use `openshell gateway list -o json` for local registration metadata ([PR #2202](https://github.com/ai-openshell/openshell/pull/2202)). +- **Replace scripted `gateway info` calls.** The command now returns live, admin-gated runtime state. Use `os gateway list -o json` for local registration metadata ([PR #2202](https://github.com/ai-openshell/openshell/pull/2202)). - **Stop parsing the profile list table.** The human-readable columns change. Use JSON or YAML output in scripts; the structured profile schema is unchanged ([PR #3258](https://github.com/ai-openshell/openshell/pull/3258)). diff --git a/e2e/rust/src/harness/binary.rs b/e2e/rust/src/harness/binary.rs index 5f6f476757..d7bc2a1294 100644 --- a/e2e/rust/src/harness/binary.rs +++ b/e2e/rust/src/harness/binary.rs @@ -33,7 +33,7 @@ pub fn openshell_bin() -> PathBuf { .map_or_else(|| workspace_root().join("target/debug/os"), PathBuf::from); assert!( bin.is_file(), - "openshell binary not found at {} — set OPENSHELL_BIN or run `cargo build -p openshell-cli` first", + "os binary not found at {} — set OPENSHELL_BIN or run `cargo build -p openshell-cli` first", bin.display() ); bin diff --git a/skills/debug-inference/SKILL.md b/skills/debug-inference/SKILL.md index 4fad1480eb..36f0890ea1 100644 --- a/skills/debug-inference/SKILL.md +++ b/skills/debug-inference/SKILL.md @@ -10,7 +10,7 @@ longer supplies a managed inference route, rewrites request shapes, or selects a model. The application calls the provider's native endpoint and owns its base URL, model, request format, and timeout. -Use installed `openshell --help` output as the authority for command syntax. +Use installed `os --help` output as the authority for command syntax. Refer to the published [provider management guide](https://docs.nvidia.com/openshell/latest/how-it-works/providers/overview) and [provider profile guide](https://docs.nvidia.com/openshell/latest/how-it-works/providers/profiles) for current behavior. @@ -20,9 +20,9 @@ for current behavior. ### 1. Confirm Gateway and Sandbox Context ```bash -openshell status -openshell gateway info -openshell sandbox get +os status +os gateway info +os sandbox get ``` For a host-local model server, `host.openshell.internal` identifies the machine @@ -33,8 +33,8 @@ container; bind it to an address reachable from the gateway runtime. ### 2. Inspect the Provider and Its Profile ```bash -openshell provider get -openshell profile export -o yaml +os provider get +os profile export -o yaml ``` Check that the profile: @@ -49,9 +49,9 @@ endpoint-bearing profile. A base URL stored only in provider configuration does not authorize a new endpoint. ```bash -openshell profile lint -f ./provider-profile.yaml -openshell profile import -f ./provider-profile.yaml -openshell provider create --name --type +os profile lint -f ./provider-profile.yaml +os profile import -f ./provider-profile.yaml +os provider create --name --type ``` Add the required `--credential KEY` or `--credential KEY=VALUE` arguments shown @@ -61,16 +61,16 @@ binding error. ### 3. Confirm Attachment ```bash -openshell sandbox provider list -openshell sandbox provider attach --wait --timeout 30 +os sandbox provider list +os sandbox provider attach --wait --timeout 30 ``` -Save the change's `receipt_id` and use `openshell sandbox provider status --receipt --wait --timeout 30` to check when it takes effect. Success confirms that the sandbox applied the credentials, policy, and environment for new processes. If the result is pending, failed, withheld, or superseded, inspect its reason before launching the client. +Save the change's `receipt_id` and use `os sandbox provider status --receipt --wait --timeout 30` to check when it takes effect. Success confirms that the sandbox applied the credentials, policy, and environment for new processes. If the result is pending, failed, withheld, or superseded, inspect its reason before launching the client. Launch the client after the attachment wait succeeds so it receives the updated environment: ```bash -openshell sandbox exec -- +os sandbox exec -- ``` After updating an ordinary static provider, wait for that change and launch a @@ -83,7 +83,7 @@ Diagnose managed-refresh credentials according to their own lifecycle. Keep credentials and issued references out of diagnostic output. Acknowledged detach revokes future credential resolution and removes the reference from future process environments. Requests already forwarded may still finish: ```bash -openshell sandbox provider detach --wait --timeout 30 +os sandbox provider detach --wait --timeout 30 ``` ### 4. Verify Native Client Configuration diff --git a/skills/debug-openshell-cluster/SKILL.md b/skills/debug-openshell-cluster/SKILL.md index e7e7ee8d88..ce0c15b0d8 100644 --- a/skills/debug-openshell-cluster/SKILL.md +++ b/skills/debug-openshell-cluster/SKILL.md @@ -7,7 +7,7 @@ description: Debug why an OpenShell gateway deployment is unhealthy, unreachable Diagnose a gateway and its selected compute platform. Do not assume OpenShell provisions Kubernetes or runs a k3s container. OpenShell targets a reachable gateway endpoint backed by Docker, Podman, Kubernetes, the experimental VM driver, or an operator-managed out-of-tree compute driver. -Use `openshell` first to identify the active endpoint. Then use the platform tools that match the gateway's compute driver: `docker`, `podman`, `kubectl`/`helm`, or VM driver logs. +Use `os` first to identify the active endpoint. Then use the platform tools that match the gateway's compute driver: `docker`, `podman`, `kubectl`/`helm`, or VM driver logs. ## Overview @@ -16,7 +16,7 @@ The target deployment flow is: 1. Operator starts or deploys the gateway with system packages, systemd, or Helm. The CLI does not start, stop, or destroy gateway services. 2. Operator configures the compute driver. 3. Operator provides the CLI and supervisor authentication material required by the deployment mode: edge or OIDC user auth, optional CLI mTLS, and gateway-minted sandbox JWTs. -4. The CLI registers a reachable gateway endpoint with `openshell gateway add`. +4. The CLI registers a reachable gateway endpoint with `os gateway add`. 5. The gateway creates sandboxes through the selected compute driver. The `openshell-gateway` composition crate explicitly installs its compiled @@ -41,13 +41,13 @@ For local evaluation only, TLS may be disabled and the gateway can be reached th ## Prerequisites -- The `openshell` CLI must be available for endpoint checks. +- The `os` CLI must be available for endpoint checks. - Know the active gateway name and endpoint, or be able to inspect local gateway metadata. - Know the compute platform: Docker, Podman, Kubernetes, VM, or an out-of-tree driver. - For Kubernetes: 1.33 is the minimum tested version; compatibility with older clusters is not guaranteed. `kubectl` must target the cluster that hosts OpenShell and Helm version 3 or later must be available. - For Docker or Podman: the runtime socket must be reachable from the gateway host. -Use `openshell --help` and nested `--help` output as the authority for the installed CLI version. Use the published [installation guide](https://docs.nvidia.com/openshell/latest/about/installation.md), [compute-driver reference](https://docs.nvidia.com/openshell/latest/how-it-works/sandboxes/runtimes), [gateway configuration reference](https://docs.nvidia.com/openshell/latest/how-it-works/gateways/configuration), and [Kubernetes setup guide](https://docs.nvidia.com/openshell/latest/kubernetes/setup.md) as the authority for deployment and configuration behavior. +Use `os --help` and nested `--help` output as the authority for the installed CLI version. Use the published [installation guide](https://docs.nvidia.com/openshell/latest/about/installation.md), [compute-driver reference](https://docs.nvidia.com/openshell/latest/how-it-works/sandboxes/runtimes), [gateway configuration reference](https://docs.nvidia.com/openshell/latest/how-it-works/gateways/configuration), and [Kubernetes setup guide](https://docs.nvidia.com/openshell/latest/kubernetes/setup.md) as the authority for deployment and configuration behavior. ## Workflow @@ -56,25 +56,25 @@ Run diagnostics in order and stop once the root cause is clear. ### Step 1: Check CLI Reachability ```bash -openshell gateway list --output json -openshell gateway info -openshell status +os gateway list --output json +os gateway info +os status ``` For a one-off endpoint check that bypasses stored gateway selection and metadata: ```bash -openshell --gateway-endpoint status +os --gateway-endpoint status ``` Common findings: -- `No active gateway`: register one with `openshell gateway add `. +- `No active gateway`: register one with `os gateway add `. - `gateway has no user authentication configured`: configure OIDC, mTLS user or operator authentication, or gateway JWTs using the published gateway configuration reference. For trusted local development, explicitly set `[openshell.gateway.auth] allow_unauthenticated_users = true`; the gateway otherwise refuses to bind any ports. - Connection refused: gateway process is not running, service exposure is wrong, or a port-forward/proxy is not active. - TLS/certificate errors: the endpoint scheme or trust chain is wrong, a CLI mTLS bundle does not match the gateway CA, a supervisor is missing the gateway CA, or TLS termination does not match the gateway listener. Workloads and supervisors should not contain a user TLS client certificate or private key. - Fresh snap installations select `gateway-mode=user`, but the user gateway is globally disabled by default. `install.sh` enables `snap.openshell.user-gateway.service` only for its target user; direct snap installations must select one user and run `systemctl --user enable --now snap.openshell.user-gateway.service` from that user's session. Do not enable it for multiple concurrently logged-in users: every instance binds to `127.0.0.1:17670`, so later instances fail with an address-in-use error. Older snap revisions could leave the unit globally enabled; remove that state with `sudo systemctl disable --global snap.openshell.user-gateway.service`, then disable and stop the service from every other affected user's session. The global command does not stop running user services. Setting `gateway-mode=user` disables the system gateway without changing any user's service. To change the selected user, disable and stop the current user's unit before enabling the new user's unit. Upgraded installations retain their system-owned state through `openshell.system-gateway`. Existing HTTPS registrations continue to work after the service rename. Follow the published snap installation steps to enroll a new user, replace an old HTTP registration, or change modes safely through the `disable` maintenance state. If `gateway-mode=disable`, no local snap gateway is expected to run. -- `Unauthenticated` from an edge or OIDC gateway: refresh stored credentials with `openshell gateway login [name]`, then retry. Use `gateway logout` only when intentionally clearing local credentials. +- `Unauthenticated` from an edge or OIDC gateway: refresh stored credentials with `os gateway login [name]`, then retry. Use `gateway logout` only when intentionally clearing local credentials. - Operator credential retrieval requires direct gateway mTLS, `[openshell.gateway.mtls_auth] operator_enabled = true`, and a verified certificate with exact `OU=operator`. OIDC admin roles and forwarded certificate headers do not grant access. Do not combine the operator certificate with an `Authorization` header. Enabling this role grants gateway-wide administration; never repair a denial by issuing operator certificates to ordinary users. See the published gateway authentication and provider references. - A direct development endpoint with a private or self-signed certificate can be isolated with `--gateway-endpoint --gateway-insecure`; do not persist or recommend insecure verification for shared gateways. @@ -162,7 +162,7 @@ when neither that CA nor the package-managed local CA is available. Kubernetes projects only the gateway CA from a Secret into supervisor Pods; supervisors authenticate gateway RPCs with sandbox bearer tokens. -Custom names use `[openshell.drivers.].socket_path`. A launch-time `--compute-driver-socket` override may also use `docker`, `podman`, `kubernetes`, or `vm`; the endpoint then takes precedence over built-in construction. First-party standalone drivers require the socket parent directory to be owned by the driver's effective UID, force its mode to `0700`, create the socket with mode `0600`, and accept only peers with that same UID. Check the parent and socket separately with `stat`; a gateway running under a different UID cannot connect even when filesystem permissions or group membership would otherwise allow it. Operator-supplied drivers must provide equivalent access control appropriate to their implementation. Check gateway logs for connection errors, `GetCapabilities` failures, missing peer metadata, protocol-major mismatch, unmet required capabilities, or an unexpected advertised driver name. `openshell gateway info` reports successful startup negotiations. The advertised name is diagnostic metadata; negotiated features control optional behavior. The gateway does not create or supervise operator-supplied driver processes or sockets. +Custom names use `[openshell.drivers.].socket_path`. A launch-time `--compute-driver-socket` override may also use `docker`, `podman`, `kubernetes`, or `vm`; the endpoint then takes precedence over built-in construction. First-party standalone drivers require the socket parent directory to be owned by the driver's effective UID, force its mode to `0700`, create the socket with mode `0600`, and accept only peers with that same UID. Check the parent and socket separately with `stat`; a gateway running under a different UID cannot connect even when filesystem permissions or group membership would otherwise allow it. Operator-supplied drivers must provide equivalent access control appropriate to their implementation. Check gateway logs for connection errors, `GetCapabilities` failures, missing peer metadata, protocol-major mismatch, unmet required capabilities, or an unexpected advertised driver name. `os gateway info` reports successful startup negotiations. The advertised name is diagnostic metadata; negotiated features control optional behavior. The gateway does not create or supervise operator-supplied driver processes or sockets. For the Kubernetes Secrets credential driver, every provider credential lives in the configured `namespace`, in every workspace mode. A `PermissionDenied` error @@ -265,7 +265,7 @@ supervisor session becomes unready, so a stale socket file is not sufficient. A `ConfigurationInvalid` readiness condition means startup admission rejected the image/effective policy or provider configuration. The supervisor remains -alive while the workload stays unstarted. Inspect `openshell sandbox get` and +alive while the workload stays unstarted. Inspect `os sandbox get` and repair the desired configuration with a complete policy replacement or provider change; do not treat a healthy container as proof that the workload is ready. If the provisioning repair window (default 300 seconds) expires, the gateway records @@ -319,7 +319,7 @@ docker info docker ps --filter name=openshell docker logs --tail=200 docker run --rm --entrypoint /openshell-sandbox "${OPENSHELL_SANDBOX_RUNTIME_IMAGE:-quay.io/ai-openshell/sandbox:latest}" --version -openshell status +os status ``` For Docker GPU failures, check CDI support and NVIDIA CDI discovery separately: @@ -363,8 +363,8 @@ Common findings: - Docker driver cannot initialize because it cannot find `openshell-sandbox`: verify the sibling binary next to `openshell-gateway`, or that the configured `sandbox_runtime_image` contains `/openshell-sandbox`. - Sandbox never registers: check gateway logs and the supervisor's gateway endpoint. - SSH host-key startup errors: use matching gateway, compute-driver, and supervisor releases. The gateway retains each sandbox's SSH key in its configured credential store and sends it only through the supervisor bootstrap bundle. Check credential-driver availability and compare the public `host_key_fingerprint` from sandbox JSON output; never print the bootstrap bundle or private key. A missing stored key for a sandbox with a fingerprint is an error, not permission to replace its identity. See the [sandbox SSH identity documentation](https://docs.nvidia.com/openshell/latest/how-it-works/sandboxes/overview). -- Client reports `SSH host key mismatch for sandbox ''`: the SSH server reached through the gateway presented a key other than the one the gateway publishes, and the client refused it before authentication. Read the published `host_key_fingerprint` with `openshell sandbox get --output json` and compare it with the `gateway published` and `server presented` values in the error. Use matching gateway, compute-driver, and supervisor releases, then stop and start the sandbox so its supervisor restarts with the assigned key. Do not work around the check. -- Calls to an external tool server fail while the sandbox is Ready: inspect `Tool server connections` in `openshell sandbox get `. For configured MCP-over-HTTP endpoints, JSON output exposes each address together with `last_result` and `last_reported_at` in `endpoint_statuses`. Select the endpoint by host, path, and ports, then check the reported failure boundary. `last_reported_at` records gateway acceptance time and can advance when retained evidence is accepted after a reset. Results do not expire or prove current availability; `HttpResponseReceived` can still contain a tool error. For token grant failures on any HTTP protocol, including failures before endpoint selection, inspect `last_token_grant_failure` in JSON output. It contains the bounded destination and cause, survives unrelated successful traffic, and clears on matching grant success or a policy, provider, or supervisor reset. If several paths share a host and port, other failures before the path is known, such as TLS failures, remain only in logs. A `CredentialUnavailable` result from a failed dynamic token grant also carries `last_failure` with a closed-set `code`, `stage`, `recovery_action`, the provider and credential names, and the `request_id` that the workload received in its `x-openshell-request-id` response header. Search `openshell logs ` for that ID: the supervisor's `Token grant failed` line carries the code and stage for every endpoint, and the gateway's `dynamic token grant failed` line appears when the gateway hop failed. Verify the actual operation when current tool availability matters. +- Client reports `SSH host key mismatch for sandbox ''`: the SSH server reached through the gateway presented a key other than the one the gateway publishes, and the client refused it before authentication. Read the published `host_key_fingerprint` with `os sandbox get --output json` and compare it with the `gateway published` and `server presented` values in the error. Use matching gateway, compute-driver, and supervisor releases, then stop and start the sandbox so its supervisor restarts with the assigned key. Do not work around the check. +- Calls to an external tool server fail while the sandbox is Ready: inspect `Tool server connections` in `os sandbox get `. For configured MCP-over-HTTP endpoints, JSON output exposes each address together with `last_result` and `last_reported_at` in `endpoint_statuses`. Select the endpoint by host, path, and ports, then check the reported failure boundary. `last_reported_at` records gateway acceptance time and can advance when retained evidence is accepted after a reset. Results do not expire or prove current availability; `HttpResponseReceived` can still contain a tool error. For token grant failures on any HTTP protocol, including failures before endpoint selection, inspect `last_token_grant_failure` in JSON output. It contains the bounded destination and cause, survives unrelated successful traffic, and clears on matching grant success or a policy, provider, or supervisor reset. If several paths share a host and port, other failures before the path is known, such as TLS failures, remain only in logs. A `CredentialUnavailable` result from a failed dynamic token grant also carries `last_failure` with a closed-set `code`, `stage`, `recovery_action`, the provider and credential names, and the `request_id` that the workload received in its `x-openshell-request-id` response header. Search `os logs ` for that ID: the supervisor's `Token grant failed` line carries the code and stage for every endpoint, and the gateway's `dynamic token grant failed` line appears when the gateway hop failed. Verify the actual operation when current tool availability matters. - On Docker Desktop, repeated `Policy fetch failed after 5 attempts` messages can mean the supervisor's selected network mode cannot reach the gateway. Check the gateway's `Selected Docker supervisor networking` log. The default @@ -443,7 +443,7 @@ remain until its lease expires and temporarily block reconnection. Successful compute stop alone does not confirm that session cleanup finished. For a sandbox with `--restart-policy on-failure` or `always`, inspect -`openshell sandbox get ` for the policy, exit code, restart count, and +`os sandbox get ` for the policy, exit code, restart count, and next restart time. `Starting` can mean the gateway is waiting for backoff or for a replacement supervisor. Check gateway logs for stop or start errors if the deadline passes without a transition to `Ready`. Docker, Podman, @@ -456,7 +456,7 @@ the replacement. podman info podman ps --filter name=openshell podman logs --tail=200 -openshell status +os status ``` Common findings: @@ -1201,8 +1201,8 @@ kubectl -n openshell port-forward service/openshell 8080:8080 Leave the port forward running. In another terminal, register the local endpoint if needed and verify it: ```bash -openshell gateway add http://127.0.0.1:8080 --local --name local-kubernetes -openshell status +os gateway add http://127.0.0.1:8080 --local --name local-kubernetes +os status ``` If the gateway is healthy but sandbox creation fails: @@ -1688,8 +1688,8 @@ For `vm.mounts` (virtiofs host bind mounts) failures, also verify: Then run: ```bash -openshell status -openshell logs +os status +os logs ``` #### Corporate upstream proxy @@ -1721,12 +1721,12 @@ credential failures. | Symptom | Likely cause | Check | |---|---|---| | Collector receives no gateway metrics | OTLP metric export is off, or its collector cannot accept metrics | Set `enabled = true` in `[openshell.gateway.otlp.metrics]`, inspect `metrics_endpoint` in the gateway's `OTLP exporting enabled` log, and check exporter errors. Metrics use their table's collector, or inherit the shared collector when no endpoint is set; the Prometheus listener is configured independently. See [OTLP metrics](https://docs.nvidia.com/openshell/latest/how-it-works/gateways/configuration#otlp-metrics). | -| `openshell status` fails | Gateway endpoint unreachable or auth mismatch | `openshell gateway info`, gateway logs | +| `os status` fails | Gateway endpoint unreachable or auth mismatch | `os gateway info`, gateway logs | | Probes get `connection refused` on an IPv6 cluster | Listeners bind `0.0.0.0` by default | Set `gateway.listenAddress=::` and `supervisor.listenAddress=::` | | Collector receives no OCSF log records, or `openshell.ocsf.gap` records | `[openshell.gateway.otlp.ocsf]` missing or without `enabled = true`, an unreachable endpoint or one that does not speak the table's `protocol`, or export failures and queue pressure | Check `[openshell.gateway.otlp.ocsf]` for `enabled = true` and the endpoint it resolves to, the gateway's `OTLP exporting enabled` startup log for `ocsf_endpoint` and `ocsf_protocol`, export warnings, and `openshell_ocsf_otlp_*` metrics. See the published [gateway configuration reference](https://docs.nvidia.com/openshell/latest/how-it-works/gateways/configuration). | | Gateway OCSF JSONL stops growing, has gaps, or is rejected by a SIEM | File errors, queue pressure, or shipper falling behind retention | Inspect gateway warnings and `openshell_ocsf_log_*` metrics; check `[openshell.gateway.ocsf_log]`, directory permissions, free space, per-replica paths, and shipper rotation checkpoints. See the published [gateway configuration reference](https://docs.nvidia.com/openshell/latest/how-it-works/gateways/configuration). | | `BatchSpanProcessor.ExportError` repeatedly reports connection refused on `127.0.0.1:4317` | The local gateway started with `OPENSHELL_DEV_OTLP_ENDPOINT` set but no collector is listening, for example because `helm:k3s:forward` stopped | Start the collector forwarding again, or restart the gateway task without `OPENSHELL_DEV_OTLP_ENDPOINT`; inspect the generated `gateway.toml` for `[openshell.gateway.otlp]` | -| Sandbox log shows `OTLP agent trace relay inactive: not enabled by the gateway` at startup, then `agent OTLP export attempted but the agent trace relay is not enabled` when the agent exports | The gateway does not enable `[openshell.gateway.otlp.agent]`, so the supervisor refuses the workload's OTLP relay address | Set `enabled = true` in `[openshell.gateway.otlp.agent]` (Helm: `gatewayConfig."openshell.gateway.otlp.agent".enabled`) with an endpoint from that table or `[openshell.gateway.otlp]`, and recreate the sandbox; `openshell logs --source sandbox` then shows `OTLP agent trace relay enabled` | +| Sandbox log shows `OTLP agent trace relay inactive: not enabled by the gateway` at startup, then `agent OTLP export attempted but the agent trace relay is not enabled` when the agent exports | The gateway does not enable `[openshell.gateway.otlp.agent]`, so the supervisor refuses the workload's OTLP relay address | Set `enabled = true` in `[openshell.gateway.otlp.agent]` (Helm: `gatewayConfig."openshell.gateway.otlp.agent".enabled`) with an endpoint from that table or `[openshell.gateway.otlp]`, and recreate the sandbox; `os logs --source sandbox` then shows `OTLP agent trace relay enabled` | | Gateway starts but sandbox create fails | Compute driver cannot reach runtime | Docker/Podman/Kubernetes/VM driver logs | | Docker or Podman sandbox never registers | Wrong gateway endpoint, unavailable host networking, or supervisor startup failure | Gateway logs and supervisor container logs | | CPU-only VM startup reports that read-only `/proc` cannot be removed | Older supervisors can infer GPU requirements from host devices | Check gateway, VM driver, and bundled supervisor versions; use matching updated artifacts. CPU-only VMs do not require read-write `/proc`. | @@ -1754,12 +1754,12 @@ credential failures. | OpenShift self-hosted Vault/OpenBao credential store pod never schedules (waits time out with `no matching resources found`) | The store's Helm chart pins `runAsUser`/`fsGroup`/seccomp, which restricted-v2 rejects, so the StatefulSet controller never creates the pod | Deploy the store's chart in its OpenShift mode (`--set global.openshift=true` for the OpenBao/Vault chart) so the namespace SCC assigns a compliant security context — no manual SCC grant needed | | Vault credential driver returns HTTP 403 / `Vault Kubernetes auth denied the configured role` on provider create | Vault's `auth/kubernetes` method or the gateway login role is not provisioned, or the role is not bound to the gateway service account and namespace | In Vault: `bao auth enable kubernetes` and `bao write auth/kubernetes/config kubernetes_host=... kubernetes_ca_cert=@...`; ensure the login role's `bound_service_account_names`/`bound_service_account_namespaces` match the gateway SA and namespace and its policy grants the credential paths | | CLI TLS error | Local mTLS bundle does not match server cert/CA | Check `~/.config/openshell/gateways//mtls/` | -| Edge or OIDC gateway returns `Unauthenticated` | Stored login expired, audience/scopes mismatch, or gateway auth configuration changed | `openshell gateway info`, `openshell gateway login `, gateway auth logs | +| Edge or OIDC gateway returns `Unauthenticated` | Stored login expired, audience/scopes mismatch, or gateway auth configuration changed | `os gateway info`, `os gateway login `, gateway auth logs | | Gateway exits during OIDC initialization | Issuer is not HTTPS, discovery redirected, metadata used a non-JSON media type or exceeded its size limit, the configured `ca_bundle` is missing, invalid, non-regular, or larger than 1 MiB, or `jwks_uri` uses an untrusted origin | Use an HTTPS issuer; mount a private CA with `server.oidc.caConfigMapName` and confirm `[openshell.gateway.oidc] ca_bundle` names the mounted regular-file `ca.crt` and is no larger than 1 MiB; keep JWKS on the issuer origin or explicitly add its HTTPS origin to `server.oidc.jwksAllowedOrigins`. The issuer CA augments platform roots for OIDC only. Numeric-loopback HTTP is development-only and also requires `server.oidc.dangerouslyAllowInsecureHttp=true` | | Gateway fails before serving health after enabling an interceptor | Interceptor endpoint unavailable or manifest/binding validation failed | Gateway and interceptor logs; interceptor socket; `binding_policy`, phases, and failure policy | | Authenticated interceptor or middleware rejects gateway calls | Private CA or hostname mismatch, expected audience or issuer mismatch, stale/unknown `kid`, or malformed extension token | `tls_ca_cert_path`, registration `audience`, service verifier config and logs; fetch well-known metadata only through the already-trusted gateway TLS endpoint | | Provider profiles disappear after enabling an interceptor catalog | `provider_profile_sources` selected only an authoritative interceptor or returned invalid/duplicate IDs | Inspect source list and interceptor `Describe`/catalog logs; include `user` when composition with imported profiles is intended | -| `provider list-profiles` is empty on a new gateway | Profiles are import-only and nothing has been imported | Import with `openshell provider profile import --from providers --global`; an empty catalog is a valid ready state, not a failure | +| `provider list-profiles` is empty on a new gateway | Profiles are import-only and nothing has been imported | Import with `os provider profile import --from providers --global`; an empty catalog is a valid ready state, not a failure | | Sandbox create or provider attach fails naming a missing profile | The provider's profile was never imported, was deleted, or lives at another scope | Import it at the scope the provider uses; the error names the profile ID and the command | | Gateway fails after registering supervisor middleware | Service unavailable, invalid manifest, duplicate binding, reserved name, invalid payload/timeout limit, or an HTTP hooks capability that is supported but not required | Middleware service and gateway logs; `[[openshell.supervisor.middleware]]`; `Describe` response | | Policy update rejects `network_middlewares` | Unknown middleware name, implementation-owned config invalid, duplicate order, broad/invalid host selector, `fail_open` on an HTTP hook service, overlapping selectors with different HTTP hook versions, or fail-closed coverage of `tls: skip` | Policy error, gateway logs, middleware `ValidateConfig`, selector, order, and `on_error` fields | @@ -1772,9 +1772,9 @@ credential failures. | Image pull failure | Gateway or sandbox image cannot be pulled | Runtime events and image pull credentials | | Gateway API resources fail with `the server could not find the requested resource` | Optional Gateway API resources were applied without Gateway API CRDs | Install the standard Gateway API CRDs and selected controller, then enable `grpcRoute` before applying the optional ingress resources | | A custom GatewayClass does not program the chart-created Gateway, or its proxy Service conflicts with the OpenShell Service | The selected controller is unavailable, or the default `grpcRoute.gateway.name` reuses the OpenShell Service name | Check `kubectl get gatewayclass,gateway,grpcroute -A`; set a distinct Gateway name such as `-ingress`. For an existing Gateway, set `gateway.create=false` plus `gateway.name`, `gateway.namespace`, and optional `gateway.sectionName` | -| HTTPS ingress (`grpcRoute.gateway.listener.protocol=HTTPS`) connection resets or TLS handshake hangs | Envoy terminates TLS but the gateway pod still expects TLS, so the plaintext backend hop fails | Set `server.disableTls=true` so Envoy forwards plaintext to the pod; verify the listener `certificateRefs` Secret exists in the release namespace and `openshell status` over `https://` | +| HTTPS ingress (`grpcRoute.gateway.listener.protocol=HTTPS`) connection resets or TLS handshake hangs | Envoy terminates TLS but the gateway pod still expects TLS, so the plaintext backend hop fails | Set `server.disableTls=true` so Envoy forwards plaintext to the pod; verify the listener `certificateRefs` Secret exists in the release namespace and `os status` over `https://` | | With `grpcRoute.replicaRouting.enabled=true`, sandbox SSH, forward, or exec still relay through a peer replica | A `-replica-` Service has no endpoint, so Envoy returns `Unavailable` and the CLI retries unrouted | `kubectl -n openshell get endpoints -replica-0 -replica-1`; confirm `workload.kind=statefulset` and the GRPCRoute status is `Accepted`/`ResolvedRefs` | -| HTTPS ingress returns `Unauthenticated` after connecting | TLS terminates at Envoy, so the gateway never sees a client cert; no OIDC issuer is configured for identity | Configure `server.oidc.issuer` and register with `openshell gateway add https:// --oidc-issuer `, or set `server.auth.allowUnauthenticatedUsers=true` for a trusted-proxy/dev cluster | +| HTTPS ingress returns `Unauthenticated` after connecting | TLS terminates at Envoy, so the gateway never sees a client cert; no OIDC issuer is configured for identity | Configure `server.oidc.issuer` and register with `os gateway add https:// --oidc-issuer `, or set `server.auth.allowUnauthenticatedUsers=true` for a trusted-proxy/dev cluster | | External server `Certificate` never becomes Ready with `certManager.serverIssuerRef` set | ACME issuer rejected internal-only SANs, a loopback IP, or a `commonName` absent from the SANs | `kubectl -n openshell describe certificate openshell-server-external`; confirm `certManager.serverDnsNames` lists only real, externally-resolvable hostnames | | Sandbox supervisors fail TLS handshake with `UnknownCA` after configuring `certManager.serverIssuerRef` | `server.grpcEndpoint` is set to the external hostname, forcing supervisors to receive the ACME cert (via SNI) which they can't verify against chart CA | Remove `server.grpcEndpoint` or set it to the internal service name; supervisors should connect via internal service name to receive the internal cert | | Browser `ERR_BAD_SSL_CLIENT_AUTH_CERT` or gateway logs show client cert verification when OIDC or direct HTTPS is expected | Listener client-CA verification still enabled (`clientCaSecretName` unset or `client_ca_path` in ConfigMap) | Set `server.tls.clientCaSecretName=""`, upgrade chart, confirm ConfigMap omits `client_ca_path` | diff --git a/skills/debug-openshell-cluster/references/supervisor-middleware.md b/skills/debug-openshell-cluster/references/supervisor-middleware.md index 6039c2ed6d..42f4b3f679 100644 --- a/skills/debug-openshell-cluster/references/supervisor-middleware.md +++ b/skills/debug-openshell-cluster/references/supervisor-middleware.md @@ -15,7 +15,7 @@ For operator-run supervisor middleware, inspect `[[openshell.supervisor.middlewa rg -n 'supervisor|middleware|grpc_endpoint|tls_ca_cert_path|audience|allow_insecure_transport|binding_policy|bindings|max_payload_bytes|timeout|gateway_jwt' /etc/openshell/gateway.toml journalctl -u --no-pager --lines=200 journalctl -u openshell-gateway --no-pager --lines=200 -openshell logs --tail --source sandbox +os logs --tail --source sandbox ``` ## Startup and authentication diff --git a/skills/generate-sandbox-policy/SKILL.md b/skills/generate-sandbox-policy/SKILL.md index c36b244f71..162e8f5f24 100644 --- a/skills/generate-sandbox-policy/SKILL.md +++ b/skills/generate-sandbox-policy/SKILL.md @@ -392,7 +392,7 @@ If the user needs access to multiple hosts or the same host with different rules ## Step 6: Validate and Warn -Before presenting the policy to the user, run `openshell policy lint policy.yaml` +Before presenting the policy to the user, run `os policy lint policy.yaml` to validate the authored file offline, then flag breadth concerns. Provider attachments, external middleware registrations, images and drivers still need gateway checks. @@ -535,7 +535,7 @@ Docker and Podman, each omitted identity field falls back to the image's OCI `USER`. Tell the user these are defaults and may need adjustment for their environment. Inference access uses provider profiles and sandbox attachments; the workload calls the provider's native endpoint and selects its model and -timeout. Inspect the effective policy with `openshell policy get +timeout. Inspect the effective policy with `os policy get --full`, including provider-derived rules, and follow the published [inference guide](https://docs.nvidia.com/openshell/latest/how-it-works/inference). The generated `network_policies` block is the primary output. @@ -548,7 +548,7 @@ to the same ID on image files, mounted volumes, or devices. For MicroVM, numeric selectors must match the resolved owner of the sandbox's writable overlay. User and group are checked independently; either mismatch prevents startup. If the owner UID:GID is unknown, omit the selectors or use `sandbox` so the driver retains that identity. Do not choose another numeric identity or suggest that the policy can change an existing overlay's owner. For example, with an owner of `1000:1000`, a request for UID `10000` must be rejected with an explanation and the omission/`sandbox` alternatives, rather than generating a policy that the VM cannot start. -If the user provides a file path, write to it. Otherwise, ask where to place it. A common convention is a project-local policy file (e.g., `sandbox-policy.yaml`) passed to `openshell sandbox create --policy ` or set via the `OPENSHELL_SANDBOX_POLICY` env var. +If the user provides a file path, write to it. Otherwise, ask where to place it. A common convention is a project-local policy file (e.g., `sandbox-policy.yaml`) passed to `os sandbox create --policy ` or set via the `OPENSHELL_SANDBOX_POLICY` env var. ### Mode C: Present Only (no file write) @@ -557,7 +557,7 @@ Show the generated policy YAML with: 1. **Summary** — what the policy allows and denies, in plain language 2. **The YAML** — the complete `network_policies` block, ready to paste 3. **Integration guidance**: - - Save to a local file and pass via `openshell sandbox create --policy ` or set `OPENSHELL_SANDBOX_POLICY=` + - Save to a local file and pass via `os sandbox create --policy ` or set `OPENSHELL_SANDBOX_POLICY=` - For production: configure via the gateway 4. **Caveats** — any assumptions made, anything the user should verify diff --git a/skills/openshell-cli/SKILL.md b/skills/openshell-cli/SKILL.md index c89ba151ea..f6bbf5c4d5 100644 --- a/skills/openshell-cli/SKILL.md +++ b/skills/openshell-cli/SKILL.md @@ -5,18 +5,18 @@ description: Guide agents through using the OpenShell CLI (openshell) for sandbo # OpenShell CLI -Guide agents through using the `openshell` CLI for sandbox and platform management -- from basic operations to advanced multi-step workflows. +Guide agents through using the `os` CLI for sandbox and platform management -- from basic operations to advanced multi-step workflows. ## Overview -The OpenShell CLI (`openshell`) is the primary interface for managing sandboxes, providers, policies, settings, exposed services, and gateway registrations. Gateway service lifecycle is handled outside the CLI by packages, systemd, or Helm. This skill teaches agents how to orchestrate CLI commands for common and complex workflows. +The OpenShell CLI (`os`) is the primary interface for managing sandboxes, providers, policies, settings, exposed services, and gateway registrations. Gateway service lifecycle is handled outside the CLI by packages, systemd, or Helm. This skill teaches agents how to orchestrate CLI commands for common and complex workflows. **Companion skill**: For creating or modifying sandbox policy YAML content (network rules, L7 inspection, access presets), use the `generate-sandbox-policy` skill. This skill covers the CLI *commands* for the policy lifecycle; `generate-sandbox-policy` covers policy *content authoring*. **Self-teaching**: The CLI has comprehensive built-in help. When you encounter a command or option not covered in this skill, walk the help tree: ```bash -openshell --help # Top-level commands +os --help # Top-level commands openshell --help # Subcommands in a group openshell --help # Flags for a specific command ``` @@ -25,14 +25,14 @@ This is your primary fallback. Use it freely -- the CLI's help output is authori ## Prerequisites -- `openshell` is on the PATH. Follow the published [installation guide](https://docs.nvidia.com/openshell/latest/about/installation.md) when it is not installed. +- `os` is on the PATH. Releases before the rename name it `openshell`. Follow the published [installation guide](https://docs.nvidia.com/openshell/latest/about/installation.md) when it is not installed. - A reachable OpenShell gateway backed by Docker, Podman, Kubernetes, or the experimental VM driver - Docker is running only when using BYOC local builds or a Docker-backed gateway - For Kubernetes deployments: `kubectl` and Helm access to the target cluster ## Authoritative References -Use `openshell --help` and nested `--help` output as the authority for the installed CLI version. Use the published documentation for product concepts and supported workflows: +Use `os --help` and nested `--help` output as the authority for the installed CLI version. Use the published documentation for product concepts and supported workflows: - [Manage gateways](https://docs.nvidia.com/openshell/latest/how-it-works/gateways/overview) - [Manage sandboxes](https://docs.nvidia.com/openshell/latest/how-it-works/sandboxes/overview) @@ -50,22 +50,22 @@ Use this workflow when the user has a gateway endpoint and wants to get a sandbo ### Step 1: Register a gateway ```bash -openshell gateway add http://127.0.0.1:8080 --local --name local +os gateway add http://127.0.0.1:8080 --local --name local ``` -Use an `http://` endpoint only for trusted local port-forwarding or a protected private path. For a gateway behind an authenticated reverse proxy, register its HTTPS endpoint with `openshell gateway add https://gateway.example.com`. +Use an `http://` endpoint only for trusted local port-forwarding or a protected private path. For a gateway behind an authenticated reverse proxy, register its HTTPS endpoint with `os gateway add https://gateway.example.com`. ### Step 2: Verify the gateway ```bash -openshell status -openshell whoami +os status +os whoami ``` Confirm the gateway is reachable, authentication is valid or not required, and the output shows a version. `Status: Connected` only proves the public health endpoint is reachable; inspect the separate `Authentication` line before -running protected commands. `openshell whoami` reports the identity validated +running protected commands. `os whoami` reports the identity validated by the gateway, including the subject an administrator uses for workspace membership. Add `--output json` for automation. @@ -74,7 +74,7 @@ membership. Add `--output json` for automation. The simplest way to get a sandbox running: ```bash -openshell sandbox create +os sandbox create ``` This creates a sandbox whose canonical main process is `/bin/bash -l` and @@ -108,8 +108,8 @@ exist but a profile with that ID is available, the CLI can create it from local credentials: ```bash -openshell sandbox create --from registry.example.com/your-org/claude-agent:latest --provider claude-code -- claude -openshell sandbox create --from registry.example.com/your-org/codex-agent:latest --provider codex -- codex +os sandbox create --from registry.example.com/your-org/claude-agent:latest --provider claude-code -- claude +os sandbox create --from registry.example.com/your-org/codex-agent:latest --provider codex -- codex ``` The agent will be prompted interactively if credentials are missing. @@ -119,7 +119,7 @@ The agent will be prompted interactively if credentials are missing. Exit the sandbox shell with `exit`, or detach with Ctrl-D, then: ```bash -openshell sandbox delete +os sandbox delete ``` --- @@ -129,14 +129,14 @@ openshell sandbox delete Providers supply credentials and provider-specific configuration to sandboxes. Provider profiles are import-only: a gateway serves exactly what an operator imported, and a new gateway serves an empty catalog. Never rely on a hard-coded type list or on a legacy alias such as `gh` or `claude` — `--type` matches a profile ID exactly. Discover the profiles available on the selected gateway: ```shell -openshell profile list -openshell profile list --type provider --output json +os profile list +os profile list --type provider --output json ``` ### Create a provider from local credentials ```bash -openshell provider create --name my-github --type github --from-existing +os provider create --name my-github --type github --from-existing ``` The `--from-existing` flag discovers credentials from local state (e.g., `gh auth` tokens, Claude config files). @@ -144,7 +144,7 @@ The `--from-existing` flag discovers credentials from local state (e.g., `gh aut ### Create a provider with explicit credentials ```bash -openshell provider create --name my-openai --type openai \ +os provider create --name my-openai --type openai \ --credential OPENAI_API_KEY ``` @@ -193,10 +193,10 @@ flags. Labels work with each credential source. List selectors require every comma-separated key-value pair to match and apply before pagination. ```shell -openshell provider create --name public-pypi --type pypi --label env=dev --label team=ml -openshell provider list --label-selector env=dev,team=ml -openshell provider list --all-workspaces --label-selector team=ml --output json -openshell provider get public-pypi +os provider create --name public-pypi --type pypi --label env=dev --label team=ml +os provider list --label-selector env=dev,team=ml +os provider list --all-workspaces --label-selector team=ml --output json +os provider get public-pypi ``` Use an imported profile, such as `pypi` in this example. `get` displays labels; @@ -207,12 +207,12 @@ Admin access. Preserve the selector and workspace scope when passing the next ### Inspect and manage provider profiles ```shell -openshell profile describe github -openshell profile export github --output yaml -openshell profile lint --file ./my-profile.yaml -openshell profile import --file ./my-profile.yaml -openshell profile lint --url https://example.com/profiles/my-profile.yaml -openshell profile import --url https://example.com/profiles/my-profile.yaml +os profile describe github +os profile export github --output yaml +os profile lint --file ./my-profile.yaml +os profile import --file ./my-profile.yaml +os profile lint --url https://example.com/profiles/my-profile.yaml +os profile import --url https://example.com/profiles/my-profile.yaml ``` `--url` accepts one HTTP or HTTPS YAML or JSON profile. Review its endpoint and @@ -225,16 +225,16 @@ Existing scripts can continue using `provider list-profiles` and `provider profi ### List, inspect, update, delete -Use `openshell sandbox provider status --help` and the attach, detach, and update help to find the installed version's wait options. Add `--wait` when the next step depends on a provider change taking effect. Without it, a successful command only confirms that the gateway saved the change. Save the returned `receipt_id` to check that same change later, and inspect the result for every selected sandbox. Credential refresh status confirms that OpenShell obtained credentials; provider status confirms that the sandbox applied them, activated the policy, and updated the environment for new processes. If the status is `superseded`, explain that a later change replaced the request and inspect that change separately. +Use `os sandbox provider status --help` and the attach, detach, and update help to find the installed version's wait options. Add `--wait` when the next step depends on a provider change taking effect. Without it, a successful command only confirms that the gateway saved the change. Save the returned `receipt_id` to check that same change later, and inspect the result for every selected sandbox. Credential refresh status confirms that OpenShell obtained credentials; provider status confirms that the sandbox applied them, activated the policy, and updated the environment for new processes. If the status is `superseded`, explain that a later change replaced the request and inspect that change separately. If attach, detach, or update reports `CONFIG_OPERATION_STORAGE_UNCERTAIN`, explain that the change may already be saved and its readiness receipt may be unavailable. Do not blindly retry the mutation. Inspect the provider and sandbox state and reconcile the saved change before deciding on another mutation; the error proves neither rollback nor readiness. ```bash -openshell provider list -openshell provider list --output json -openshell provider get my-github -openshell provider update my-github --from-existing -openshell provider delete my-github +os provider list +os provider list --output json +os provider get my-github +os provider update my-github --from-existing +os provider delete my-github ``` `provider update` does not take `--type`. It updates credentials, config, or credential expiry on the existing provider. @@ -246,18 +246,18 @@ For an external updater whose workload must retain its original environment refe Use refresh commands only when the provider profile and gateway support refreshable credentials: ```bash -openshell provider refresh status my-provider -openshell provider refresh configure my-provider \ +os provider refresh status my-provider +os provider refresh configure my-provider \ --credential-key MS_GRAPH_ACCESS_TOKEN \ --strategy oauth2-refresh-token \ --secret-material-env REFRESH_TOKEN=MS_GRAPH_REFRESH_TOKEN \ --credential-expires-at 2026-07-16T00:00:00Z -openshell provider refresh rotate my-provider --credential-key ACCESS_TOKEN +os provider refresh rotate my-provider --credential-key ACCESS_TOKEN ``` Prefer `--secret-material-env KEY[=ENVVAR]` for secret refresh material. `--material KEY=VALUE` is for non-secret material; `--secret-material-key` marks supplied material keys as secret. -When many providers share one OAuth client secret, store it once as a workspace secret and reference it with `--material-secret client_secret=NAME`. Rotating it with `openshell secret update` reaches every referencing provider at its next refresh. A secret only reaches the token endpoints it was created with (`--allowed-endpoint`); one created without them is reveal-only and cannot be referenced. and `openshell secret delete` fails while a refresh references it; run `openshell provider refresh inline-secrets` to copy the value into the provider first. The gateway operator must set `enable_workspace_secrets`. See `openshell secret --help`. +When many providers share one OAuth client secret, store it once as a workspace secret and reference it with `--material-secret client_secret=NAME`. Rotating it with `os secret update` reaches every referencing provider at its next refresh. A secret only reaches the token endpoints it was created with (`--allowed-endpoint`); one created without them is reveal-only and cannot be referenced. and `os secret delete` fails while a refresh references it; run `os provider refresh inline-secrets` to copy the value into the provider first. The gateway operator must set `enable_workspace_secrets`. See `os secret --help`. For GitHub App installations, check installed refresh help for `github-app-installation` and read the @@ -336,7 +336,7 @@ workload handles, so restart processes holding them. ### Create with options ```bash -openshell sandbox create \ +os sandbox create \ --name my-sandbox \ --provider my-github \ --provider my-claude \ @@ -391,14 +391,14 @@ 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 \ +os sandbox template create gpu-kata \ --image registry.example.com/agents/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 +os sandbox create --name my-sandbox --template gpu-kata --provider my-github -- claude ``` Driver config is disabled by default. These template and one-off @@ -414,18 +414,18 @@ denial. Put driver config on a template only when it should be reused. ### Manage sandbox workload templates ```bash -openshell sandbox template create gpu-kata \ +os sandbox template create gpu-kata \ --image registry.example.com/agents/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 +os sandbox template list +os sandbox template list --label-selector team=runtime +os sandbox template list --all-workspaces --output json +os sandbox template get gpu-kata +os sandbox template delete gpu-kata ``` Template `--image` accepts an OCI image reference. If omitted, the gateway @@ -436,9 +436,9 @@ the initial command stay on `sandbox create`. ### List and inspect sandboxes ```bash -openshell sandbox list -openshell sandbox list --selector team=agents --output json -openshell sandbox get my-sandbox +os sandbox list +os sandbox list --selector team=agents --output json +os sandbox get my-sandbox ``` Most commands with an optional sandbox name use the last-used sandbox. Pass an explicit name in automation. @@ -446,8 +446,8 @@ Most commands with an optional sandbox name use the last-used sandbox. Pass an e ### Connect to a running sandbox ```bash -openshell sandbox connect my-sandbox -openshell sandbox connect my-sandbox --editor vscode +os sandbox connect my-sandbox +os sandbox connect my-sandbox --editor vscode ``` Attaches to the sandbox's existing canonical main process. Disconnecting leaves @@ -464,7 +464,7 @@ attachment, `Ctrl-C` or `Ctrl-D` exits the viewer and leaves main and other attachments running. Configure VS Code Remote-SSH with: ```bash -openshell sandbox ssh-config my-sandbox >> ~/.ssh/config +os sandbox ssh-config my-sandbox >> ~/.ssh/config ``` A writable attachment that finds another attachment holding stdin reports `attached read-only; retry input after the owner disconnects`. Automatic recovery can hit this when it reattaches before the supervisor closes the dead connection. The supervisor closes a connection 60 seconds after it last received bytes from it, which can be later than 60 seconds after the network failed if the relay buffered data. After the old owner disconnects or times out, send the input you meant to type next. If stdin is free, the attachment prints `input enabled` and forwards that input to the process, so do not probe with Enter or a prompt answer such as `y`. If nothing prints, the old connection still holds stdin. Input sent while the attachment was read-only never reaches the process, so send it again later. `Ctrl-C`, `Ctrl-D`, and `Ctrl-P` then `Ctrl-Q` still exit a read-only attachment instead of enabling input; enable input first if you need `Ctrl-C` to interrupt the process. Recovery never takes stdin from a healthy owner, and an explicitly read-only attachment stays read-only. @@ -482,10 +482,10 @@ An explicit `sandbox stop` cancels a pending restart. ```bash # Upload local files to the sandbox working directory -openshell sandbox upload my-sandbox ./src +os sandbox upload my-sandbox ./src # Download a path relative to the sandbox working directory -openshell sandbox download my-sandbox output ./local-output +os sandbox download my-sandbox output ./local-output ``` Uploads use bounded streaming and wait for sandbox input consumption; the 4 MiB process-input budget is not a total upload-size limit. Upgrade both the CLI and the supervisor runtime used by the sandbox. An older supervisor rejects the upload protocol before file data is sent. Failed or canceled uploads may leave incomplete files in the destination; check it before retrying or remove the partial files. @@ -505,8 +505,8 @@ within it. ### Execute a non-interactive command ```bash -openshell sandbox exec my-sandbox --workdir /workspace -- ls -la -openshell sandbox exec --name my-sandbox --env MODE=test -- cargo test +os sandbox exec my-sandbox --workdir /workspace -- ls -la +os sandbox exec --name my-sandbox --env MODE=test -- cargo test ``` The sandbox is a positional name or `--name`, not both; omit it to use the @@ -526,11 +526,11 @@ provider instead of passing API keys, tokens, or other secrets to `sandbox exec` ### Change attached providers ```bash -openshell sandbox provider list my-sandbox -openshell sandbox provider list my-sandbox --output json -openshell sandbox provider attach my-sandbox my-github --wait --timeout 30 -openshell sandbox provider status my-sandbox my-github --output json -openshell sandbox provider detach my-sandbox my-github --wait --timeout 30 +os sandbox provider list my-sandbox +os sandbox provider list my-sandbox --output json +os sandbox provider attach my-sandbox my-github --wait --timeout 30 +os sandbox provider status my-sandbox my-github --output json +os sandbox provider detach my-sandbox my-github --wait --timeout 30 ``` Structured attachment output contains provider names, types, and sorted @@ -541,24 +541,24 @@ config values. ```bash # Recent logs -openshell logs my-sandbox +os logs my-sandbox # Stream live logs -openshell logs my-sandbox --tail +os logs my-sandbox --tail # Filter by source and level -openshell logs my-sandbox --tail --source sandbox --level warn +os logs my-sandbox --tail --source sandbox --level warn # Logs from the last 5 minutes -openshell logs my-sandbox --since 5m +os logs my-sandbox --since 5m ``` ### Delete sandboxes ```bash -openshell sandbox delete my-sandbox -openshell sandbox delete sandbox-1 sandbox-2 sandbox-3 # Multiple at once -openshell sandbox delete --all +os sandbox delete my-sandbox +os sandbox delete sandbox-1 sandbox-2 sandbox-3 # Multiple at once +os sandbox delete --all ``` `deletion accepted` means cleanup is still pending. Inspect the sandbox until @@ -572,8 +572,8 @@ Use stop to halt compute while retaining the sandbox and its persistent workspace: ```bash -openshell sandbox stop [name] -openshell sandbox start [name] +os sandbox stop [name] +os sandbox start [name] ``` Both commands default to the last-used sandbox. Stop stops background @@ -613,8 +613,8 @@ On a gateway whose compute driver and isolation backend support it, suspend freezes a `Ready` sandbox and retains its memory state: ```bash -openshell sandbox suspend [name] -openshell sandbox resume [name] +os sandbox suspend [name] +os sandbox resume [name] ``` Suspend waits for `Suspended`, then stops background forwards. A rejected @@ -686,7 +686,7 @@ This is the most important multi-step workflow. It enables a tight feedback cycl **Key concept**: Policies have static fields (immutable after activation: `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. -If startup reports `ConfigurationInvalid`, inspect `openshell sandbox get` and +If startup reports `ConfigurationInvalid`, inspect `os sandbox get` and repair the complete policy or provider set through the gateway. The workload has not started on its first activation, so static fields can also be replaced during this initial repair. A previously activated sandbox retains static-field @@ -728,14 +728,14 @@ Create sandbox with initial policy Verify reload succeeded ─────────┘ ``` -Validate an authored policy offline with `openshell policy lint policy.yaml` +Validate an authored policy offline with `os policy lint policy.yaml` before creating or updating a sandbox. Gateway-dependent provider, middleware registration, image and driver checks are deferred until application. ### Step 1: Create sandbox with initial policy ```bash -openshell sandbox create --name dev --from registry.example.com/your-org/claude-agent:latest --policy ./initial-policy.yaml -- claude +os sandbox create --name dev --from registry.example.com/your-org/claude-agent:latest --policy ./initial-policy.yaml -- claude ``` Sandboxes stay alive by default for iteration. Add `--no-keep` only when the sandbox should be deleted automatically after the initial session. @@ -745,7 +745,7 @@ Sandboxes stay alive by default for iteration. Add `--no-keep` only when the san In a separate terminal or as the agent: ```bash -openshell logs dev --tail --source sandbox +os logs dev --tail --source sandbox ``` Look for `DENIED` log lines. `NET:OPEN [MED] DENIED` marks a blocked connection, and `HTTP: [MED] DENIED` marks a blocked request. Policy events are INFO-level log records, so do not add `--level warn`. The logs include: @@ -758,7 +758,7 @@ Look for `DENIED` log lines. `NET:OPEN [MED] DENIED` marks a blocked connection, ```bash set -o pipefail -openshell policy get dev --base | sed '1,/^---$/d' > current-policy.yaml +os policy get dev --base | sed '1,/^---$/d' > current-policy.yaml ``` `--base` returns the editable policy without provider-composed entries; OpenShell composes attached provider rules separately. The command prints revision details, a `---` line, and then the policy YAML. The `sed` expression keeps only the YAML, because `policy set` cannot parse the revision details. Use `--full` only to inspect the effective policy, not as input to `policy set`. @@ -786,7 +786,7 @@ and `debug-openshell-cluster` to investigate middleware failures. ### Step 5: Push the updated policy ```bash -openshell policy set dev --policy current-policy.yaml --wait +os policy set dev --policy current-policy.yaml --wait ``` The gateway validates the complete effective candidate—including attached @@ -808,7 +808,7 @@ The `--wait` flag blocks until the sandbox confirms the policy is loaded (polls ### Step 6: Verify the update ```bash -openshell policy list dev +os policy list dev ``` Check that the latest revision shows status `loaded`. If `failed`, check the error column for details. @@ -822,23 +822,23 @@ Return to Step 2. Continue monitoring logs and refining the policy until all req View all revisions to understand how the policy evolved: ```bash -openshell policy list dev --page-size 50 -openshell policy list dev --output json +os policy list dev --page-size 50 +os policy list dev --output json ``` Fetch a specific historical revision: ```bash -openshell policy get dev --rev 3 --full +os policy get dev --rev 3 --full ``` Gateway-global policy commands use `--global` and require confirmation unless `--yes` is supplied: ```bash -openshell policy get --global --full -openshell policy set --global --policy ./global-policy.yaml -openshell policy list --global -openshell policy delete --global +os policy get --global --full +os policy set --global --policy ./global-policy.yaml +os policy list --global +os policy delete --global ``` Avoid `--yes` during interactive work. A global policy locks policy control for all sandboxes on the gateway. @@ -848,10 +848,10 @@ Avoid `--yes` during interactive work. A global policy locks policy control for Sandboxes created with `--approval-mode manual` place every proposal in the review inbox. `auto` approves only valid effective-policy candidates with an empty prover delta; findings still require review. The CLI binds approval to the candidate's current review token. If live policy, provider, or credential inputs change, approval leaves the chunk pending with a refreshed candidate and requires a fresh review. ```bash -openshell rule get dev --status pending -openshell rule approve dev --chunk-id -openshell rule reject dev --chunk-id --reason "too broad" -openshell rule history dev +os rule get dev --status pending +os rule approve dev --chunk-id +os rule reject dev --chunk-id --reason "too broad" +os rule history dev ``` Review the proposed scope, candidate hash, prover findings, and application errors before approval. Treat `rule approve-all --include-security-flagged` as a high-risk bulk action. @@ -868,7 +868,7 @@ Build a custom container image and run it as a sandbox. ```bash docker build -t my-app:latest . -openshell sandbox create --from my-app:latest --name my-app +os sandbox create --from my-app:latest --name my-app ``` The `--from` flag accepts an explicit OCI image reference such as `myregistry.com/img:tag`. It does not expand catalog aliases. Build local Dockerfiles first with the same container engine as the local gateway, then pass the image tag. @@ -887,10 +887,10 @@ files, mounted volumes, or devices. ```bash # Foreground (blocks) -openshell forward start 8080 my-app +os forward start 8080 my-app # Background (returns immediately) -openshell forward start 8080 my-app -d +os forward start 8080 my-app -d ``` The service is now reachable at `localhost:8080`. @@ -901,17 +901,17 @@ managed by `forward stop`; foreground forwards end when the command exits. Manage or iterate on the sandbox: ```bash -openshell forward list -openshell forward stop 8080 my-app -openshell sandbox delete my-app -openshell sandbox create --from my-app:latest --name my-app --forward 8080 +os forward list +os forward stop 8080 my-app +os sandbox delete my-app +os sandbox create --from my-app:latest --name my-app --forward 8080 ``` Use structured output when automation needs the tracked forward metadata and validated process state: ```bash -openshell forward list --output json +os forward list --output json ``` Each record includes `workspace`, `sandbox`, `bind_address`, `port`, `pid`, and @@ -921,7 +921,7 @@ process identity; it does not probe the forwarded socket. Create and forward in one command: ```bash -openshell sandbox create --from my-app:latest --forward 8080 -- ./start-server.sh +os sandbox create --from my-app:latest --forward 8080 -- ./start-server.sh ``` The `--forward` flag starts a background port forward before the command runs. @@ -933,7 +933,7 @@ Support a human working in a sandbox while an agent monitors activity and refine Create the sandbox and keep it alive: ```bash -openshell sandbox create \ +os sandbox create \ --name work-session \ --provider github \ --provider claude \ @@ -943,21 +943,21 @@ openshell sandbox create \ Tell the user to connect in another shell: ```bash -openshell sandbox connect work-session -openshell sandbox connect work-session --editor vscode +os sandbox connect work-session +os sandbox connect work-session --editor vscode ``` Monitor denied activity: ```bash -openshell logs work-session --tail --source sandbox +os logs work-session --tail --source sandbox ``` When denied actions appear: 1. Prefer incremental updates for additive network changes: - `openshell policy update work-session --add-endpoint api.github.com:443:read-only:rest:enforce --binary /usr/bin/gh --wait` - `openshell policy update work-session --rule-name allow_api_github_com_443 --binary /usr/bin/gh --add-allow 'api.github.com:443:POST:/repos/*/issues' --wait` + `os policy update work-session --add-endpoint api.github.com:443:read-only:rest:enforce --binary /usr/bin/gh --wait` + `os policy update work-session --rule-name allow_api_github_com_443 --binary /usr/bin/gh --add-allow 'api.github.com:443:POST:/repos/*/issues' --wait` A rule authorizes every binary it lists to reach every endpoint it lists, so an update that adds a binary or an endpoint to an existing rule must declare @@ -973,15 +973,15 @@ When denied actions appear: `policy update` cannot express, including any change that would otherwise require restating a large existing scope. Filesystem, Landlock, and process changes still require recreating the sandbox: - `openshell policy get work-session --base | sed '1,/^---$/d' > policy.yaml` + `os policy get work-session --base | sed '1,/^---$/d' > policy.yaml` Modify the policy with the `generate-sandbox-policy` skill. - `openshell policy set work-session --policy policy.yaml --wait` -3. Verify with `openshell policy list work-session`. + `os policy set work-session --policy policy.yaml --wait` +3. Verify with `os policy list work-session`. The user does not need to disconnect. Policy updates are hot-reloaded; `--wait` blocks until the sandbox confirms the revision or the timeout expires. Delete the sandbox when the session ends: ```bash -openshell sandbox delete work-session +os sandbox delete work-session ``` ## Workflow 7: Inference with Attached Providers @@ -991,10 +991,10 @@ services. Import or select a profile that authorizes the provider's native endpoint, create the provider, and attach it only to sandboxes that need it: ```bash -openshell provider profile import -f ./inference-provider.yaml -openshell provider create --name model-provider --type --credential -openshell sandbox provider attach work-session model-provider --wait --timeout 30 -openshell sandbox exec work-session -- +os provider profile import -f ./inference-provider.yaml +os provider create --name model-provider --type --credential +os sandbox provider attach work-session model-provider --wait --timeout 30 +os sandbox exec work-session -- ``` The application owns the native base URL, model, request shape, and timeout. @@ -1012,24 +1012,24 @@ revokes retained references and removes them from future process environments. List, switch, and verify gateways: ```bash -openshell gateway select -openshell gateway list --output json -openshell gateway select production -openshell gateway info --name production -openshell status +os gateway select +os gateway list --output json +os gateway select production +os gateway info --name production +os status ``` -`openshell gateway info` reports the immutable startup snapshot for compute drivers, credential drivers, gateway interceptors, and supervisor middleware. Use each entry's protocol version, implementation version, supported capabilities, and gateway requirements when diagnosing extension skew; implementation versions do not identify underlying Docker, Kubernetes, or credential backends. +`os gateway info` reports the immutable startup snapshot for compute drivers, credential drivers, gateway interceptors, and supervisor middleware. Use each entry's protocol version, implementation version, supported capabilities, and gateway requirements when diagnosing extension skew; implementation versions do not identify underlying Docker, Kubernetes, or credential backends. Register or remove gateways: ```bash -openshell gateway add http://127.0.0.1:8080 --local --name local -openshell gateway add https://gateway.example.com --name production -openshell gateway remove local +os gateway add http://127.0.0.1:8080 --local --name local +os gateway add https://gateway.example.com --name production +os gateway remove local ``` -`https://` registrations default to edge authentication. Use `gateway login` and `gateway logout` to refresh or clear stored authentication. For an OIDC gateway, supply `--oidc-issuer` and, when needed, `--oidc-client-id`, `--oidc-audience`, and `--oidc-scopes`. If automatic OIDC refresh fails, protected commands stop before sending an RPC and direct the user to run `openshell gateway login `; `openshell status` still reports gateway reachability and authentication separately. For remote mTLS gateways, use `--remote USER@HOST` or an `ssh://` endpoint. +`https://` registrations default to edge authentication. Use `gateway login` and `gateway logout` to refresh or clear stored authentication. For an OIDC gateway, supply `--oidc-issuer` and, when needed, `--oidc-client-id`, `--oidc-audience`, and `--oidc-scopes`. If automatic OIDC refresh fails, protected commands stop before sending an RPC and direct the user to run `os gateway login `; `os status` still reports gateway reachability and authentication separately. For remote mTLS gateways, use `--remote USER@HOST` or an `ssh://` endpoint. For one-off automation, `--gateway-endpoint URL` connects directly without stored metadata. Limit `--gateway-insecure` to explicitly trusted development endpoints. @@ -1049,20 +1049,20 @@ For Docker, Podman, and VM-backed gateways, inspect the gateway process or conta Manage sandbox-scoped or gateway-global settings: ```bash -openshell settings get work-session -openshell settings set work-session --key ocsf_json_enabled --value true -openshell settings delete work-session --key ocsf_json_enabled +os settings get work-session +os settings set work-session --key ocsf_json_enabled --value true +os settings delete work-session --key ocsf_json_enabled -openshell settings get --global --json -openshell settings set --global --key ocsf_json_enabled --value true +os settings get --global --json +os settings set --global --key ocsf_json_enabled --value true ``` -Enabling `ocsf_json_enabled` adds compact `OCSF-JSON` records to the supervisor's stderr, alongside shorthand, and to its JSONL file when file storage is available. Collect these records through the supervisor's platform logs (`docker logs`, `podman logs`, or `kubectl logs`); `openshell logs` still serves shorthand. Match the `OCSF-JSON` marker after the timestamp and parse the remainder as JSON. See the published [OCSF JSON export guide](https://docs.nvidia.com/openshell/latest/observability/ocsf-json-export) for delivery and retention limits. +Enabling `ocsf_json_enabled` adds compact `OCSF-JSON` records to the supervisor's stderr, alongside shorthand, and to its JSONL file when file storage is available. Collect these records through the supervisor's platform logs (`docker logs`, `podman logs`, or `kubectl logs`); `os logs` still serves shorthand. Match the `OCSF-JSON` marker after the timestamp and parse the remainder as JSON. See the published [OCSF JSON export guide](https://docs.nvidia.com/openshell/latest/observability/ocsf-json-export) for delivery and retention limits. Global mutations prompt for confirmation. Use `--yes` only in reviewed automation. `policy_validation_failure_mode` is gateway startup configuration, not a -mutable `openshell settings` key. Set it under `[openshell.gateway]` in +mutable `os settings` key. Set it under `[openshell.gateway]` in `gateway.toml` and restart the gateway. The security-first default is `fail_closed`; `retain_last_valid` is an explicit availability tradeoff. OCSF configuration events state whether the previous generation is active after a @@ -1074,13 +1074,13 @@ Use `forward` for local access and `service` for a gateway-managed HTTP endpoint ```bash # SSH-based same-port forwarding; optional bind address is accepted. -openshell forward start 127.0.0.1:8080 my-app -d +os forward start 127.0.0.1:8080 my-app -d # gRPC relay to a loopback TCP service, with an optional dynamic local port. -openshell forward service my-app --target-port 8000 --local 127.0.0.1:0 +os forward service my-app --target-port 8000 --local 127.0.0.1:0 # Create a sandbox with its unnamed HTTP or WebSocket service exposed. -openshell sandbox create \ +os sandbox create \ --name my-app \ --from my-app:latest \ --expose 8080 \ @@ -1089,24 +1089,24 @@ openshell sandbox create \ -- ./start-server.sh # Expose and manage a named HTTP service. -openshell service expose my-app 8080 web \ +os service expose my-app 8080 web \ --authorization-mode bearer-passthrough -openshell service list my-app -openshell service list my-app --output json -openshell service get my-app web -openshell service delete my-app web +os service list my-app +os service list my-app --output json +os service get my-app web +os service delete my-app web # Expose a service that listens for cleartext HTTP/2, such as native gRPC. -openshell service expose my-app 50051 agent --backend-http-version 2 +os service expose my-app 50051 agent --backend-http-version 2 ``` -Use `openshell service list --all-workspaces` for a Platform Admin view across +Use `os service list --all-workspaces` for a Platform Admin view across workspaces. A sandbox name and `--all-workspaces` are mutually exclusive. `sandbox create --expose PORT` registers the unnamed endpoint in the create request and keeps the sandbox running. Add `--output json` for automation; the result contains a `service_urls` map whose empty key is the unnamed endpoint. -Use `openshell service expose` after creation to add or update named endpoints. +Use `os service expose` after creation to add or update named endpoints. An HTTP/2 backend requires the supervisor application listener. Clients use the application URL with HTTP/2 over TLS. @@ -1132,19 +1132,19 @@ Prefer loopback binds unless the user explicitly needs LAN-visible local access. When you encounter a command or option not covered in this skill: -1. **Start broad**: `openshell --help` to see all command groups. -2. **Narrow down**: `openshell --help` to see subcommands (e.g., `openshell sandbox --help`). -3. **Get specific**: `openshell --help` for flags and usage (e.g., `openshell sandbox create --help`). +1. **Start broad**: `os --help` to see all command groups. +2. **Narrow down**: `openshell --help` to see subcommands (e.g., `os sandbox --help`). +3. **Get specific**: `openshell --help` for flags and usage (e.g., `os sandbox create --help`). The CLI help is always authoritative. If the help output contradicts this skill, follow the help output -- the CLI may have been updated since this skill was written. ### Example: discovering an unfamiliar command ```bash -$ openshell sandbox --help +$ os sandbox --help # Shows: create, get, list, stop, start, delete, exec, connect, upload, download, ssh-config, provider, template -$ openshell sandbox upload --help +$ os sandbox upload --help # Shows: positional arguments (name, path, dest), usage examples ``` From cef65e3b3b7e35bced50a71cf1ba73b34f763036 Mon Sep 17 00:00:00 2001 From: Jim Meyer Date: Thu, 3 Dec 2026 13:22:59 -0800 Subject: [PATCH 3/3] feat(cli): keep the openshell rename notice off by default Running the CLI as openshell no longer prints the rename notice unless it is switched on in a later release. OPENSHELL_SUPPRESS_RENAME_WARNING still hides it once it is on. Related to #6199 Signed-off-by: Jim Meyer --- crates/openshell-cli/src/main.rs | 22 +++++++++++++++++++++- crates/openshell-core/src/forward.rs | 3 +-- deploy/man/os.1.md | 6 +----- docs/about/installation.mdx | 4 ++-- openshell.spec | 2 +- snapcraft.yaml | 3 +-- tasks/scripts/package-deb.sh | 2 +- tasks/scripts/release.py | 4 ++-- tasks/scripts/test-packaging-assets.sh | 2 +- 9 files changed, 31 insertions(+), 17 deletions(-) diff --git a/crates/openshell-cli/src/main.rs b/crates/openshell-cli/src/main.rs index 3ed1105922..a5ba5dc96c 100644 --- a/crates/openshell-cli/src/main.rs +++ b/crates/openshell-cli/src/main.rs @@ -803,6 +803,10 @@ const SUPPRESS_RENAME_WARNING_ENV: &str = "OPENSHELL_SUPPRESS_RENAME_WARNING"; const RENAME_WARNING: &str = "warning: `openshell` has been renamed to `os`; `openshell` will be removed in a future release."; +/// Whether running as `openshell` prints the rename notice. Off until users +/// have had time to move to `os`. +const RENAME_WARNING_ON_BY_DEFAULT: bool = false; + /// Whether the process was started through the deprecated `openshell` name. fn invoked_as_deprecated_name(argv0: Option<&std::ffi::OsStr>) -> bool { argv0 @@ -819,10 +823,17 @@ fn rename_warning_suppressed(value: Option) -> bool { value.is_some_and(|value| !value.is_empty()) } +fn rename_warning_enabled(on_by_default: bool, suppress: Option) -> bool { + on_by_default && !rename_warning_suppressed(suppress) +} + fn warn_if_invoked_as_deprecated_name() { let argv0 = std::env::args_os().next(); if invoked_as_deprecated_name(argv0.as_deref()) - && !rename_warning_suppressed(std::env::var_os(SUPPRESS_RENAME_WARNING_ENV)) + && rename_warning_enabled( + RENAME_WARNING_ON_BY_DEFAULT, + std::env::var_os(SUPPRESS_RENAME_WARNING_ENV), + ) { eprintln!("{RENAME_WARNING}"); } @@ -5260,6 +5271,15 @@ mod tests { assert!(rename_warning_suppressed(Some("1".into()))); } + #[test] + fn rename_warning_follows_default_unless_suppressed() { + assert!(!rename_warning_enabled(false, None)); + assert!(!rename_warning_enabled(false, Some("".into()))); + assert!(rename_warning_enabled(true, None)); + assert!(rename_warning_enabled(true, Some("".into()))); + assert!(!rename_warning_enabled(true, Some("1".into()))); + } + #[test] fn sandbox_download_uses_path_value_hint() { let cmd = Cli::command(); diff --git a/crates/openshell-core/src/forward.rs b/crates/openshell-core/src/forward.rs index 2c24ebc1ad..1de0569aa9 100644 --- a/crates/openshell-core/src/forward.rs +++ b/crates/openshell-core/src/forward.rs @@ -954,8 +954,7 @@ pub fn build_proxy_command(exe: &str, handle: &str, sandbox: &str, workspace: &s /// Path of the running CLI, for commands that it records or runs again. /// /// A CLI started through the deprecated `openshell` link prefers the `os` -/// binary beside it, so recorded commands survive the link's removal and do -/// not repeat the rename notice. +/// binary beside it, so recorded commands survive the link's removal. pub fn cli_executable() -> Result { std::env::current_exe() .into_diagnostic() diff --git a/deploy/man/os.1.md b/deploy/man/os.1.md index b95ca2f483..888273b2a2 100644 --- a/deploy/man/os.1.md +++ b/deploy/man/os.1.md @@ -26,8 +26,7 @@ run as a package-managed systemd user service, a Helm deployment, a development task, or behind a cloud reverse proxy. The CLI was previously named **openshell**. That name still runs the same -command and prints a rename notice to standard error; it will be removed in a -future release. +command; it will be removed in a future release. # COMMANDS @@ -172,9 +171,6 @@ future release. **OPENSHELL_GATEWAY_ENDPOINT** : Direct gateway URL (bypasses metadata lookup). -**OPENSHELL_SUPPRESS_RENAME_WARNING** -: Set to any non-empty value to hide the notice printed when the CLI runs as **openshell**. - **ANTHROPIC_API_KEY**, **OPENAI_API_KEY**, **OPENROUTER_API_KEY** : API keys discovered by auto-provider creation. diff --git a/docs/about/installation.mdx b/docs/about/installation.mdx index 8b34dc08ba..545374c464 100644 --- a/docs/about/installation.mdx +++ b/docs/about/installation.mdx @@ -24,7 +24,7 @@ The script picks a package for your platform and starts the gateway. Confirm the os status ``` -The CLI command is `os`. Earlier releases named it `openshell`. That name still runs the same command and prints a rename notice to standard error, and it will be removed in a future release. Set `OPENSHELL_SUPPRESS_RENAME_WARNING=1` to hide the notice in scripts you have not updated yet. +The CLI command is `os`. Earlier releases named it `openshell`. That name still runs the same command, and it will be removed in a future release. To install a specific release, set `OPENSHELL_VERSION` to a release tag. Release artifacts are also on the [GitHub Releases](https://github.com/ai-openshell/openshell/releases) page. @@ -170,7 +170,7 @@ The global command prevents automatic activation for other users but does not st systemctl --user disable --now snap.openshell.user-gateway.service ``` -The snap installs the CLI as `openshell` and as `openshell.os` with an alias to `os`, and the standalone policy prover as `openshell.prover` with an alias to `openshell-prover`. Installs of locally-built snaps will not have the aliases. The snap's `openshell` command does not print the rename notice. The prover reads local policy files through the `home` interface and does not connect to the gateway. +The snap installs the CLI as `openshell` and as `openshell.os` with an alias to `os`, and the standalone policy prover as `openshell.prover` with an alias to `openshell-prover`. Installs of locally-built snaps will not have the aliases. The prover reads local policy files through the `home` interface and does not connect to the gateway. The gateway runs at `https://127.0.0.1:17670`. It reads `~/snap/openshell/common/.config/openshell/gateway.toml` when that file exists. Its database defaults to `~/snap/openshell/common/.local/state/openshell/gateway/openshell.db`, and its TLS material lives under `~/snap/openshell/common/.local/state/openshell/tls`. Register it from the same user account: diff --git a/openshell.spec b/openshell.spec index 41a100cef7..940e60f464 100644 --- a/openshell.spec +++ b/openshell.spec @@ -131,7 +131,7 @@ pandoc -s -t man deploy/man/openshell-gateway.8.md -o openshell-gateway.8 %install # --- CLI binary --- install -Dpm 0755 "${OPENSHELL_PREBUILT_BINARIES_DIR}/os" %{buildroot}%{_bindir}/os -# Deprecated command name; the CLI prints a rename notice when run through it. +# Deprecated command name for the renamed CLI. ln -s os %{buildroot}%{_bindir}/%{name} # --- Standalone policy prover --- diff --git a/snapcraft.yaml b/snapcraft.yaml index bf355dc439..32b59dbf3d 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -107,8 +107,7 @@ platforms: build-for: [arm64] apps: - # Runs the CLI directly, without the rename notice, until every Store - # installation has the `os` alias. + # Runs the CLI directly until every Store installation has the `os` alias. openshell: command: bin/os environment: diff --git a/tasks/scripts/package-deb.sh b/tasks/scripts/package-deb.sh index dae7713d9a..47e1afb63c 100755 --- a/tasks/scripts/package-deb.sh +++ b/tasks/scripts/package-deb.sh @@ -115,7 +115,7 @@ mkdir -p "$pkgroot/DEBIAN" # Binaries. stage_binary "$OPENSHELL_CLI_BINARY" "$pkgroot/usr/bin/os" -# Deprecated command name; the CLI prints a rename notice when run through it. +# Deprecated command name for the renamed CLI. ln -s os "$pkgroot/usr/bin/openshell" stage_binary "$OPENSHELL_GATEWAY_BINARY" "$pkgroot/usr/bin/openshell-gateway" stage_binary "$OPENSHELL_PROVER_BINARY" "$pkgroot/usr/bin/openshell-prover" diff --git a/tasks/scripts/release.py b/tasks/scripts/release.py index 6b2cc40760..0ebf32b645 100644 --- a/tasks/scripts/release.py +++ b/tasks/scripts/release.py @@ -366,7 +366,7 @@ def install odie "OpenShell Homebrew formula currently supports macOS only" unless OS.mac? bin.install "os" - # Deprecated command name; the CLI prints a rename notice when run through it. + # Deprecated command name for the renamed CLI. bin.install_symlink "os" => "openshell" resource("openshell-gateway").stage do @@ -510,7 +510,7 @@ def caveats test do assert_match "os ", shell_output("#{{bin}}/os --version") - assert_match "os ", shell_output("OPENSHELL_SUPPRESS_RENAME_WARNING=1 #{{bin}}/openshell --version") + assert_match "os ", shell_output("#{{bin}}/openshell --version") assert_match "openshell-prover ", shell_output("#{{bin}}/openshell-prover --version") end end diff --git a/tasks/scripts/test-packaging-assets.sh b/tasks/scripts/test-packaging-assets.sh index fe739b2b9a..bd668e1c13 100755 --- a/tasks/scripts/test-packaging-assets.sh +++ b/tasks/scripts/test-packaging-assets.sh @@ -237,7 +237,7 @@ assert_contains "$snap_publish_workflow" 'cancel-in-progress: false' assert_contains "$snap_publish_workflow" 'queue: max' assert_contains "$snapcraft" 'for bin in os openshell-prover openshell-gateway openshell-driver-docker openshell-sandbox openshell-gateway-wrapper; do' assert_contains "$snapcraft" '"$CRAFT_PART_INSTALL/bin/os"' -# The CLI is `os`; the snap's `openshell` app runs it without the rename notice. +# The CLI is `os`; the snap's `openshell` app runs it directly. if ! awk ' /^ openshell:$/ { app = "openshell"; next } /^ os:$/ { app = "os"; next }