CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

ORAS CLI

$ oras 基金会 中风险
CNCF / ORAS Project · 云原生与基础设施 · Apache-2.0 · macos / linux / windows

ORAS CLI(oras)无需 Docker 守护进程即可在 OCI 镜像仓库中推送、拉取与检视任意 OCI 工件(如 SBOM、Helm Chart、Wasm 模块与 Cosign 关联制品),并在 discover、manifest fetch 与 repo tags 中支持 --format json。

FCRS-1.0 综合评分
85 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install oras
CLI vs MCP 选型建议 优先选 CLI

oras 直接基于 OCI Distribution API 以 --format json 检索工件关联图谱与 Manifest,无需 MCP 中间层。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 21 / 25

discover、repo ls、repo tags 与 manifest fetch 均支持 --format json,无头模式运行稳定。

  • Supports --format json across discovery and tag listing commands
安全与权限边界 20 / 25

无守护进程客户端不依赖宿主机 Docker Socket,且 manifest delete 强制要求传入 --force。

  • Daemonless client; manifest delete requires --force
安装与运行摩擦 15 / 15

单文件静态 Go 二进制,可通过 Homebrew 与 GitHub Releases 跨平台安装。

  • Static Go binary via brew install oras
能力覆盖与边际价值 12 / 15

原生支持 OCI v1.1 Referrers API,是查验供应链 SBOM 与签名的利器。

  • First-class OCI v1.1 Referrers API support
维护与来源背书 9 / 10

CNCF 孵化项目(oras-project/oras),Apache-2.0 协议持续维护。

  • Official CNCF oras-project/oras repository
文档与可验证性 8 / 10

具备清晰的 oras.land 官方命令手册与 --help。

  • Official docs at oras.land/docs/commands/oras/

安全边界、鉴权与放权指南

鉴权方式
本地配置文件 系统钥匙串
凭证存储位置

复用 ~/.docker/config.json 或通过 oras login 配置的系统凭据助手。

潜在副作用
只读查询 本地写入 远端写入 破坏性删除
费用与配额提示

完全开源免费(Apache-2.0);仓库存储与流量计费取决于所连接的 OCI 仓库服务。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# ORAS CLI Agent Rules
- Use `--format json` on `oras discover` and `oras repo tags` for reliable parsing.
- Use `oras manifest fetch` or `oras blob fetch --output -` for read-only inspection.
- Never run `oras manifest delete` or `oras push` without explicit user approval.

Agent 高频安全命令配方

只读查询(安全推荐)

以 JSON 发现镜像关联的 SBOM 与签名制品
oras discover ghcr.io/org/app:v1.0 --format json

查询绑定在指定工件上的 OCI Referrers 并以 JSON 输出依赖图谱。

拉取并查看 OCI Manifest JSON
oras manifest fetch ghcr.io/org/app:v1.0 --pretty

不下载层数据即可获取并格式化输出 OCI Manifest。

核心优势

  • + oras discover --format json 可清晰遍历 OCI SBOM 与签名关联树。
  • + 无守护进程 Go 二进制,适合在受限沙箱环境运行。
  • + 破坏性命令 manifest delete 设有 --force 防误删门禁。

注意事项与踩坑点

  • ! oras cp 与 oras push 缺少 --dry-run 预演功能。
  • ! 部分老旧镜像仓库尚未完整支持 OCI v1.1 Referrers API。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI