[GH-ISSUE #169] Add batch build expiration command (expire-all) #50

Closed
opened 2026-02-26 21:33:00 +03:00 by kerem · 1 comment
Owner

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

Summary

Add a command to batch expire old TestFlight builds based on age. Currently users must list builds, filter manually, and expire one by one - this is tedious and error-prone.

Background

TestFlight builds automatically expire after 90 days, but:

  • Managing builds manually in App Store Connect is time-consuming
  • No visibility into which builds are about to expire
  • Can't bulk expire builds that are no longer needed

Current State

Existing command:

asc builds expire --build "BUILD_ID"  # Single build

Users must:

  1. List builds: asc builds list --app "..."
  2. Manually identify old builds
  3. Run expire for each build individually

Desired Feature

Command

# Expire builds older than 90 days
asc builds expire-all --app "com.example.app" --older-than 90d

# Expire builds older than 30 days
asc builds expire-all --app "com.example.app" --older-than 30d

# Expire builds older than 1 week
asc builds expire-all --app "com.example.app" --older-than 1w

# Preview mode - show what would be expired without actually expiring
asc builds expire-all --app "com.example.app" --older-than 90d --dry-run

# Expire all builds except the latest N
asc builds expire-all --app "com.example.app" --keep-latest 5

# Expire builds older than date
asc builds expire-all --app "com.example.app" --older-than "2025-01-01"

Flags

Flag Description Default
--older-than Expire builds older than duration (e.g., 90d, 2w, 30d) Required
--keep-latest Keep the N most recent builds Optional
--dry-run Preview what would be expired false
--confirm Skip confirmation prompt false
--output Output format: json, table, markdown json

Examples

# Dry run to see what would be expired
asc builds expire-all --app "123456789" --older-than 90d --dry-run

# Actually expire old builds with confirmation
asc builds expire-all --app "123456789" --older-than 90d --confirm

# Keep the 10 most recent builds, expire everything else
asc builds expire-all --app "123456789" --keep-latest 10 --confirm

# Expire builds older than specific date
asc builds expire-all --app "123456789" --older-than "2025-01-01" --confirm

Output

Dry run mode:

DRY RUN: The following 7 builds would be expired:

| Version | Build Number | Uploaded Date | Days Old |
|---------|--------------|---------------|----------|
| 1.5.2   | 142          | 2025-09-15    | 133 days |
| 1.5.1   | 141          | 2025-09-10    | 138 days |
| ...     | ...          | ...           | ...      |

Total: 7 builds would be expired

Normal mode:

Expired build 1.5.2 (142) - uploaded 2025-09-15
Expired build 1.5.1 (141) - uploaded 2025-09-10
...
Expired 7 builds

Implementation Notes

  1. Use existing asc builds list with appropriate filtering
  2. Parse uploaded date to calculate age
  3. Filter by --older-than duration or --keep-latest count
  4. Call existing ExpireBuild for each build
  5. Add --confirm flag to skip interactive prompt
  6. Add --dry-run flag for preview without action
  7. Handle errors gracefully (continue on individual failures)
  • asc builds list - List builds
  • asc builds expire - Expire single build
  • asc builds info - Build details

Priority

High - This is a major time-saver for TestFlight management and highly requested by users.

Notes

  • Duration format: Nd, Nw, Nm (days, weeks, months)
  • Date format: ISO 8601 (2025-01-01)
  • This operation is irreversible
Originally created by @rudrankriyam on GitHub (Jan 25, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/169 ## Summary Add a command to batch expire old TestFlight builds based on age. Currently users must list builds, filter manually, and expire one by one - this is tedious and error-prone. ## Background TestFlight builds automatically expire after 90 days, but: - Managing builds manually in App Store Connect is time-consuming - No visibility into which builds are about to expire - Can't bulk expire builds that are no longer needed ## Current State Existing command: ```bash asc builds expire --build "BUILD_ID" # Single build ``` Users must: 1. List builds: `asc builds list --app "..."` 2. Manually identify old builds 3. Run expire for each build individually ## Desired Feature ### Command ```bash # Expire builds older than 90 days asc builds expire-all --app "com.example.app" --older-than 90d # Expire builds older than 30 days asc builds expire-all --app "com.example.app" --older-than 30d # Expire builds older than 1 week asc builds expire-all --app "com.example.app" --older-than 1w # Preview mode - show what would be expired without actually expiring asc builds expire-all --app "com.example.app" --older-than 90d --dry-run # Expire all builds except the latest N asc builds expire-all --app "com.example.app" --keep-latest 5 # Expire builds older than date asc builds expire-all --app "com.example.app" --older-than "2025-01-01" ``` ### Flags | Flag | Description | Default | |------|-------------|---------| | `--older-than` | Expire builds older than duration (e.g., 90d, 2w, 30d) | Required | | `--keep-latest` | Keep the N most recent builds | Optional | | `--dry-run` | Preview what would be expired | false | | `--confirm` | Skip confirmation prompt | false | | `--output` | Output format: json, table, markdown | json | ### Examples ```bash # Dry run to see what would be expired asc builds expire-all --app "123456789" --older-than 90d --dry-run # Actually expire old builds with confirmation asc builds expire-all --app "123456789" --older-than 90d --confirm # Keep the 10 most recent builds, expire everything else asc builds expire-all --app "123456789" --keep-latest 10 --confirm # Expire builds older than specific date asc builds expire-all --app "123456789" --older-than "2025-01-01" --confirm ``` ### Output **Dry run mode:** ``` DRY RUN: The following 7 builds would be expired: | Version | Build Number | Uploaded Date | Days Old | |---------|--------------|---------------|----------| | 1.5.2 | 142 | 2025-09-15 | 133 days | | 1.5.1 | 141 | 2025-09-10 | 138 days | | ... | ... | ... | ... | Total: 7 builds would be expired ``` **Normal mode:** ``` Expired build 1.5.2 (142) - uploaded 2025-09-15 Expired build 1.5.1 (141) - uploaded 2025-09-10 ... Expired 7 builds ``` ### Implementation Notes 1. Use existing `asc builds list` with appropriate filtering 2. Parse uploaded date to calculate age 3. Filter by `--older-than` duration or `--keep-latest` count 4. Call existing `ExpireBuild` for each build 5. Add `--confirm` flag to skip interactive prompt 6. Add `--dry-run` flag for preview without action 7. Handle errors gracefully (continue on individual failures) ### Related Commands - `asc builds list` - List builds - `asc builds expire` - Expire single build - `asc builds info` - Build details ### Priority High - This is a major time-saver for TestFlight management and highly requested by users. ### Notes - Duration format: `Nd`, `Nw`, `Nm` (days, weeks, months) - Date format: ISO 8601 (`2025-01-01`) - This operation is irreversible
kerem 2026-02-26 21:33:00 +03:00
Author
Owner

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

Closed by #172 (Add builds expire-all for batch expiration).

<!-- gh-comment-id:3797327436 --> @rudrankriyam commented on GitHub (Jan 25, 2026): Closed by #172 (Add builds expire-all for batch expiration).
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#50
No description provided.