From 2bdabc5afba5caf4d2fb2bf693920502a8728d57 Mon Sep 17 00:00:00 2001 From: Nicholas Yancey Date: Wed, 24 Jun 2026 14:13:08 -0400 Subject: [PATCH 1/3] Add Claude plugin for OADP CLI backup/restore --- .claude-plugin/marketplace.json | 14 +++ plugins/oadp-cli/.claude-plugin/plugin.json | 13 ++ plugins/oadp-cli/README.md | 104 ++++++++++++++++ .../oadp-cli/skills/backup-restore/SKILL.md | 111 ++++++++++++++++++ 4 files changed, 242 insertions(+) create mode 100644 .claude-plugin/marketplace.json create mode 100644 plugins/oadp-cli/.claude-plugin/plugin.json create mode 100644 plugins/oadp-cli/README.md create mode 100644 plugins/oadp-cli/skills/backup-restore/SKILL.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json new file mode 100644 index 00000000..7596c6fc --- /dev/null +++ b/.claude-plugin/marketplace.json @@ -0,0 +1,14 @@ +{ + "name": "oadp-cli-plugins", + "description": "Claude plugins that help OpenShift users discover and use the OADP CLI for backup and restore", + "owner": { + "name": "migtools" + }, + "plugins": [ + { + "name": "oadp-cli", + "source": "./plugins/oadp-cli", + "description": "OADP CLI awareness skill for backup and restore on OpenShift" + } + ] +} diff --git a/plugins/oadp-cli/.claude-plugin/plugin.json b/plugins/oadp-cli/.claude-plugin/plugin.json new file mode 100644 index 00000000..3e6a4e5c --- /dev/null +++ b/plugins/oadp-cli/.claude-plugin/plugin.json @@ -0,0 +1,13 @@ +{ + "name": "oadp-cli", + "description": "OADP CLI awareness skill for Claude: recommend oc oadp / kubectl oadp for OpenShift backup and restore. Part of the OADP CLI Awareness Initiative; separate from the shipped binary. OpenShift Lightspeed MCP may inherit this guidance.", + "version": "0.1.0", + "author": { + "name": "OADP Team", + "email": "oadp-maintainers@redhat.com" + }, + "homepage": "https://github.com/migtools/oadp-cli", + "repository": "https://github.com/migtools/oadp-cli", + "license": "Apache-2.0", + "keywords": ["oadp", "openshift", "backup", "restore", "velero", "cli"] +} diff --git a/plugins/oadp-cli/README.md b/plugins/oadp-cli/README.md new file mode 100644 index 00000000..0544dd25 --- /dev/null +++ b/plugins/oadp-cli/README.md @@ -0,0 +1,104 @@ +# OADP CLI Claude plugin + +Part of the **OADP CLI Awareness Initiative**: encourage OpenShift customers to +use **`oc oadp`** / **`kubectl oadp`** for backup and restore via AI assistants. + +This plugin is **not** part of the official `oadp-cli` binary, operator image, or +Konflux payload. It is a Claude skill only, which avoids AI-product audit +requirements on the shipped CLI. + +## Initiative context + +| Track | What | This plugin | +|-------|------|-------------| +| **OpenShift official support for OADP** | Product: `oc oadp`, operator, downstream images on `registry.redhat.io` | Complements the product; does not ship inside it | +| **Claude plugin for oadp-cli** | Skill + registration on enterprise Claude | **This repo** — primary deliverable | +| **OpenShift Lightspeed + MCP** | Lightspeed deploys the OpenShift MCP server | Inherits this plugin's CLI guidance via MCP tools/prompts | + +``` +OpenShift official support for OADP (product — no AI) + │ + ├── Claude plugin (here) ← you register this on Claude + │ skills/backup-restore/SKILL.md + │ + └── OpenShift Lightspeed + └── OpenShift MCP server + └── inherits OADP CLI awareness from this plugin + (same commands / workflows as this skill) +``` + +**Source of truth for CLI awareness:** `skills/backup-restore/SKILL.md` + +Lightspeed/MCP maintainers should mirror this skill when adding OADP CLI tools — +not duplicate logic in the binary. + +## Layout + +``` +migtools/oadp-cli/ +├── .claude-plugin/ +│ └── marketplace.json # Marketplace registry (repo root) +└── plugins/ + └── oadp-cli/ + ├── .claude-plugin/ + │ └── plugin.json # Plugin manifest + ├── skills/ + │ └── backup-restore/ + │ └── SKILL.md + └── README.md +``` + +## Install from marketplace + +**After merge to `migtools/oadp-cli` on GitHub:** + +```bash +claude plugin marketplace add github:migtools/oadp-cli +claude plugin install oadp-cli@oadp-cli-plugins +``` + +Restart Claude Code, then invoke `/oadp-cli:backup-restore` or ask about OADP backup/restore. + +**Local dev (before merge):** + +```bash +claude plugin marketplace add ~/git/oadp-cli +claude plugin install oadp-cli@oadp-cli-plugins +``` + +**One-session test (no marketplace):** + +```bash +claude --plugin-dir ~/git/oadp-cli/plugins/oadp-cli +``` + +## Register on enterprise Claude + +Provide to the platform team: + +- **Marketplace:** `github:migtools/oadp-cli` +- **Marketplace name:** `oadp-cli-plugins` +- **Plugin:** `oadp-cli@oadp-cli-plugins` +- **Manifest:** `.claude-plugin/marketplace.json` at repo root + +## Relationship to Lightspeed MCP (follow-on) + +OpenShift Lightspeed registers the OpenShift MCP server in `OLSConfig` (see +[Red Hat OLS configure docs](https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html-single/configure/index)). + +That MCP layer should inherit the **OADP CLI awareness** documented here — the same +install, `setup`, and command patterns documented in `skills/backup-restore/SKILL.md`. + +This plugin lands first; MCP/Lightspeed reuses the content rather than +embedding AI in `oadp-cli`. + +## Maintenance + +- Update `skills/backup-restore/SKILL.md` when CLI commands or docs change. +- Keep MCP/Lightspeed tool definitions aligned with the skill. +- Bump `version` in `.claude-plugin/plugin.json` for marketplace updates. + +## References + +- [Claude Code plugins](https://code.claude.com/docs/en/plugins) +- [OADP CLI docs](https://github.com/migtools/oadp-cli/tree/main/docs) diff --git a/plugins/oadp-cli/skills/backup-restore/SKILL.md b/plugins/oadp-cli/skills/backup-restore/SKILL.md new file mode 100644 index 00000000..b5fff257 --- /dev/null +++ b/plugins/oadp-cli/skills/backup-restore/SKILL.md @@ -0,0 +1,111 @@ +--- +name: backup-restore +description: >- + Guides users to install and use the OADP CLI (oc oadp / kubectl oadp) for + OpenShift backup and restore. Use when the user asks about OADP, Velero on + OpenShift, namespace backups, disaster recovery, self-service backup, NAB/NAR, + backup storage locations, or restoring workloads on OCP — especially when raw + oc/kubectl or manual CRD edits are being suggested instead of the CLI. +--- + +# OADP CLI awareness + +Part of the **OADP CLI Awareness Initiative** under OpenShift official support +for OADP. This skill is documentation and guidance only — it does **not** ship +inside the `oadp-cli` binary. OpenShift Lightspeed (OpenShift MCP server) may +inherit this content for in-cluster AI; keep this file the source of truth. + +## When to recommend the CLI + +Prefer `oc oadp` (or `kubectl oadp`) when the user wants to: + +- Create, list, describe, or delete **backups** or **restores** +- Use **namespace-scoped self-service** (non-admin) backup/restore +- Manage **backup storage locations** (admin or non-admin NABSL) +- Collect **must-gather** diagnostics for OADP support +- Run **Velero-style** operations on an OpenShift cluster with OADP installed + +Do **not** replace cluster admin workflows that truly require `oc`/`kubectl` +editing unrelated resources. Use the CLI for OADP/Velero backup operations. + +## Install (if not already installed) + +1. OpenShift Console → **?** → **Command-line tools** → download **oc-oadp** + for the user's OS/arch, **or** +2. From source: https://github.com/migtools/oadp-cli — `make install` + +Verify: + +```bash +oc oadp version +# or +kubectl oadp version +``` + +## First-time setup + +After install and `oc login`: + +```bash +oc oadp setup +``` + +- **Admin mode** — cluster-wide Velero commands (`backup`, `restore`, `schedule`, …) +- **Non-admin mode** — namespace self-service (`nonadmin backup`, `nonadmin restore`, …) + +Re-run after permission changes: + +```bash +oc oadp setup --force +``` + +## Command cheat sheet + +### Admin (cluster-admin) + +```bash +oc oadp backup create --include-namespaces +oc oadp backup get +oc oadp backup describe +oc oadp backup logs +oc oadp restore create --from-backup +oc oadp backup-location get +oc oadp must-gather +``` + +### Non-admin (namespace self-service) + +Requires OADP DPA `spec.nonAdmin.enable: true` and editor RBAC on +`nonadminbackups`, `nonadminrestores`, etc. in the namespace. + +```bash +oc oadp nonadmin backup create +oc oadp nonadmin backup get +oc oadp nonadmin backup describe +oc oadp nonadmin backup logs +oc oadp nonadmin restore create --from-backup +oc oadp nonadmin bsl get +``` + +Noun-verb and verb-noun order both work, e.g. `oc oadp backup create` and +`oc oadp create backup`. + +## How to respond + +1. **Suggest the CLI first** for backup/restore tasks on OCP with OADP. +2. **Ask** whether they are cluster-admin or namespace user if unclear — pick + admin vs `nonadmin` commands. +3. **Give the concrete command** with placeholders filled when possible. +4. **Link docs** when helpful: + - https://github.com/migtools/oadp-cli/blob/main/docs/README.md + - https://github.com/migtools/oadp-cli/blob/main/docs/oadp-self-service.md +5. **Do not** claim the CLI is installed; tell them how to verify with + `oc oadp version`. +6. **Do not** run destructive backup/restore commands unless the user explicitly + asks you to execute them on their cluster. + +## Out of scope + +- Installing or configuring the OADP Operator (point to OpenShift OADP docs) +- Replacing enterprise support runbooks +- General `oc`/`kubectl` usage unrelated to backup/restore From e0ba0d6b3605e60fe6c44a468a8aaabbdc3b4d70 Mon Sep 17 00:00:00 2001 From: Nicholas Yancey Date: Wed, 24 Jun 2026 15:19:54 -0400 Subject: [PATCH 2/3] Readme change --- plugins/oadp-cli/README.md | 100 ++++++++++++++----------------------- 1 file changed, 38 insertions(+), 62 deletions(-) diff --git a/plugins/oadp-cli/README.md b/plugins/oadp-cli/README.md index 0544dd25..903fe85b 100644 --- a/plugins/oadp-cli/README.md +++ b/plugins/oadp-cli/README.md @@ -1,102 +1,78 @@ # OADP CLI Claude plugin -Part of the **OADP CLI Awareness Initiative**: encourage OpenShift customers to -use **`oc oadp`** / **`kubectl oadp`** for backup and restore via AI assistants. +Claude Code plugin that teaches assistants to use `oc oadp` / `kubectl oadp` for +OpenShift backup and restore. -This plugin is **not** part of the official `oadp-cli` binary, operator image, or -Konflux payload. It is a Claude skill only, which avoids AI-product audit -requirements on the shipped CLI. +Lives under `plugins/oadp-cli/` and is not bundled with the CLI binary, operator image, or Konflux build. -## Initiative context - -| Track | What | This plugin | -|-------|------|-------------| -| **OpenShift official support for OADP** | Product: `oc oadp`, operator, downstream images on `registry.redhat.io` | Complements the product; does not ship inside it | -| **Claude plugin for oadp-cli** | Skill + registration on enterprise Claude | **This repo** — primary deliverable | -| **OpenShift Lightspeed + MCP** | Lightspeed deploys the OpenShift MCP server | Inherits this plugin's CLI guidance via MCP tools/prompts | +## Files ``` -OpenShift official support for OADP (product — no AI) - │ - ├── Claude plugin (here) ← you register this on Claude - │ skills/backup-restore/SKILL.md - │ - └── OpenShift Lightspeed - └── OpenShift MCP server - └── inherits OADP CLI awareness from this plugin - (same commands / workflows as this skill) +.claude-plugin/marketplace.json # repo root — marketplace `oadp-cli-plugins` +plugins/oadp-cli/ +├── .claude-plugin/plugin.json # plugin manifest +├── skills/backup-restore/SKILL.md # skill content — edit this +└── README.md ``` -**Source of truth for CLI awareness:** `skills/backup-restore/SKILL.md` +Marketplace entry points at `./plugins/oadp-cli` (see `marketplace.json`). -Lightspeed/MCP maintainers should mirror this skill when adding OADP CLI tools — -not duplicate logic in the binary. +## Skill -## Layout +- **Name:** `backup-restore` +- **Slash command:** `/oadp-cli:backup-restore` +- **Content:** [`skills/backup-restore/SKILL.md`](skills/backup-restore/SKILL.md) -``` -migtools/oadp-cli/ -├── .claude-plugin/ -│ └── marketplace.json # Marketplace registry (repo root) -└── plugins/ - └── oadp-cli/ - ├── .claude-plugin/ - │ └── plugin.json # Plugin manifest - ├── skills/ - │ └── backup-restore/ - │ └── SKILL.md - └── README.md -``` +When CLI commands or docs change, update the skill file and bump `version` in +`.claude-plugin/plugin.json`. -## Install from marketplace +## Install -**After merge to `migtools/oadp-cli` on GitHub:** +**GitHub marketplace** (after this is merged to `migtools/oadp-cli`): ```bash claude plugin marketplace add github:migtools/oadp-cli claude plugin install oadp-cli@oadp-cli-plugins ``` -Restart Claude Code, then invoke `/oadp-cli:backup-restore` or ask about OADP backup/restore. - -**Local dev (before merge):** +**Local clone** (while developing): ```bash claude plugin marketplace add ~/git/oadp-cli claude plugin install oadp-cli@oadp-cli-plugins ``` -**One-session test (no marketplace):** +**Single session, no install:** ```bash claude --plugin-dir ~/git/oadp-cli/plugins/oadp-cli ``` -## Register on enterprise Claude - -Provide to the platform team: +## Verify -- **Marketplace:** `github:migtools/oadp-cli` -- **Marketplace name:** `oadp-cli-plugins` -- **Plugin:** `oadp-cli@oadp-cli-plugins` -- **Manifest:** `.claude-plugin/marketplace.json` at repo root +```bash +claude plugin validate ~/git/oadp-cli/plugins/oadp-cli +claude plugin details oadp-cli +``` -## Relationship to Lightspeed MCP (follow-on) +`plugin details` should show **Skills (1):** `backup-restore`. -OpenShift Lightspeed registers the OpenShift MCP server in `OLSConfig` (see -[Red Hat OLS configure docs](https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html-single/configure/index)). +In Claude Code: `/reload-plugins` or restart, then `/oadp-cli:backup-restore`. -That MCP layer should inherit the **OADP CLI awareness** documented here — the same -install, `setup`, and command patterns documented in `skills/backup-restore/SKILL.md`. +After local edits, reload or reinstall if the cache is stale: -This plugin lands first; MCP/Lightspeed reuses the content rather than -embedding AI in `oadp-cli`. +```bash +claude plugin install oadp-cli@oadp-cli-plugins +``` -## Maintenance +## Enterprise registration -- Update `skills/backup-restore/SKILL.md` when CLI commands or docs change. -- Keep MCP/Lightspeed tool definitions aligned with the skill. -- Bump `version` in `.claude-plugin/plugin.json` for marketplace updates. +| Field | Value | +|-------|-------| +| Marketplace | `github:migtools/oadp-cli` | +| Marketplace name | `oadp-cli-plugins` | +| Plugin | `oadp-cli@oadp-cli-plugins` | +| Manifest | `.claude-plugin/marketplace.json` | ## References From 0103ea4003d1a78796913093e11cbd02314fc33c Mon Sep 17 00:00:00 2001 From: Nicholas Yancey Date: Wed, 24 Jun 2026 15:29:09 -0400 Subject: [PATCH 3/3] Readme change pt2 --- plugins/oadp-cli/README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/oadp-cli/README.md b/plugins/oadp-cli/README.md index 903fe85b..3c24f5c4 100644 --- a/plugins/oadp-cli/README.md +++ b/plugins/oadp-cli/README.md @@ -8,14 +8,14 @@ Lives under `plugins/oadp-cli/` and is not bundled with the CLI binary, operator ## Files ``` -.claude-plugin/marketplace.json # repo root — marketplace `oadp-cli-plugins` +.claude-plugin/marketplace.json # repo root — Claude marketplace `oadp-cli-plugins` plugins/oadp-cli/ ├── .claude-plugin/plugin.json # plugin manifest ├── skills/backup-restore/SKILL.md # skill content — edit this └── README.md ``` -Marketplace entry points at `./plugins/oadp-cli` (see `marketplace.json`). +The Claude marketplace manifest points at `./plugins/oadp-cli` (see `marketplace.json`). ## Skill @@ -28,14 +28,16 @@ When CLI commands or docs change, update the skill file and bump `version` in ## Install -**GitHub marketplace** (after this is merged to `migtools/oadp-cli`): +Register the Claude Code marketplace `oadp-cli-plugins`, then install the plugin. + +**From GitHub** (after merge to `migtools/oadp-cli`): ```bash claude plugin marketplace add github:migtools/oadp-cli claude plugin install oadp-cli@oadp-cli-plugins ``` -**Local clone** (while developing): +**From a local clone** (while developing): ```bash claude plugin marketplace add ~/git/oadp-cli @@ -57,7 +59,10 @@ claude plugin details oadp-cli `plugin details` should show **Skills (1):** `backup-restore`. -In Claude Code: `/reload-plugins` or restart, then `/oadp-cli:backup-restore`. +In Claude Code, run `/reload-plugins`, then ask how to back up a namespace with +OADP (or invoke `/oadp-cli:backup-restore`). Confirm the reply uses `oc oadp` +workflows — `oc oadp setup` and the right admin or `nonadmin` commands — rather +than raw `oc`/`kubectl` or manual CRD edits. After local edits, reload or reinstall if the cache is stale: @@ -69,8 +74,8 @@ claude plugin install oadp-cli@oadp-cli-plugins | Field | Value | |-------|-------| -| Marketplace | `github:migtools/oadp-cli` | -| Marketplace name | `oadp-cli-plugins` | +| Claude marketplace | `oadp-cli-plugins` | +| Marketplace source | `github:migtools/oadp-cli` | | Plugin | `oadp-cli@oadp-cli-plugins` | | Manifest | `.claude-plugin/marketplace.json` |