跳到正文
Skillpedia
部署与云(DevOps)21k · #10368

openshell-cli

它能做什么

这项技能教 AI 运行 openshell 命令行工具,用于管理沙盒、网关、提供方和策略,从简单任务到多步骤设置都包括在内。适合使用 OpenShell 安全运行 AI 智能体的人。

适用场景

  • ✓你想创建、连接沙盒,或在沙盒中运行命令的时候。
  • ✓你需要用 OpenShell 注册网关或设置提供方的时候。
  • ✓你正在用 openshell 命令逐步更新沙盒策略的时候。

技能链接

https://github.com/NVIDIA/OpenShell/blob/main/skills/openshell-cli/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/NVIDIA/OpenShell/blob/main/skills/openshell-cli/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请创建一个 OpenShell 沙盒,连接到它,并在里面运行一条测试命令。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会使用 OpenShell 内置的帮助信息找到正确的命令和参数,然后按顺序为你的任务运行它们。遇到该技能未涵盖的命令时,它会阅读该命令的帮助。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

OpenShell CLI

Guide agents through using the openshell 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.

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:

openshell --help                    # Top-level commands
openshell <group> --help            # Subcommands in a group
openshell <group> <cmd> --help      # Flags for a specific command

This is your primary fallback. Use it freely -- the CLI's help output is authoritative and always up-to-date.

Prerequisites

  • openshell is on the PATH. Follow the published installation guide 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:


Workflow 1: Getting Started

Use this workflow when the user has a gateway endpoint and wants to get a sandbox running for the first time.

Step 1: Register a gateway

openshell 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.

Step 2: Verify the gateway

openshell status
openshell 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 by the gateway, including the subject an administrator uses for workspace membership. Add --output json for automation.

Step 3: Create a sandbox

The simplest way to get a sandbox running:

openshell sandbox create

This creates a sandbox whose canonical main process is /bin/bash -l and attaches your terminal to that retained process. Add --detach to return after the sandbox becomes ready without attaching.

An explicit trailing command is foreground even when stdin or stdout is not a terminal. The CLI streams its stdout and stderr and reports the command's exit status after output drains. A failure to deliver output makes the CLI report a failure even if the command itself exited successfully; check the sandbox's state before retrying work that might have side effects. Exit code 0 leaves a retained sandbox in Completed; nonzero leaves it in Error with MainProcessFailed. Use --no-keep to delete either result after output drains, or --detach for a long-running service. Combine --detach --no-keep when the gateway should run the service without a host attachment and delete its sandbox after the service exits.

When supply

常见问题

我需要先安装 OpenShell 吗?

需要。openshell 工具必须已安装并位于 PATH 中;如果缺少它,技能会指向安装指南。

它也负责编写策略规则的内容吗?

它涵盖管理策略的命令。编写规则内容由单独的策略技能负责。

它能帮忙设置 AI 模型提供方吗?

能。它涵盖提供方配置,包括刷新提供方设置,以及使用已附加的提供方进行推理。

详情

作者的原始描述

Guide agents through using the OpenShell CLI (openshell) for sandbox management, gateway registration, provider configuration and refresh, profile management, policy iteration, settings, service exposure, BYOC workflows, and attached-provider inference. Covers basic through advanced multi-step workflows. Trigger keywords - openshell, sandbox create, sandbox exec, sandbox connect, logs, provider create, profile list, profile describe, provider refresh, policy set, policy get, settings, service expose, forward, port forward, BYOC, bring your own container, inference, use openshell, run openshell

repo: NVIDIA/OpenShell

热度

GitHub 星标
21k
排名
#10368
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能