opencode-check-beta
v0.1.0
Published
Inspect the last successful opencode beta publish — when it happened, which PRs are in it, and whether your local opencode is up to date.
Maintainers
Readme
opencode-check-beta
A tiny CLI that inspects the last successful opencode beta publish:
- when the beta pipeline last went green,
- which pull requests are in that beta build,
- whether your locally installed
opencodematches thebetadist-tag on npm, - a summary of recent beta publish attempts so you can see if the pipeline is currently healthy.
It talks to GitHub (via the gh CLI) and the npm registry (via fetch) — no repo clone required.
Install
# one-shot, no install
npx opencode-check-beta
# or install globally
npm i -g opencode-check-beta
opencode-check-betaRequirements
- Node.js >= 20 (uses built-in
fetch) ghon yourPATH, authenticated withgh auth login(needsreposcope;read:orgis useful for private repos)
Usage
opencode-check-beta # formatted report
opencode-check-beta --json # JSON output for scripting
opencode-check-beta --no-color # disable ANSI codes
opencode-check-beta --helpExample output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
opencode beta status anomalyco/opencode
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Last successful publish (publish.yml on beta)
✓ 2026-04-18 00:01 UTC (13h ago)
sha 33ed3f3a96
run https://github.com/anomalyco/opencode/actions/runs/24590947448
Last successful beta sync (beta.yml) (newer than publish — pending publish may be failing or queued)
✓ 2026-04-18 08:43 UTC (4h ago)
run https://github.com/anomalyco/opencode/actions/runs/24600692194
Installed vs latest (opencode-ai@beta)
installed 0.0.0-beta-202604172053
latest 0.0.0-beta-202604180252 published 10h ago
status ⚠ out of date — 6h behind latest beta
update: npm i -g opencode-ai@beta
PRs included in this beta (13 via Apply PR #N: commits)
#11710 open feat: include cleared prompts in the history
by @ariane-emory · merged 15h ago [contributor]
#23020 merged refactor: pass formatter instance context explicitly
by @kitlangton · merged 14h ago [contributor, Vouched]
...
Recent publish runs (last 8 on beta)
✗ 2026-04-18 09:22 UTC failure f0527971 https://github.com/...
✓ 2026-04-18 00:01 UTC success 33ed3f3a https://github.com/...
...How it works
- Queries GitHub Actions for the most recent successful
publish.ymlrun on thebetabranch. That run'sheadShais the commit that was actually shipped to npm asopencode-ai@beta. - Walks the
dev...<sha>compare and extracts PR numbers from merge commits with messages shaped likeApply PR #<number>: <title>— that's the exact convention the opencodescript/beta.tssync uses. - Hydrates each PR with its current
state,merged, author, labels viagh api. - Also fetches the most recent successful
beta.yml(the sync workflow) and flags the case where the sync is newer than the publish — i.e. new PRs landed onbetabut the publish is currently failing. - Hits
https://registry.npmjs.org/opencode-aito read thebetadist-tag and its publish time. - Runs
opencode --versionand compares the embeddedYYYYMMDDHHmmtimestamp with the npm version's timestamp to report how far behind you are.
Configuration
All overrides are environment variables, all optional:
| Variable | Default | Purpose |
| ----------------------------- | -------------------- | ------------------------------------------- |
| CHECK_BETA_REPO | anomalyco/opencode | GitHub repo |
| CHECK_BETA_BRANCH | beta | Branch that publish.yml runs on |
| CHECK_BETA_BASE_BRANCH | dev | Branch the beta sync is based on |
| CHECK_BETA_PUBLISH_WORKFLOW | publish.yml | Workflow that publishes to npm |
| CHECK_BETA_SYNC_WORKFLOW | beta.yml | Workflow that assembles the beta branch |
| CHECK_BETA_NPM_PACKAGE | opencode-ai | npm package whose beta tag to inspect |
| CHECK_BETA_NPM_TAG | beta | npm dist-tag to inspect |
| CHECK_BETA_BIN | opencode | Local binary to invoke for --version |
Exit codes
| Code | Meaning |
| ---- | ---------------------------------------------------------------------------- |
| 0 | Healthy — installed matches the latest published beta |
| 1 | Fatal error (GitHub unreachable, no successful runs, bad auth, etc.) |
| 2 | Installed version is outdated or does not match the npm beta tag |
| 3 | Local opencode binary not found on PATH |
| 4 | Last successful beta sync is newer than last successful publish (publish currently failing or queued) |
The non-zero codes are deliberately distinct so the tool is usable in pre-commit hooks, CI checks, or a shell prompt indicator.
JSON output
--json emits a stable shape for scripting. Useful queries with jq:
# Are we up to date?
opencode-check-beta --json | jq -r '.versionStatus.kind'
# Which PR numbers are in the current beta?
opencode-check-beta --json | jq '[.includedPRs[].number]'
# SHA that's currently published
opencode-check-beta --json | jq -r '.lastSuccessfulPublish.headSha'License
MIT
