sdk/apps/cli/.cline/skills/publish-cli/SKILL.md
Use this skill when the user asks to release the CLI, publish cline, bump the CLI version, draft release notes, create a cli-vX.Y.Z tag, or trigger the CLI publish workflow.
The CLI is npm-only. Do not add alternate distribution or signing steps.
Working directory: this skill lives in the SDK sub-monorepo. Run
cd sdk(from the repo root) before any of the shell commands below. Paths in commands and instructions (e.g.apps/cli/package.json,bun release cli) are written relative tosdk/.
The skill should guide the user through one release preparation flow, then offer the publish path options. The two normal publish paths are GitHub Actions and local publishing from an authenticated machine.
apps/cli/package.json.cli-vX.Y.Z, where X.Y.Z matches apps/cli/package.json.X.Y.Z-nightly.TIMESTAMP.apps/cli/CHANGELOG.md update..github/workflows/publish-cli.yaml.bun release cli.--tag latest and --tag nightly are npm registry channels. cli-vX.Y.Z is a git tag for source history and GitHub releases.main, requires an existing cli-vX.Y.Z tag, checks out that tag, and publishes from it.nightly dist-tag and does not create a tag.cli-vX.Y.Z to point at HEAD locally and on origin before publishing.gh to be authenticated with release permissions for the repo.git status --short --branch
git fetch origin --tags
git tag --list 'cli-v*' --sort=-v:refname | head -10
node -p "require('./apps/cli/package.json').version"
Find the latest CLI tag. If there is no cli-v* tag, use the first relevant CLI release commit as the baseline and say that the baseline is inferred.
git log <last-cli-tag>..HEAD --oneline --no-merges -- apps/cli packages scripts .github/workflows/publish-cli.yaml
If the release includes broader SDK changes that affect the CLI, also inspect commits outside apps/cli.
Include user-facing features, fixes, behavior changes, compatibility changes, and notable install or release changes. Exclude pure refactors, tests, style, chores, and internal file moves unless they matter to users.
Write a flat bullet list. Translate commit messages into user-facing language. If a commit is unclear, read the full commit before summarizing it.
Present the draft and wait for approval before editing files.
Ask whether this should be patch, minor, major, or an explicit version. Do not guess if the user has not made it clear.
Update apps/cli/package.json to the approved version.
Prepend a section to apps/cli/CHANGELOG.md for the approved version using the approved release notes. Use the header format ## X.Y.Z with no date. The publish workflow extracts the top section of the changelog by matching ^## [0-9] and pastes it verbatim into the GitHub release body and the Slack release announcement, so the section content is the release notes that get shipped.
Run focused checks first:
bun -F @cline/cli typecheck
bun -F @cline/cli test:unit
For higher confidence, run:
bun run types
bun --cwd apps/cli run build:platforms:single
If the user wants full release confidence before tagging, run:
bun run test
bun --cwd apps/cli run build:platforms
Only after the user approves the notes and version:
git add apps/cli/package.json apps/cli/CHANGELOG.md
git commit -m "chore(cli): release vX.Y.Z"
Ask before pushing the release commit:
git push origin HEAD
For the GitHub main release path, ask before creating and pushing the release tag:
git tag -a cli-vX.Y.Z -m "CLI vX.Y.Z"
git push origin refs/tags/cli-vX.Y.Z
Ask the user which path to use:
main and the matching cli-vX.Y.Z tag has been pushed. The workflow publishes to npm from that tag, creates the GitHub release, and posts to Slack.For GitHub main release:
gh workflow run publish-cli.yaml -f publish_target=main -f git_tag=cli-vX.Y.Z -f confirm_publish=publish
gh run list --workflow=publish-cli.yaml --limit=1 --json url,status,conclusion,createdAt --jq '.[0]'
For GitHub nightly release:
gh workflow run publish-cli.yaml -f publish_target=nightly
For forced GitHub nightly release:
gh workflow run publish-cli.yaml -f publish_target=nightly -f force_nightly_publish=true
For local publish:
gh auth status
npm whoami
git tag -a cli-vX.Y.Z -m "CLI vX.Y.Z"
git push origin refs/tags/cli-vX.Y.Z
bun release cli
After a successful local publish, ask before running:
gh release create cli-vX.Y.Z --verify-tag --title "CLI vX.Y.Z" --notes "Paste the approved release notes here."
If publishing with another npm dist-tag:
bun release cli --tag next
Report: