From 1b99e78d7d9010a0859719656b156c92b3798d82 Mon Sep 17 00:00:00 2001 From: mehnoorsiddiqui Date: Fri, 6 Nov 2026 12:06:38 +0500 Subject: [PATCH] feat(sdk): accept --auth-key in sdk publish 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 --- README.md | 8 +- src/actions/sdk/publish.ts | 14 +- src/actions/sdk/publish/interactive.ts | 10 +- src/actions/sdk/publish/non-interactive.ts | 10 +- src/commands/sdk/publish.ts | 25 ++-- .../services/publishing-api-service.ts | 27 ++-- test/actions/sdk/publish.test.ts | 41 +++++- test/commands/sdk/publish-flags.test.ts | 24 +++- .../services/publishing-api-service.test.ts | 120 ++++++++++++++++++ 9 files changed, 235 insertions(+), 44 deletions(-) create mode 100644 test/infrastructure/services/publishing-api-service.test.ts diff --git a/README.md b/README.md index a1bf9676..dcb54fa6 100644 --- a/README.md +++ b/README.md @@ -455,7 +455,8 @@ Generate and publish an SDK to a package registry and/or source repository ``` USAGE $ apimatic sdk publish [-p ] [-v ] [-d ] [-l csharp|java|php|python|ruby|typescript|go] - [-f] [-i ] [--publish-type package|sourcecode...] [--dry-run] [--stability stable|beta] [--git-init] + [-f] [-i ] [--publish-type package|sourcecode...] [--dry-run] [--stability stable|beta] [--git-init] [-k + ] FLAGS -d, --destination= [default: /sdk/] path where the sdk will be generated. @@ -463,6 +464,7 @@ FLAGS be merged is replaced, with a warning. -i, --input= [default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files. + -k, --auth-key= override current authentication state with an authentication key. -l, --language=