Skip to content

feat(sdk): accept --auth-key in sdk publish - #470

Open
mehnoorsiddiqui wants to merge 1 commit into
devfrom
fix/sdk-publish-auth-key
Open

mehnoorsiddiqui wants to merge 1 commit into
devfrom
fix/sdk-publish-auth-key

Conversation

@mehnoorsiddiqui

@mehnoorsiddiqui mehnoorsiddiqui commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

sdk publish now accepts -k, --auth-key, like sdk generate and the other API commands. It was the only API command without it, so CI runs had to auth login first.

  • The key is threaded through every authenticated call in the flow: publishing profiles lookup, SDK generation, upload, and publish-log polling. It takes precedence over the stored login; with no flag, the stored key is used as before.
  • Guided mode is still chosen when no flags are passed, or only --git-init and/or --auth-key. The check now reads oclif's parsed tokens instead of raw argv, so --auth-key key, --auth-key=key and -k key are all recognised.
  • README and the command description updated.

Docs: the matching CLI Reference change is apimatic/apimatic-docs#884.

Tests

  • test/infrastructure/services/publishing-api-service.test.ts (new): flag key used with no login, flag key preferred over the stored key, stored key used without a flag, unauthorized with neither — for publish and the publish log.
  • test/actions/sdk/publish.test.ts: the key reaches generation, upload and log polling.
  • test/commands/sdk/publish-flags.test.ts: guided-mode detection from real parsed input (--auth-key key, --auth-key=key, -k key, combined with --git-init, and flag-mode cases).

🤖 Generated with Claude Code

sdk publish now takes -k, --auth-key like the other API commands. The key
is used for the publishing profiles lookup, SDK generation, the upload and
the publish-log polling, and it takes precedence over the stored login.
Passing only --auth-key (and/or --git-init) still runs guided mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@mehnoorsiddiqui mehnoorsiddiqui self-assigned this Nov 6, 2026

This branch has not been deployed

No deployments
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