[GH-ISSUE #200] Add App Store Version Promotions CLI support #61

Closed
opened 2026-02-26 21:33:06 +03:00 by kerem · 2 comments
Owner

Originally created by @rudrankriyam on GitHub (Jan 26, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/200

Overview

Add CLI support for App Store Version Promotions to apply an experiment treatment or promote a version on the App Store product page.

Docs (API)

Scope (Endpoints)

Docs currently list only:

  • POST /v1/appStoreVersionPromotions

Discovery step: confirm if GET/DELETE endpoints exist in the OpenAPI spec. If they do, implement them; if not, implement create only.

Proposed CLI

Top‑level group: asc versions promotions <subcommand> [flags]

Subcommands:

  • versions promotions create --version-id VERSION_ID [--treatment-id TREATMENT_ID]
  • (Optional if supported) versions promotions get --id PROMOTION_ID
  • (Optional if supported) versions promotions delete --id PROMOTION_ID --confirm

Flags

Common:

  • --output json|table|markdown
  • --pretty

Create:

  • --version-id (required)
  • --treatment-id (if required by API; verify in OpenAPI)

Delete:

  • --confirm required (if delete is supported)

Output

  • JSON (minified) by default
  • Table/markdown for get/list if supported

Acceptance Criteria

  • asc versions promotions --help available
  • Create works against live App Store Connect
  • Validations for required fields (version/treatment)
  • JSON/table/markdown output (where applicable)
  • If GET/DELETE endpoints are not in spec, document create‑only support

Tests

  • CLI validation tests for missing required flags
  • Client tests for POST /v1/appStoreVersionPromotions
  • If GET/DELETE supported, add tests for those endpoints

Manual Test Plan (using real apps)

  1. Find IDs:
    • asc apps --paginateAPP_ID
    • asc versions list --app APP_ID --paginateVERSION_ID
  2. Create promotion:
    • asc versions promotions create --version-id VERSION_ID (or with --treatment-id if required)
  3. Verify in App Store Connect UI under version experiments/promotions
  4. (If GET supported) asc versions promotions get --id PROMOTION_ID
  5. (If DELETE supported) asc versions promotions delete --id PROMOTION_ID --confirm

Implementation Notes

  • Add internal/asc/client_promotions.go and output helpers only if GET/list are supported.
  • Otherwise, implement a thin create command with clear output.
  • Register the subcommand under versions.
Originally created by @rudrankriyam on GitHub (Jan 26, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/200 # Overview Add CLI support for **App Store Version Promotions** to apply an experiment treatment or promote a version on the App Store product page. # Docs (API) - App Store Version Promotions: https://sosumi.ai/documentation/appstoreconnectapi/app-store-version-promotions - AppStoreVersionPromotion object: https://sosumi.ai/documentation/appstoreconnectapi/appstoreversionpromotion - Create request: https://sosumi.ai/documentation/appstoreconnectapi/appstoreversionpromotioncreaterequest # Scope (Endpoints) Docs currently list only: - `POST /v1/appStoreVersionPromotions` **Discovery step**: confirm if GET/DELETE endpoints exist in the OpenAPI spec. If they do, implement them; if not, implement create only. # Proposed CLI Top‑level group: `asc versions promotions <subcommand> [flags]` Subcommands: - `versions promotions create --version-id VERSION_ID [--treatment-id TREATMENT_ID]` - (Optional if supported) `versions promotions get --id PROMOTION_ID` - (Optional if supported) `versions promotions delete --id PROMOTION_ID --confirm` # Flags Common: - `--output json|table|markdown` - `--pretty` Create: - `--version-id` (required) - `--treatment-id` (if required by API; verify in OpenAPI) Delete: - `--confirm` required (if delete is supported) # Output - JSON (minified) by default - Table/markdown for get/list if supported # Acceptance Criteria - [ ] `asc versions promotions --help` available - [ ] Create works against live App Store Connect - [ ] Validations for required fields (version/treatment) - [ ] JSON/table/markdown output (where applicable) - [ ] If GET/DELETE endpoints are not in spec, document create‑only support # Tests - CLI validation tests for missing required flags - Client tests for POST /v1/appStoreVersionPromotions - If GET/DELETE supported, add tests for those endpoints # Manual Test Plan (using real apps) 1) Find IDs: - `asc apps --paginate` → `APP_ID` - `asc versions list --app APP_ID --paginate` → `VERSION_ID` 2) Create promotion: - `asc versions promotions create --version-id VERSION_ID` (or with `--treatment-id` if required) 3) Verify in App Store Connect UI under version experiments/promotions 4) (If GET supported) `asc versions promotions get --id PROMOTION_ID` 5) (If DELETE supported) `asc versions promotions delete --id PROMOTION_ID --confirm` # Implementation Notes - Add `internal/asc/client_promotions.go` and output helpers only if GET/list are supported. - Otherwise, implement a thin create command with clear output. - Register the subcommand under `versions`.
kerem closed this issue 2026-02-26 21:33:06 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Jan 27, 2026):

@cursor Please implement issue #200 and run tests using ASC auth values from the environment (ASC_*). Test all endpoints you add (POST /v1/appStoreVersionPromotions and any GET/DELETE if added). When you open the PR, update the PR description to include the test results you ran.

<!-- gh-comment-id:3804030244 --> @rudrankriyam commented on GitHub (Jan 27, 2026): @cursor Please implement issue #200 and run tests using ASC auth values from the environment (ASC_*). Test all endpoints you add (POST /v1/appStoreVersionPromotions and any GET/DELETE if added). When you open the PR, update the PR description to include the test results you ran.
Author
Owner

@cursor[bot] commented on GitHub (Jan 27, 2026):

Summary:

  • I added asc versions promotions create (create-only per API spec), wired the client POST /v1/appStoreVersionPromotions with optional treatment relationship, added table/markdown output for the create result, and documented the create-only support in the README and help text.

Tests:

  • go test ./...
  • Manual ASC API attempts (blocked by missing env auth): ASC_BYPASS_KEYCHAIN=1 go run ./main.go apps --paginate and go run ./main.go apps --paginate both failed with “missing authentication”. I also confirmed ASC_* env vars are unset and /home/ubuntu/.asc/config.json is empty, so I couldn’t hit the live POST endpoint yet.

Artifacts:

  • Walkthrough video: versions_promotions_help (shows the new asc versions promotions --help output and create-only note).
    Please remember to update the PR description with the tests above; once ASC_* credentials are available, I can rerun the live POST test.

View PR
Open in Cursor Open in Web

<!-- gh-comment-id:3804030631 --> @cursor[bot] commented on GitHub (Jan 27, 2026): Summary: - I added `asc versions promotions create` (create-only per API spec), wired the client POST `/v1/appStoreVersionPromotions` with optional treatment relationship, added table/markdown output for the create result, and documented the create-only support in the README and help text. Tests: - `go test ./...` - Manual ASC API attempts (blocked by missing env auth): `ASC_BYPASS_KEYCHAIN=1 go run ./main.go apps --paginate` and `go run ./main.go apps --paginate` both failed with “missing authentication”. I also confirmed `ASC_*` env vars are unset and `/home/ubuntu/.asc/config.json` is empty, so I couldn’t hit the live POST endpoint yet. Artifacts: - Walkthrough video: **versions_promotions_help** (shows the new `asc versions promotions --help` output and create-only note). Please remember to update the PR description with the tests above; once ASC_* credentials are available, I can rerun the live POST test. <a href="https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/212"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/view-pr-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/view-pr-light.svg"><img alt="View PR" src="https://cursor.com/view-pr-light.svg"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-dbdae594-4cd1-466f-b832-56b88dd7112a"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-dbdae594-4cd1-466f-b832-56b88dd7112a"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#61
No description provided.