feat(cli): investigate sandbox specs and openshell apply -f
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Problem Statement
OpenShell sandbox creation is currently primarily flag-driven through openshell sandbox create. As sandbox configuration grows to include image/source selection, policy, providers, environment, labels, annotations, resource requirements, driver-specific configuration, forwarding, editor integration, and keep/wait behavior, users need a repeatable file format that can be checked into source control, reviewed, and applied consistently from local machines or CI.
This came up during the RFC 0004 review for sandbox resource requirements: https://github.com/NVIDIA/OpenShell/pull/1360#discussion_r3247078134. The concrete user-facing idea is a sandbox config or deployment spec, similar in spirit to a Kubernetes PodSpec or Docker Compose file, consumable with a command like openshell apply -f sandbox.yaml.
Proposed Design
Investigate and propose a first-class OpenShell sandbox definition file consumed by openshell apply -f <file> or an equivalent command, backed by the public SandboxSpec and SandboxTemplate semantics rather than a separate ad hoc model.
The investigation should answer these design questions:
- Manifest shape: likely YAML with versioned metadata such as
apiVersion: openshell.ai/v1alpha1,kind: Sandbox,metadata.name, andspec. - Command semantics: whether
apply -fmeans create only, create-or-update, or a phased model where immutable fields require recreation while mutable policy fields can update a running sandbox. - CLI parity: how existing
sandbox createflags map into manifest fields, including--from, policy, providers, environment, labels, annotations, resource requirements, driver config, forwards, editor, keep, wait, and command arguments. - Resource model: align with RFC 0004 by using typed portable resource requirements for CPU, memory, GPU, and future resource domains, while keeping backend-specific settings under driver config.
- Validation: perform local schema validation before sending requests, keep gateway-side validation authoritative, and provide clear errors for unsupported or conflicting fields.
- UX: consider
--dry-run,--wait,--output, and a future export or scaffold command such asopenshell sandbox export <name>oropenshell sandbox init. - Compatibility: define how manifests interact with existing
openshell sandbox createworkflows and whether this should be introduced as experimental before becoming stable.
The expected output is a concrete design proposal or follow-up implementation issue covering schema, command behavior, tests, and documentation.
Alternatives Considered
- Continue adding flags to
openshell sandbox create. This keeps the CLI simple for small cases but does not give users a reviewable, reusable sandbox definition. - Add JSON blob flags for complex configuration. This is less ergonomic than a structured file and conflicts with RFC 0004 guidance that portable resource requests should stay typed rather than hidden in JSON.
- Reuse Kubernetes PodSpec directly. This is familiar for Kubernetes users but would make OpenShell manifests too Kubernetes-shaped and would not map cleanly to Docker, Podman, VM, or future drivers.
- Add only
openshell sandbox create --config <file>. This may be a reasonable implementation step, but the investigation should decide whether the desired long-term model is create-only config or apply-style declarative state.
Agent Investigation
- Used the
create-github-issueskill and reviewed the project feature request template. - Reviewed
rfc/README.md; RFCs in review or accepted state are the right place for cross-cutting API and CLI design, while issues can scope the investigation. - Reviewed RFC 0004 and its PR discussion. The RFC proposes typed portable resource requirements plus driver-specific config, and the review thread explicitly raised a sandbox file spec and
openshell apply -f. - Inspected
proto/openshell.proto;SandboxSpecandSandboxTemplatealready provide the natural API-backed model for most sandbox manifest fields. - Inspected
crates/openshell-cli/src/run.rs;sandbox create --fromcurrently resolves community sandbox names, image references, local Dockerfiles, and local directories, so manifest semantics need to define source handling deliberately. - Checked open issues for matching terms such as
apply -f,sandbox spec, anddeployment spec; no exact duplicate was found.
Checklist
- I have reviewed existing issues and the architecture docs
- This is a design proposal, not a please build this request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rfc/README.md and RFC 0004, then inspect proto/openshell.proto and crates/openshell-cli/src/run.rs to compare SandboxSpec, SandboxTemplate, and existing sandbox create --from behavior. Done means a concrete design proposal or follow-up implementation issue covering manifest schema, command semantics, validation, tests, and documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, yaml
- Domain
- api, cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100