Skip to content

Add CLI support for Marketplace #249

@rudrankriyam

Description

@rudrankriyam

Overview

Add CLI support for Marketplace resources including search details and marketplace webhooks using the App Store Connect API. This enables full management of marketplace configuration and webhooks from the CLI with JSON-first output and explicit flags.

Scope

Primary resources from the OpenAPI spec:

  • marketplaceSearchDetails (GET instance, POST create, PATCH update, DELETE)
  • marketplaceWebhooks (GET list, POST create, PATCH update, DELETE)
  • App relationships: apps/{id}/marketplaceSearchDetail

Endpoints:

  • GET /v1/marketplaceSearchDetails/{id} (via app relationship)
  • POST /v1/marketplaceSearchDetails
  • PATCH /v1/marketplaceSearchDetails/{id}
  • DELETE /v1/marketplaceSearchDetails/{id}
  • GET /v1/marketplaceWebhooks
  • POST /v1/marketplaceWebhooks
  • PATCH /v1/marketplaceWebhooks/{id}
  • DELETE /v1/marketplaceWebhooks/{id}
  • GET /v1/apps/{id}/marketplaceSearchDetail

Proposed CLI

Top-level group:

  • asc marketplace <subcommand> [flags]

Subcommands (all support list/get/create/update/delete unless noted):

  • marketplace search-details (get/create/update/delete)
  • marketplace webhooks (list/get/create/update/delete)

Examples:

  • asc marketplace search-details get --app APP_ID
  • asc marketplace search-details create --app APP_ID --keywords "app,game,fun"
  • asc marketplace search-details update --search-detail-id DETAIL_ID --keywords "updated,keywords"
  • asc marketplace search-details delete --search-detail-id DETAIL_ID --confirm
  • asc marketplace webhooks list
  • asc marketplace webhooks get --webhook-id WEBHOOK_ID
  • asc marketplace webhooks create --url https://example.com/webhook --secret secret123 --events MARKETPLACE.SEARCH_UPDATED
  • asc marketplace webhooks update --webhook-id WEBHOOK_ID --enabled false
  • asc marketplace webhooks delete --webhook-id WEBHOOK_ID --confirm

Flag patterns

Common:

  • --app, --output, --pretty, --limit, --next, --paginate
  • --confirm for destructive operations

Resource-specific examples:

  • --search-detail-id, --keywords (comma-separated or space-separated)
  • --webhook-id, --url, --secret, --enabled
  • --events (comma-separated list of marketplace event types)

Output

  • JSON minified by default
  • --pretty for JSON
  • --output table/markdown for list commands

Acceptance criteria

  • Commands appear in asc --help and asc marketplace --help
  • CRUD works for marketplace search details
  • CRUD works for marketplace webhooks
  • App relationship works for search details
  • Pagination flags work (--paginate, --next, --limit)
  • Delete requires --confirm
  • JSON-first output matches existing conventions
  • Table and markdown output for list commands
  • Keywords handling works correctly (parsing, formatting)

Tests

  • Unit tests for command flag validation and error cases
  • HTTP client tests for list/get/create/update/delete
  • Output tests for table/markdown
  • App relationship tests for search details
  • Keywords parsing and formatting tests

Implementation notes

  • Add cmd/marketplace*.go and internal/asc/client_marketplace*.go
  • Add output helpers in internal/asc/output_marketplace.go
  • Register command in cmd/root.go
  • Add resource type constants in internal/asc/client_types.go
  • Follow patterns in cmd/apps.go, cmd/webhooks.go (once created), and output helpers in internal/asc/output_*
  • Note: Marketplace search details are typically accessed via app relationship, marketplace webhooks are global

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions