[GH-ISSUE #51] Add build-localizations commands (via App Store Version Localizations) #14

Closed
opened 2026-02-26 21:32:47 +03:00 by kerem · 3 comments
Owner

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

Summary

Add a build-localizations command group that manages localized release notes by resolving a build to its App Store Version and then using App Store Version Localizations endpoints.

API endpoints

CLI

  • asc build-localizations list --build "BUILD_ID" [--locale ...] [--limit ...] [--next ...] [--paginate]
  • asc build-localizations get --id "LOCALIZATION_ID"
  • asc build-localizations create --build "BUILD_ID" --locale "en-US" [--whats-new ...]
  • asc build-localizations update --id "LOCALIZATION_ID" [--whats-new ...]
  • asc build-localizations delete --id "LOCALIZATION_ID" --confirm

Output

  • JSON minified default; --output table|markdown; --pretty for JSON.

Tests

  • Client tests for localizations endpoints
  • CLI tests for build->version resolution and CRUD flags
Originally created by @rudrankriyam on GitHub (Jan 23, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/51 ## Summary Add a `build-localizations` command group that manages localized release notes by resolving a build to its App Store Version and then using App Store Version Localizations endpoints. ## API endpoints - `GET /v1/builds/{id}` (resolve build) - `GET /v1/appStoreVersions/{id}/appStoreVersionLocalizations` (list) — https://developer.apple.com/documentation/appstoreconnectapi/appstoreversionlocalization - `GET /v1/appStoreVersionLocalizations/{id}` (read) — https://developer.apple.com/documentation/appstoreconnectapi/read_app_store_version_localization_information - `POST /v1/appStoreVersionLocalizations` (create) — https://developer.apple.com/documentation/appstoreconnectapi/create_an_app_store_version_localization - `PATCH /v1/appStoreVersionLocalizations/{id}` (update) — https://developer.apple.com/documentation/appstoreconnectapi/modify_an_app_store_version_localization - `DELETE /v1/appStoreVersionLocalizations/{id}` (delete) — https://developer.apple.com/documentation/appstoreconnectapi/delete_an_app_store_version_localization ## CLI - `asc build-localizations list --build "BUILD_ID" [--locale ...] [--limit ...] [--next ...] [--paginate]` - `asc build-localizations get --id "LOCALIZATION_ID"` - `asc build-localizations create --build "BUILD_ID" --locale "en-US" [--whats-new ...]` - `asc build-localizations update --id "LOCALIZATION_ID" [--whats-new ...]` - `asc build-localizations delete --id "LOCALIZATION_ID" --confirm` ## Output - JSON minified default; `--output table|markdown`; `--pretty` for JSON. ## Tests - Client tests for localizations endpoints - CLI tests for build->version resolution and CRUD flags
kerem closed this issue 2026-02-26 21:32:47 +03:00
Author
Owner

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

@cursor Please implement this issue.

Implementation Guide

This is a more complex feature that manages App Store Version Localizations through builds.

1. Create cmd/build_localizations.go

// BuildLocalizationsCommand returns the build-localizations command group.
func BuildLocalizationsCommand() *ffcli.Command {
    // Subcommands: list, get, create, update, delete
}

2. Add Client Methods in internal/asc/client.go

// Types
type AppStoreVersionLocalization struct {
    Type       string                                 `json:"type"`
    ID         string                                 `json:"id"`
    Attributes AppStoreVersionLocalizationAttributes `json:"attributes"`
}

type AppStoreVersionLocalizationAttributes struct {
    Locale       string  `json:"locale"`
    WhatsNew     *string `json:"whatsNew,omitempty"`
    Description  *string `json:"description,omitempty"`
    Keywords     *string `json:"keywords,omitempty"`
    // Add other fields as needed
}

// Methods
func (c *Client) GetBuildAppStoreVersion(ctx, buildID string) (*AppStoreVersionResponse, error)
func (c *Client) GetAppStoreVersionLocalizations(ctx, versionID string, opts...) (*AppStoreVersionLocalizationsResponse, error)
func (c *Client) GetAppStoreVersionLocalization(ctx, localizationID string) (*AppStoreVersionLocalizationResponse, error)
func (c *Client) CreateAppStoreVersionLocalization(ctx, versionID, locale string, whatsNew *string) (*AppStoreVersionLocalizationResponse, error)
func (c *Client) UpdateAppStoreVersionLocalization(ctx, localizationID string, whatsNew *string) (*AppStoreVersionLocalizationResponse, error)
func (c *Client) DeleteAppStoreVersionLocalization(ctx, localizationID string) error

3. Build-to-Version Resolution

The key complexity is resolving a build to its App Store Version:

func (c *Client) GetBuildAppStoreVersion(ctx context.Context, buildID string) (*AppStoreVersionResponse, error) {
    // GET /v1/builds/{id}/appStoreVersion
    url := fmt.Sprintf("%s/builds/%s/appStoreVersion", baseURL, buildID)
    // ...
}

4. CLI Commands

list: asc build-localizations list --build BUILD_ID

// 1. Resolve build -> appStoreVersion
// 2. GET /v1/appStoreVersions/{id}/appStoreVersionLocalizations

get: asc build-localizations get --id LOCALIZATION_ID

create: asc build-localizations create --build BUILD_ID --locale en-US --whats-new "Bug fixes"

update: asc build-localizations update --id LOCALIZATION_ID --whats-new "New features"

delete: asc build-localizations delete --id LOCALIZATION_ID --confirm

5. Flags

For list:

  • --build (required)
  • --locale (optional filter)
  • --limit, --next, --paginate
  • --output, --pretty

For create:

  • --build (required)
  • --locale (required, e.g., en-US, de-DE, ja)
  • --whats-new (optional, release notes)

For update:

  • --id (required)
  • --whats-new (optional)

For delete:

  • --id (required)
  • --confirm (required)

6. Testing

Unit tests in cmd/commands_test.go:

{"build-localizations list missing build", ...}
{"build-localizations create missing locale", ...}
{"build-localizations delete missing confirm", ...}

Live API test:

# Get a build that has an App Store version
./asc builds list --app 6747745091 --limit 5

# Test list (may fail if build has no App Store version)
./asc build-localizations list --build "BUILD_ID"

# Create/update would modify production data - test carefully!

7. Error Handling

Handle case where build has no App Store version:

if version == nil {
    return fmt.Errorf("build %s has no associated App Store version", buildID)
}

8. Code Standards

  • Use pointers for optional fields (*string for whatsNew)
  • Validate locale format (basic check for xx-XX pattern)
  • Use strings.TrimSpace() on all inputs
  • Run make format && make lint && make test before committing
<!-- gh-comment-id:3792268317 --> @rudrankriyam commented on GitHub (Jan 23, 2026): @cursor Please implement this issue. ## Implementation Guide This is a more complex feature that manages App Store Version Localizations through builds. ### 1. Create `cmd/build_localizations.go` ```go // BuildLocalizationsCommand returns the build-localizations command group. func BuildLocalizationsCommand() *ffcli.Command { // Subcommands: list, get, create, update, delete } ``` ### 2. Add Client Methods in `internal/asc/client.go` ```go // Types type AppStoreVersionLocalization struct { Type string `json:"type"` ID string `json:"id"` Attributes AppStoreVersionLocalizationAttributes `json:"attributes"` } type AppStoreVersionLocalizationAttributes struct { Locale string `json:"locale"` WhatsNew *string `json:"whatsNew,omitempty"` Description *string `json:"description,omitempty"` Keywords *string `json:"keywords,omitempty"` // Add other fields as needed } // Methods func (c *Client) GetBuildAppStoreVersion(ctx, buildID string) (*AppStoreVersionResponse, error) func (c *Client) GetAppStoreVersionLocalizations(ctx, versionID string, opts...) (*AppStoreVersionLocalizationsResponse, error) func (c *Client) GetAppStoreVersionLocalization(ctx, localizationID string) (*AppStoreVersionLocalizationResponse, error) func (c *Client) CreateAppStoreVersionLocalization(ctx, versionID, locale string, whatsNew *string) (*AppStoreVersionLocalizationResponse, error) func (c *Client) UpdateAppStoreVersionLocalization(ctx, localizationID string, whatsNew *string) (*AppStoreVersionLocalizationResponse, error) func (c *Client) DeleteAppStoreVersionLocalization(ctx, localizationID string) error ``` ### 3. Build-to-Version Resolution The key complexity is resolving a build to its App Store Version: ```go func (c *Client) GetBuildAppStoreVersion(ctx context.Context, buildID string) (*AppStoreVersionResponse, error) { // GET /v1/builds/{id}/appStoreVersion url := fmt.Sprintf("%s/builds/%s/appStoreVersion", baseURL, buildID) // ... } ``` ### 4. CLI Commands **list**: `asc build-localizations list --build BUILD_ID` ```go // 1. Resolve build -> appStoreVersion // 2. GET /v1/appStoreVersions/{id}/appStoreVersionLocalizations ``` **get**: `asc build-localizations get --id LOCALIZATION_ID` **create**: `asc build-localizations create --build BUILD_ID --locale en-US --whats-new "Bug fixes"` **update**: `asc build-localizations update --id LOCALIZATION_ID --whats-new "New features"` **delete**: `asc build-localizations delete --id LOCALIZATION_ID --confirm` ### 5. Flags For `list`: - `--build` (required) - `--locale` (optional filter) - `--limit`, `--next`, `--paginate` - `--output`, `--pretty` For `create`: - `--build` (required) - `--locale` (required, e.g., en-US, de-DE, ja) - `--whats-new` (optional, release notes) For `update`: - `--id` (required) - `--whats-new` (optional) For `delete`: - `--id` (required) - `--confirm` (required) ### 6. Testing **Unit tests** in `cmd/commands_test.go`: ```go {"build-localizations list missing build", ...} {"build-localizations create missing locale", ...} {"build-localizations delete missing confirm", ...} ``` **Live API test**: ```bash # Get a build that has an App Store version ./asc builds list --app 6747745091 --limit 5 # Test list (may fail if build has no App Store version) ./asc build-localizations list --build "BUILD_ID" # Create/update would modify production data - test carefully! ``` ### 7. Error Handling Handle case where build has no App Store version: ```go if version == nil { return fmt.Errorf("build %s has no associated App Store version", buildID) } ``` ### 8. Code Standards - Use pointers for optional fields (`*string` for whatsNew) - Validate locale format (basic check for xx-XX pattern) - Use `strings.TrimSpace()` on all inputs - Run `make format && make lint && make test` before committing
Author
Owner

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

Summary:

  • Added the build-localizations command group with list/get/create/update/delete flows, build→version resolution, locale validation, and delete output.
  • Extended ASC client with build→version lookup plus localization get/delete endpoints and output handling for single/localization delete results.
  • Added CLI and output tests plus client HTTP tests for the new endpoints.

Tests:

  • make format
  • make lint
  • make test

View PR
Open in Cursor Open in Web

<!-- gh-comment-id:3792268605 --> @cursor[bot] commented on GitHub (Jan 23, 2026): Summary: - Added the build-localizations command group with list/get/create/update/delete flows, build→version resolution, locale validation, and delete output. - Extended ASC client with build→version lookup plus localization get/delete endpoints and output handling for single/localization delete results. - Added CLI and output tests plus client HTTP tests for the new endpoints. Tests: - `make format` - `make lint` - `make test` <a href="https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/61"><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-5b6bdf6a-fa6b-432c-888e-f56ac30ffa6f"><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-5b6bdf6a-fa6b-432c-888e-f56ac30ffa6f"><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>
Author
Owner

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

Implemented in PR #61 and PR #64 - build-localizations list/get/create/update/delete commands.

<!-- gh-comment-id:3792499834 --> @rudrankriyam commented on GitHub (Jan 23, 2026): Implemented in PR #61 and PR #64 - build-localizations list/get/create/update/delete commands.
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#14
No description provided.