Skip to content

feat: release process for browser4-cli#379

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/design-release-process-for-browser4-cli
Draft

feat: release process for browser4-cli#379
Copilot wants to merge 2 commits intomasterfrom
copilot/design-release-process-for-browser4-cli

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@platonai/browser4-cli had no package scaffold or automated publish pipeline. This PR adds the full release infrastructure.

Package scaffold — sdks/browser4-cli/

  • src/cli.ts — Commander-based CLI with session create/close and tool <name> [k=v…] commands; global --base-url / --session-id options
  • src/client.ts — thin HTTP client over Browser4's REST/MCP API (createSession, callTool, closeSession)
  • src/version.ts — single source of truth for the version string (kept in sync by the release script)
  • tests/client.test.ts — 5 unit tests covering construction, session gating, and version consistency
  • Standard tooling: tsconfig.json, jest.config.js, .eslintrc.js, .npmignore, README.md, CHANGELOG.md
# Quick usage
SESSION=$(browser4 session create)
browser4 --session-id "$SESSION" tool navigate url=https://example.com
browser4 --session-id "$SESSION" tool aria_snapshot
browser4 session close "$SESSION"

CI release workflow — .github/workflows/publish-cli.yml

Triggered on cli-v* tag push or workflow_dispatch:

build (lint → test → tsc → verify → pack dry-run)
  └─ smoke-test matrix (ubuntu / macos / windows × node 18 / 20)
       └─ publish to npm (--provenance, gated by "npm" environment)
            └─ create GitHub Release  [tag push only]
  • Tag format cli-v<X.Y.Z[-pre]> is validated before version extraction
  • npm dist-tag (latest / beta / rc / next) auto-inferred from version suffix
  • dist/ artefacts uploaded once in build and reused by downstream jobs

Release scripts — bin/release/release-cli.sh / .ps1

./bin/release/release-cli.sh 0.2.0        # stable → published as "latest"
./bin/release/release-cli.sh 0.2.0-rc.1  # pre-release → published as "rc"

Each script validates the version, bumps package.json + version.ts, commits, creates an annotated cli-v<version> tag, and pushes — triggering the workflow above.

bin/release/README.md updated with the new CLI release steps.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: galaxyeye <1701451+galaxyeye@users.noreply.github.com>
Agent-Logs-Url: https://github.com/platonai/Browser4/sessions/ef8317d7-6a47-4963-af29-bf0153f0b218
Copilot AI changed the title [WIP] Design release process for browser4-cli feat: release process for browser4-cli Mar 23, 2026
Copilot AI requested a review from galaxyeye March 23, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants