/ci:oc-authfrom ci
Retrieves OAuth tokens from the correct OpenShift cluster context when multiple clusters are configured. Provides a curl wrapper that automatically injects tokens to prevent exposure.
Ships in ci. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill provides a centralized way to retrieve OAuth tokens from specific OpenShift clusters when multiple cluster contexts are configured in the user's kubeconfig.
Use this skill whenever you need to:
This skill is used by all commands that need to authenticate with OpenShift clusters:
trigger-periodic, trigger-postsubmit, trigger-presubmit commands (app.ci cluster)query-job-status command (app.ci cluster)The skill provides a single curl_with_token.sh script that wraps curl and automatically handles OAuth token retrieval and injection, preventing accidental token exposure.
Due to a known Claude Code bug with git-installed marketplace plugins:
When referencing files from this skill (scripts, configuration files, etc.), you MUST:
~/.claude/plugins/Example:
~/.claude/plugins/ci/skills/oc-auth/curl_with_token.sh/curl_with_token.shIf you see "no such file or directory" errors, verify you're using the base directory path, not the assumed marketplace cache location.
oc CLI Installation
which ocUser Authentication
oc login creates a new context in the kubeconfigThe oc CLI maintains multiple cluster contexts in ~/.kube/config. When a user runs oc login to different clusters, each login creates a separate context. This skill:
Here are commonly used OpenShift clusters:
app.ci - OpenShift CI Clusterdpcr - DPCR ClusterNote: The skill supports any OpenShift cluster - simply provide the cluster's API server URL.
curl_with_token.shA curl wrapper that automatically retrieves the OAuth token and adds it to the request, preventing token exposure.
curl_with_token.sh <cluster_api_url> [curl arguments...]
Parameters:
<cluster_api_url>: Full cluster API server URL (e.g., https://api.ci.l2s4.p1.openshiftapps.com:6443)[curl arguments...]: All standard curl arguments (URL, headers, data, etc.)How it works:
Authorization: Bearer <token> header automaticallyExit Codes:
0: Success1: Invalid cluster_id or missing arguments2: No context found for the specified cluster3: Failed to retrieve token from contextUse the curl wrapper instead of regular curl for authenticated requests:
# Query app.ci API
curl_with_token.sh https://api.ci.l2s4.p1.openshiftapps.com:6443 -X POST \
-d '{"job_name": "my-job", "job_execution_type": "1"}' \
https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
# Query any other OpenShift cluster API
curl_with_token.sh https://api.your-cluster.example.com:6443 -X GET \
https://your-api.example.com/endpoint
Benefits:
The script provides clear error messages for common scenarios:
Missing or invalid arguments
No context found
Token retrieval failed
Please authenticate first:
1. Visit the cluster's console URL in your browser
2. Log in through the browser with your credentials
3. Click on username → 'Copy login command'
4. Paste and execute the 'oc login' command in terminal
Verify authentication with:
oc config get-contexts
oc cluster-info
For app.ci cluster:
oc cluster-info - should show API server: https://api.ci.l2s4.p1.openshiftapps.com:6443For DPCR cluster:
oc cluster-info - should show API server: https://api.cr.j7t7.p1.openshiftapps.com:6443The script uses the following approach:
Get all context names
oc config get-contexts -o name
Find matching context by API server URL
for ctx in $contexts; do
cluster_name=$(oc config view -o jsonpath="{.contexts[?(@.name=='$ctx')].context.cluster}")
server=$(oc config view -o jsonpath="{.clusters[?(@.name=='$cluster_name')].cluster.server}")
if [ "$server" = "$target_url" ]; then
echo "$ctx"
break
fi
done
Retrieve token from context
oc whoami -t --context=$context_name
This ensures we get the token from the correct cluster by matching the exact API server URL, even when multiple cluster contexts exist.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub openshift-eng/ai-helpers --plugin ci36 skills in this plugin
/add-jira-triage-linkAdd a Component Readiness triage record link to a JIRA issue description/bulk-triage-regressionsUse this skill for Component Readiness triage duty - holistically analyze and triage all untriaged regressions for a set of components in a view, clustering them into root-cause buckets/detect-permafailAnalyze consecutive job failures to determine if they represent a permafail pattern versus flaky failures/diagnose-job-run-symptomsExplain which Sippy Symptoms and failure Labels apply to a Prow CI job run, in plain language, given only the Prow URL/fetch-jira-issueFetch JIRA issue details including status, assignee, comments, and progress classification/fetch-job-run-summaryFetch a Prow job run summary from Sippy showing all failed tests grouped by SIG with error messagesOther plugins' skills for the same job