Skip to content

feat(cli): @upwell/cli with local document commands (plan 05 session 1) - #12

Merged
ommgh merged 2 commits into
mainfrom
cli-package
Nov 14, 2026
Merged

ommgh merged 2 commits into
mainfrom
cli-package

Conversation

@ommgh

@ommgh ommgh commented Nov 13, 2026

Copy link
Copy Markdown
Member

Plan 05 session 1: the packages/cli workspace package, published as @upwell/cli with an upwell bin.

Commands

  • policy validate, policy set latest|minimum|ota-runtime
  • releases add (also --from-eas-update with the output of eas update --json), releases list|remove|validate
  • explain: runs @upwell/core's engine for a device described by flags (--play-version-code, --app-store-version, --ota, --no-policy, --now, …)
  • schema policy|releases

Behavior

  • --json on every command: { ok: true, data } or { ok: false, error: { code, message, … } }. Exit codes: 0 ok · 1 failed · 2 usage · 3 confirmation required.
  • Never prompts without a terminal, with CI set, or with --json. Writes show a diff and need --yes. Changes that affect existing installs (raising minimum, lowering latest, changing ota.latestRuntimeVersion) need --confirm and say who is affected. --dry-run everywhere.
  • Edits keep formatting: documents are edited as text with jsonc-parser's modify(), so setting latest on docs/examples/policy.json is a one-line diff and inline objects stay inline.
  • A change that would make the document invalid is refused with the validator's errors.

Decisions that differ from the plan (recorded in docs/plans/05-cli.md): Jest instead of Vitest (one runner in the repo), --kind required even with --from-eas-update, plus a releases validate command.

Testing

  • 59 Jest tests run the commands in-process with a fake terminal (prompts, CI, --json, risks, formatting, EAS output with shared and per-platform runtimes).
  • New CI step npm run test:bundle -w @upwell/cli runs the built dist/index.js. It already caught jsonc-parser's UMD main, which the bundler can't follow (now aliased to its ESM build).
  • Locally: lint, typecheck, test and build pass for every workspace; the docs site builds with the new reference/cli page.

Before releasing

  • Bootstrap @upwell/cli on npm by hand once and add the trusted publisher (as in plan 02). Do this before merging the "version packages" PR that includes @upwell/cli, or its publish fails.

package-lock.json churn comes from npm re-hoisting dev dependencies for the new workspace (tsdown 0.23.7 / rolldown 1.3.2 now hoisted) and from syncing a stale @upwell/core entry.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RX4BmNghPADsZ6GMRb2ALH

New workspace package `packages/cli`, published as `@upwell/cli` with an
`upwell` bin: policy validate, policy set latest|minimum|ota-runtime,
releases add (incl. --from-eas-update), releases list|remove|validate,
explain and schema.

- --json on every command with a stable { ok, data | error } shape, error
  codes and exit codes (0 ok, 1 failed, 2 usage, 3 confirmation required)
- never prompts without a terminal, with CI set or with --json: writes need
  --yes, changes that affect existing installs (raising minimum, lowering
  latest, changing the OTA runtime) need --confirm and say who is affected
- edits keep the file's formatting (jsonc-parser modify), so a change only
  touches its own lines in review; --dry-run shows the diff
- explain runs @upwell/core's engine, with flags for Play / App Store / OTA
  info and --no-policy
- Jest tests run commands in-process; CI also runs the built bundle
- docs: reference/cli page, CLI in "Validating in CI"; plan 05 updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RX4BmNghPADsZ6GMRb2ALH
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
upwell-docs Ready Ready Preview Nov 14, 2026 7:41am UTC

@ommgh
ommgh merged commit 471aa57 into main Nov 14, 2026
6 checks passed
@ommgh
ommgh deleted the cli-package branch November 14, 2026 07:59
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.

1 participant