Skip to content

feat(cli): rename policy list to bundles, confirm publish, simplify activate#271

Merged
Utsav-Patel merged 5 commits into
mainfrom
utsav/policy-cli-bundles-publish-confirm-activate-simplify
Jul 8, 2026
Merged

feat(cli): rename policy list to bundles, confirm publish, simplify activate#271
Utsav-Patel merged 5 commits into
mainfrom
utsav/policy-cli-bundles-publish-confirm-activate-simplify

Conversation

@Utsav-Patel

@Utsav-Patel Utsav-Patel commented Jul 7, 2026

Copy link
Copy Markdown
Member

Related Issues

Follow-up to the merged policy CLI work in #264 (deactivate, kebab-case flags). This PR finishes policy bundle lifecycle UX: consistent subcommand naming, safer publish, and simpler activate.

Public Changelog

  • Renamed: transcend policy listtranscend policy bundles (parallel to transcend policy versions).
  • Updated: transcend policy publish now prompts before creating a brand-new bundle when --bundle-name does not exist; pass --yes to skip the prompt in CI/non-interactive runs.
  • Updated: transcend policy activate accepts only --bundle-name and optional --version (raw label); removed --policy-bundle-id.

Internal Changelog

  • Renamed the list subcommand to bundles and updated routes, docs, and tests.
  • Added interactive confirmation in publish for unknown bundle names using inquirerConfirmBoolean; non-TTY without --yes fails fast.
  • Simplified activate to resolve bundle name internally (mirrors deactivate); deleted unused resolvePolicyBundleId helper.
  • Updated deactivate help copy to reference publish/bundles instead of publish/list.
  • Added unit tests for activate and expanded publish confirmation coverage.
  • Merged latest main, resolved policy CLI merge conflicts, and updated .changeset/link-7227-policy-deactivate.md so check:changeset passes.
Implementation details

Key files

  • packages/cli/src/commands/policy/bundles/ — renamed from list/
  • packages/cli/src/commands/policy/publish/{command,impl}.ts--yes flag + confirmation prompt
  • packages/cli/src/commands/policy/activate/{command,impl,readme}.ts — name-only activation
  • packages/cli/src/commands/policy/activate/tests/impl.test.ts — new tests
  • packages/cli/src/commands/policy/deactivate/command.ts — help text consistency
  • packages/cli/src/commands/policy/helpers/resolvePolicyBundleId.ts — deleted
  • .changeset/link-7227-policy-deactivate.md — release notes for bundles rename, publish confirm, activate simplify

Notes

  • --yes is scoped to publish only; existing bundles still upload new versions without prompting.
  • activate still resolves --version to a version record via resolvePolicyBundleVersion; when omitted, picks latest by createdAt.

Test plan

  • pnpm run --dir packages/cli test -- src/commands/policy
  • pnpm run --dir packages/cli build
  • pnpm run --dir packages/cli docgen
  • CI (global, cli, preview) passing
  • transcend policy bundles --auth=$TRANSCEND_API_KEY
  • transcend policy publish --dir=./policies --bundle-name=typo-name prompts before creating
  • transcend policy publish --dir=./policies --bundle-name=new-bundle --yes creates without prompt
  • transcend policy activate --bundle-name=main --version=<label> activates by name only

Made with Cursor

Mirror the `activate` subcommand layout to take a policy bundle's active
version offline by bundle name. Resolves `--bundle-name` to the parent
bundle UUID internally, then POSTs
`v1/policy-engine/policy-bundles/{id}/deactivate` (no body). Rewrites the
monolith 409 (no active version) to reference the user-supplied bundle
name, and fails CLI-side on unknown bundle names before hitting the API.
Rename the camelCase CLI flags across the policy command group to
kebab-case (e.g. --bundleName -> --bundle-name, --transcendUrl ->
--transcend-url, --policyBundleId -> --policy-bundle-id, --dryRun ->
--dry-run). Single-word flags (--auth, --json, --version, --dir, --limit,
--offset, --after, --description, --pkg, --input, --bundle) are unchanged.

stricli has no per-command case-style toggle, so this is done by defining
the flag keys as kebab-case strings in each policy command.ts. stricli
then displays and accepts --kebab-case (and rejects --camelCase input with
a "did you mean" suggestion). Scoped to the policy command group only --
no global app config change, so request/consent/inventory/admin/migration
commands are unaffected.

Impl functions keep camelCase local variable names via destructuring
renaming, so internal logic and the shared helpers are unchanged. README
command docs regenerated.
…ctivate

Rename transcend policy list to bundles for parity with versions.
Prompt before creating a new bundle on publish (--yes for CI).
Require bundle name only on activate (no UUID flags).
@Utsav-Patel Utsav-Patel self-assigned this Jul 7, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@transcend-io/airgap.js-types

pnpm add https://pkg.pr.new/@transcend-io/airgap.js-types@271
yarn add https://pkg.pr.new/@transcend-io/airgap.js-types@271.tgz

@transcend-io/cli

pnpm add https://pkg.pr.new/@transcend-io/cli@271
yarn add https://pkg.pr.new/@transcend-io/cli@271.tgz

@transcend-io/internationalization

pnpm add https://pkg.pr.new/@transcend-io/internationalization@271
yarn add https://pkg.pr.new/@transcend-io/internationalization@271.tgz

@transcend-io/privacy-types

pnpm add https://pkg.pr.new/@transcend-io/privacy-types@271
yarn add https://pkg.pr.new/@transcend-io/privacy-types@271.tgz

@transcend-io/sdk

pnpm add https://pkg.pr.new/@transcend-io/sdk@271
yarn add https://pkg.pr.new/@transcend-io/sdk@271.tgz

@transcend-io/type-utils

pnpm add https://pkg.pr.new/@transcend-io/type-utils@271
yarn add https://pkg.pr.new/@transcend-io/type-utils@271.tgz

@transcend-io/utils

pnpm add https://pkg.pr.new/@transcend-io/utils@271
yarn add https://pkg.pr.new/@transcend-io/utils@271.tgz

@transcend-io/mcp

pnpm add https://pkg.pr.new/@transcend-io/mcp@271
yarn add https://pkg.pr.new/@transcend-io/mcp@271.tgz

@transcend-io/mcp-server-admin

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-admin@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-admin@271.tgz

@transcend-io/mcp-server-assessment

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-assessment@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-assessment@271.tgz

@transcend-io/mcp-server-base

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-base@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-base@271.tgz

@transcend-io/mcp-server-consent

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-consent@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-consent@271.tgz

@transcend-io/mcp-server-discovery

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-discovery@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-discovery@271.tgz

@transcend-io/mcp-server-docs

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-docs@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-docs@271.tgz

@transcend-io/mcp-server-dsr

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-dsr@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-dsr@271.tgz

@transcend-io/mcp-server-inventory

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-inventory@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-inventory@271.tgz

@transcend-io/mcp-server-preferences

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-preferences@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-preferences@271.tgz

@transcend-io/mcp-server-workflows

pnpm add https://pkg.pr.new/@transcend-io/mcp-server-workflows@271
yarn add https://pkg.pr.new/@transcend-io/mcp-server-workflows@271.tgz

commit: c26095f

Base automatically changed from utsav/link-7227-implement-transcend-policy-deactivate-subcommand to main July 7, 2026 20:16
…ivate-simplify

Resolve policy CLI conflicts keeping bundles rename, publish confirmation,
and activate simplification. Update changeset to cover all CLI changes.
…ivate-simplify

Resolve changeset conflict: main consumed link-7227-policy-deactivate via
Version Packages (#272). Add a new changeset for bundles rename, publish
confirmation, and activate simplification.
@Utsav-Patel Utsav-Patel requested review from a team and MadDataScience July 7, 2026 21:51
@Utsav-Patel Utsav-Patel added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 4fc9b4b Jul 8, 2026
4 checks passed
@Utsav-Patel Utsav-Patel deleted the utsav/policy-cli-bundles-publish-confirm-activate-simplify branch July 8, 2026 20:27
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