Skip to content

feat(cli): default --auth to TRANSCEND_API_KEY env var#255

Open
Utsav-Patel wants to merge 5 commits into
mainfrom
utsav/link-7225-cli-default-auth-to-transcend-api-key-env-var
Open

feat(cli): default --auth to TRANSCEND_API_KEY env var#255
Utsav-Patel wants to merge 5 commits into
mainfrom
utsav/link-7225-cli-default-auth-to-transcend-api-key-env-var

Conversation

@Utsav-Patel

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

Copy link
Copy Markdown
Member

Related Issues

Public Changelog

  • Added: --auth now defaults to the TRANSCEND_API_KEY environment variable when set, so API-authenticated commands can omit the flag after exporting it once. When unset, --auth remains required (backward compatible).
  • Updated: --transcendUrl and --consentUrl flag help now documents the existing TRANSCEND_API_URL / TRANSCEND_CONSENT_API_URL env-var defaults.
  • Updated: transcend policy publish labels uploads {bundleName}-yyyy-mm-dd-hh-mm-ss (UTC) when --version is omitted, and prints the exact transcend policy activate command after a successful upload.
  • Updated: transcend policy activate accepts an optional --version label instead of --versionId; when omitted, activates the latest uploaded version by createdAt.

Internal Changelog

  • Updated: Policy Engine authoring UX — env-based auth defaults, version labels, and publish→activate guidance across all API-authenticated CLI commands (~43) via central createAuthParameter.
Implementation details

Why

Customers run transcend policy publish / activate / list / versions repeatedly in a shell or CI session. Requiring --auth on every invocation is friction; exporting TRANSCEND_API_KEY once matches the existing TRANSCEND_API_URL convention. Version labels and post-publish hints shorten the publish→activate loop.

Resolution order

--auth

TRANSCEND_API_KEY env --auth flag Resolved auth
unset not passed error: --auth required (unchanged)
unset passed flag value (unchanged)
set not passed env var value
set passed flag value (flag wins)

--transcendUrl (existing behavior, now documented)

TRANSCEND_API_URL env --transcendUrl flag Resolved URL
unset not passed https://api.transcend.io (unchanged)
unset passed flag value (unchanged)
set not passed env var value
set passed flag value (flag wins)

--consentUrl behaves identically with TRANSCEND_CONSENT_API_URLhttps://consent.transcend.io.

Key files

  • packages/cli/src/constants.tsDEFAULT_TRANSCEND_API_KEY from process.env.TRANSCEND_API_KEY
  • packages/cli/src/lib/cli/common-parameters.ts — auth/url/consent parameter defaults and briefs
  • packages/cli/src/commands/policy/publish/impl.ts — default version label + activation hint
  • packages/cli/src/commands/policy/activate/impl.ts--version label resolution
  • packages/cli/src/commands/policy/helpers/resolvePolicyBundleVersion.ts — label lookup / latest-by-createdAt
  • packages/cli/src/commands/policy/helpers/defaultPolicyVersionLabel.ts{bundleName}-yyyy-mm-dd-hh-mm-ss
  • .changeset/transcend-api-key-env-default.md@transcend-io/cli minor

Epic: LINK-6822

The `--auth` flag now falls back to the `TRANSCEND_API_KEY` environment
variable when not passed explicitly, mirroring the existing
`TRANSCEND_API_URL` -> `--transcendUrl` convention. An explicit `--auth`
still takes precedence; when the env var is unset, `--auth` remains
required (backward compatible).

This is a central change to `createAuthParameter`, so all ~43
API-authenticated commands (policy, request, consent, inventory,
migration/sync-ot) benefit, including every `transcend policy *` API
command (publish, activate, list, versions). Local-only policy commands
(eval, lint, test) and `sombraAuth` are unaffected.

Docs regenerated via `pnpm docgen`; env-only examples added to the four
API policy commands and a top-level auth note added to the README.

Closes LINK-7225.
@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

LINK-7225

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@transcend-io/airgap.js-types

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

@transcend-io/cli

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

@transcend-io/internationalization

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

@transcend-io/privacy-types

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

@transcend-io/sdk

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

@transcend-io/type-utils

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

@transcend-io/utils

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

@transcend-io/mcp

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

@transcend-io/mcp-server-admin

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

@transcend-io/mcp-server-assessment

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

@transcend-io/mcp-server-base

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

@transcend-io/mcp-server-consent

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

@transcend-io/mcp-server-discovery

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

@transcend-io/mcp-server-dsr

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

@transcend-io/mcp-server-inventory

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

@transcend-io/mcp-server-preferences

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

@transcend-io/mcp-server-workflows

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

commit: 61b2ddf

…ar defaults

The --transcendUrl and --consentUrl flags already fall back to the
TRANSCEND_API_URL and TRANSCEND_CONSENT_API_URL environment variables
(then the hardcoded defaults), but the flag brief text did not mention
this, so users were unaware they could omit the flags by exporting the
env vars. Surface the env-var default in each flag's help text and
regenerate the README.
After a successful upload, log that publishing does not activate the
policy and print the exact `transcend policy activate` command with the
new version ID and bundle name.
Replace --versionId with optional --version on transcend policy activate.
When omitted, activate the latest uploaded version by createdAt. Update
the publish activation hint and docs accordingly.
@Utsav-Patel Utsav-Patel self-assigned this Jul 2, 2026
When --version is omitted, transcend policy publish now labels uploads
as {bundleName}-yyyy-mm-dd-hh-mm-ss (UTC) instead of git SHA or a raw
ISO timestamp.
@Utsav-Patel Utsav-Patel requested review from a team and MadDataScience July 2, 2026 21:16
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