Manage Semaphore CI/CD via sem-ai CLI. Covers CI status, pipeline failures, test results, deployments, secrets, notifications, scheduled tasks, deployment targets, project health, and related workflows.
Ships in sem-ai. 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.
None: SKILL.md is the whole skill.
sem-ai is a CLI that gives you full control over Semaphore CI/CD. Every command returns structured JSON. 77 commands covering projects, workflows, pipelines, jobs, tests, artifacts, secrets, deploys, and more.
# Connect (one-time). Get your token at https://me.semaphoreci.com/account
sem-ai connect <your-org>.semaphoreci.com <your-api-token>
# Verify
sem-ai context show
sem-ai discover # Full capability map (77 commands + flags + examples)
sem-ai <any-command> --examples # Usage examples for any command
| Task | Command |
|---|---|
| CI status | sem-ai status (--project/--branch auto-detect; --pr N resolves a PR's workflow) |
| Did my push pass? / watch CI to green | sem-ai status (or until sem-ai status --exit-code; do sleep 20; done); see watch-after-push |
| Why did CI fail? | sem-ai diagnose <workflow-id> |
| Project health | sem-ai health --project <p> |
| Job logs | sem-ai job log <job-id> |
| Test results | sem-ai test summary --pipeline <id> |
| Rerun workflow | sem-ai workflow rerun <id> |
| Rebuild failed only | sem-ai rerun-failed <pipeline-id> |
| Deploy to staging | sem-ai pipeline promote <id> --target "Staging" --confirm |
| Deploy and wait | sem-ai promote-and-wait <id> --target "Staging" --confirm |
| Validate YAML | sem-ai yaml validate --file .semaphore/semaphore.yml |
| Server diagnostics | sem-ai troubleshoot workflow <id> |
| List secrets | sem-ai secret list |
| Flaky tests | sem-ai test flaky (--project optional; auto-detects) |
| Test locally in CI env | sem-ai testbox warmup (--project optional) then sem-ai testbox run --id <id> "cmd" |
| Watch CI after a push | git push, then sem-ai watch <workflow-id> (see watch-after-push) |
For the is-it-green check, prefer sem-ai status — it keeps the failure drill (sem-ai diagnose <workflow-id>) one tool away. Your git host's own checks (gh pr checks on GitHub, or the GitLab/Bitbucket equivalent) mirror the same Semaphore result and are a fine fallback when sem-ai isn't connected — Semaphore connects to any of those hosts.
--project is optional on all repo-scoped commands (status, workflow list/run, pipeline list, deploy targets/create, task list/create, test flaky, diagnose, health, open, analytics) — it auto-detects from the origin git remote (ssh or https) when omitted, so there's no need to pass it inside a checkout. --branch likewise auto-detects from HEAD; sem-ai status pins the current HEAD commit ("matched_by":"commit_sha", falling back to "latest_on_branch"). Pass --project/--branch only to override.
Caveat: if the repo maps to multiple Semaphore projects, sem-ai status returns all of them ("multiple_projects": true) instead of guessing — pass --project <name> to pick one. (To target a specific run regardless, filter workflow list by commit_sha; see the watch-after-push skill.)
~/.sem.yaml can hold many contexts, one per organization, and active-context names the one commands use by default. That key is shared mutable state: context switch, connect, and signin all write it, so another session or agent on the same machine can move it between two of your commands and the second one silently runs against the wrong organization.
With more than one context, pin the organization instead of reading the shared key:
sem-ai --context myorg_semaphoreci_com status # this invocation only
export SEM_CONTEXT=myorg_semaphoreci_com # every later call in this shell
sem-ai context list # names and which one is active
Pin even on a machine with one context: another session's connect or signin adds a second and makes it active, so being alone in the file is not a property that survives the session.
Resolution order: --context > SEM_CONTEXT > SEMAPHORE_HOST/SEMAPHORE_API_TOKEN > active-context. A named context fully shadows the credential env vars, so its host and token always travel together. An unknown name fails immediately and lists what is available. Neither selector writes to ~/.sem.yaml.
Over MCP, context is a parameter on every tool — pass it per call. sem-ai mcp --context <name> pins a whole server, and a per-call context still overrides it.
Rules of thumb:
context switch to set up for a later command. It mutates the shared key for every session on the machine, and it does not reliably persist across separate shell invocations in an agent harness anyway. Pin instead.context switch is for a human deliberately changing their default, not for scoping one command.connect, signin, context switch, and context list ignore the selectors, so naming a context that does not exist yet does not block the command that creates it. The selector is ignored rather than applied — connect names the context after its host, so --context neworg connect neworg.semaphoreci.com TOKEN creates neworg_semaphoreci_com; re-pin to that name afterwards. Giving connect a <host> plus a selector resolving to a different host is refused, not guessed.connect and signin are deliberately not MCP tools (a device flow would hold the server's lock and hide its one-time code; connect's two positional arguments cannot be encoded as tool arguments). Run them in a shell, then use the context they created.context list marks the file's active context, and each row's pinned says which one the current invocation selected; context show reports what this invocation resolves to. A selector that resolves to a host different from the one connect/signin was given is refused rather than silently ignored.~/.sem.yaml (connect, signin, context switch) replace the whole file, so two of them overlapping is last-writer-wins for the entire config. Sequence them; don't run them concurrently from several sessions.For detailed workflows with step-by-step examples, load the relevant sub-skill:
debug-pipeline — diagnosing, reading logs, fixing CItestbox — run tests in real Semaphore env before pushingdeploy — promotions, deployment targets, deploy-and-waittest-intelligence — test results, flaky detection, frameworksmanage-infra — secrets, notifications, agents, tasksproject-health — health checks, pass rates, trendswatch-after-push — find the run for your commit and watch it to completionpipeline promote requires --confirm to execute. Without it: dry-run preview only.--override bypasses promotion conditions — use with caution.--format table for human display.Success: JSON to stdout, exit 0.
Error: {"error": true, "code": "not_found", "message": "...", "status": 404} to stderr, exit 1.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/sem-ai:semaphore-cifrom sem-ai
npx claudepluginhub semaphoreio/sem-ai --plugin sem-ai18 skills in this plugin
/debug-pipelineDiagnose and fix CI pipeline failures. Step-by-step debugging with sem-ai./deployDeploy via Semaphore promotions. Manage deployment targets, promote pipelines, deploy-and-wait./fix-flakyTriage and FIX flaky tests on a Semaphore project end-to-end — find the worst offenders, pull history, locate the test in the code, diagnose the root cause, write a fix or justified quarantine, and verify by re-running. Use whenever the user wants to fix/investigate flaky tests, de-flake CI, reduce intermittent failures, asks "why is CI randomly red", wants to quarantine a flake, or after `sem-ai flaky list` surfaces offenders. Goes BEYOND detection (test-intelligence) to root-cause + code change + verification./gha-to-semaphoreTranslate a repo's GitHub Actions workflows into an equivalent Semaphore pipeline. ONLY covers the GHA→Semaphore mapping and conversion procedure; for Semaphore-side depth (cache CLI, test-results, blocks structure, sharding, promotions) defer to the linked skills. Use when the user asks to convert/port/migrate GitHub Actions to Semaphore, says "translate this workflow" or "convert ci.yml", or the repo has `.github/workflows/` and the user wants Semaphore instead. Can be invoked directly as `/sem-ai:gha-to-semaphore` (or via the broader `/sem-ai:init` orchestrator)./initInitialize Semaphore CI/CD for the current repository — bootstrap the Semaphore project, write a working `.semaphore/semaphore.yml` (translating from GitHub Actions if present, or from scratch), wire required secrets, validate, and watch the first workflow. Applies Semaphore-side defaults automatically — agent image, toolbox CLIs, `test-results` epilogue rule, sharding heuristics — by routing through the linked skills. Use when the user wants to set up CI on Semaphore, says "initialize", "bootstrap CI", "prepare CI/CD for this project", "create a workflow on Semaphore", "make a `.semaphore` config", or runs `/sem-ai:init`./manage-infraManage Semaphore infrastructure — secrets, notifications, agent types, scheduled tasks, artifacts.Other plugins' skills for the same job