Skip to content

feat(cli): change package visibility from the CLI - #174

Merged
mrgoonie merged 2 commits into
mainfrom
claude/admiring-ritchie-asi01y
Nov 2, 2026
Merged

mrgoonie merged 2 commits into
mainfrom
claude/admiring-ritchie-asi01y

Conversation

@mrgoonie

@mrgoonie mrgoonie commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closes #172

What

  • New skillx visibility get <@publisher/slug> and skillx visibility set <@publisher/slug> <public|unlisted|private> [--from] [--registry] [--json]. set posts the existing audited compare-and-set (POST /api/v1/packages/@x/y/visibility, {from, to}) with the owner's unscoped account key; from is --from or read first. When target equals from, the stored value is confirmed and nothing is written.
  • GET /api/v1/packages/@x/y/releases now reports visibility (additive; only callers who may already read the list see it, non-public answers stay private, no-store).
  • release.visibility_mismatch: the registry message now names the next step (CLI for a narrowing, dashboard for a widening), and the CLI publish error adds a hint with skillx visibility set … and <registry>/dashboard.
  • Refusal hints: visibility.approval_required → dashboard URL, visibility_conflict → re-read with get, 401 → use an unscoped account key.

Security policy unchanged: an API key may only narrow; widening still needs a signed-in, approved dashboard session (server decides).

Evidence

  • pnpm typecheck — all 4 packages pass.
  • pnpm test — 158 files, 2896 passed, 3 skipped.
  • New apps/web/tests/creator/cli-visibility-roundtrip.test.ts runs the CLI's runVisibilityGet/Set against the real list loader and owner visibility handler (in-process D1): narrowing public→unlisted→private is audited, widening is refused with the dashboard hint and writes nothing, stale --from, publish keys and other accounts are refused.
  • pnpm --filter skillx-sh build then node packages/cli/bin/skillx.js visibility --help lists get and set.
  • Isolated code review: one finding (--from equal to target trusted without a read) fixed in the second commit; dead deleted-package hint removed; mismatch message made direction-aware.

Docs

docs/cli-reference.md (new section, publish flag text), docs/api-reference.md (list response, owner management), packages/cli/README.md, CLAUDE.md.


Generated by Claude Code

Add `skillx visibility get|set <@publisher/slug>`. `set` posts the
audited compare-and-set to the owner visibility endpoint with the
owner's unscoped account key (`--from`, else read first). A key may
only narrow; widening is refused by the registry and the hint names the
dashboard, as do stale-from, scoped-key and deleted-package refusals.

The release list now reports the package `visibility`, which `get` and
`set` read. A publish refused with `release.visibility_mismatch` names
the next step both in the registry message and in the CLI hint.

Refs #172

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FL32rutkqdxB36bmy1tBt2
`skillx visibility set <pkg> <v> --from <v>` returned "already <v>"
without asking the registry, so a public package could be reported as
private. The CLI now reads the stored value and refuses a mismatch as
`visibility_conflict`. The registry's mismatch message names the CLI
only for a narrowing, since a widening needs the dashboard, and the
unreachable deleted-package hint is gone (that case answers 404).

Refs #172

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FL32rutkqdxB36bmy1tBt2
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.

cli: allow changing package visibility from the CLI (release.visibility_mismatch)

2 participants