CLI Reference#
Complete command reference for the openshell CLI. Every subcommand, flag, and option is documented here.
Command Tree#
The full hierarchy of openshell subcommands:
openshell
├── status
├── logs [name]
├── term
├── forward
│ ├── start <port> <name>
│ ├── stop <port> <name>
│ └── list
├── gateway
│ ├── start
│ ├── stop
│ ├── destroy
│ ├── info
│ ├── add <url>
│ └── select [name]
├── sandbox
│ ├── create
│ ├── get [name]
│ ├── list
│ ├── delete <name...> [--all]
│ ├── connect [name]
│ ├── upload [name]
│ ├── download [name]
│ └── ssh-config <name>
├── policy
│ ├── set <name>
│ ├── get <name>
│ └── list <name>
├── provider
│ ├── create
│ ├── get <name>
│ ├── list
│ ├── update <name>
│ └── delete <name>
├── inference
│ ├── set
│ ├── update
│ └── get
├── doctor
│ ├── logs
│ └── exec
└── completions <shell>
Tip
Commands that accept an optional [name] argument — such as get, connect, upload, download, and logs — fall back to the last-used sandbox when the name is omitted. The CLI records the sandbox name each time you create or connect, and prints a hint showing which sandbox was selected.
Status, Logs, and Terminal#
Check gateway health, stream sandbox logs, and launch the terminal dashboard:
Command |
Description |
|---|---|
|
Show the health and status of the active gateway. |
|
View sandbox logs. Use |
|
Launch the OpenShell Terminal — a dashboard showing sandbox status, live logs, and policy decisions in a single view. Navigate with |
Refer to Create and Manage Sandboxes for more on monitoring sandboxes and reading log entries.
Gateway Commands#
Manage the OpenShell runtime cluster.
Command |
Description |
|---|---|
|
Deploy a new cluster. Add |
|
Stop the active cluster, preserving state. |
|
Permanently remove the cluster and all its data. |
|
Show detailed information about the cluster. |
|
Register an existing remote gateway by URL. |
|
Set the active cluster. All subsequent commands target this cluster. |
|
List all registered clusters (when called without a name). |
Diagnostic Commands#
Troubleshoot gateway issues.
Command |
Description |
|---|---|
|
Fetch logs from the gateway Docker container. Use |
|
Run a command inside the gateway container (e.g., |
Sandbox Commands#
Create and manage isolated agent execution environments.
Command |
Description |
|---|---|
|
Create a new sandbox. Refer to the flag reference below. |
|
Show detailed information about a sandbox. |
|
List all sandboxes in the active cluster. |
|
Delete one or more sandboxes by name. Use |
|
Open an interactive SSH session into a running sandbox. |
|
Upload files from the host into a sandbox. |
|
Download files from a sandbox to the host. |
|
Print the generated SSH config block for a sandbox. |
Sandbox Create Flags#
The following flags control sandbox creation:
Flag |
Description |
|---|---|
|
Assign a human-readable name to the sandbox. Auto-generated if omitted. |
|
Attach a credential provider. Repeatable for multiple providers. |
|
Path to a policy YAML file to apply at creation time. |
|
Upload local files into the sandbox before running. |
|
Delete the sandbox after the initial command or shell exits. |
|
Launch |
|
Forward a local port into the sandbox at startup. Keeps the sandbox alive. |
|
Build from a community sandbox name, local Dockerfile directory, or container image reference. |
|
The command to run inside the sandbox. Everything after |
Policy Commands#
Apply and inspect sandbox policies at runtime.
Command |
Description |
|---|---|
|
Apply or update a policy on a running sandbox. Pass |
|
Show the active policy for a sandbox. Add |
|
List all policy versions applied to a sandbox, with status. |
Port Forwarding Commands#
Forward sandbox ports to the host for local access.
Command |
Description |
|---|---|
|
Forward a sandbox port to the host. Add |
|
Stop an active port forward. |
|
List all active port forwards. |
Provider Commands#
Manage credential providers that inject secrets into sandboxes.
Command |
Description |
|---|---|
|
Create a new credential provider. Refer to the flag reference below. |
|
Show details of a provider. |
|
List all providers in the active cluster. |
|
Update a provider’s credentials or configuration. |
|
Delete a provider. |
Provider Create Flags#
The following flags control provider creation:
Flag |
Description |
|---|---|
|
Name for the provider. |
|
Provider type: |
|
Discover credentials from your current shell environment variables. |
|
Set a credential explicitly. Format: |
|
Set a configuration value. Format: |
Inference Commands#
Configure the backend used by https://inference.local.
openshell inference set#
Set the provider and model for managed inference. Both flags are required.
Flag |
Description |
|---|---|
|
Provider record name to use for injected credentials. |
|
Model identifier to force on generation requests. |
openshell inference update#
Update only the fields you specify.
Flag |
Description |
|---|---|
|
Replace the current provider record. |
|
Replace the current model ID. |
openshell inference get#
Show the current inference configuration, including provider, model, and version.
Environment Variables#
The following environment variables override CLI defaults:
Variable |
Description |
|---|---|
|
Name of the gateway to operate on. Overrides the active gateway set by |
|
Default path to a policy YAML file. When set, |
Shell Completions#
Generate shell completion scripts for tab completion:
$ openshell completions bash
$ openshell completions zsh
$ openshell completions fish
Pipe the output to your shell’s config file:
$ openshell completions zsh >> ~/.zshrc
$ source ~/.zshrc
Built-in Help#
Every command and subcommand includes built-in help. Use --help at any level to see available subcommands, flags, and usage examples:
$ openshell --help
$ openshell sandbox --help
$ openshell sandbox create --help
$ openshell gateway --help
Help output groups flags under distinct headings: FLAGS for command-specific options, GATEWAY FLAGS for --gateway and --gateway-endpoint, and GLOBAL FLAGS for --verbose, --help, and --version.