Skip to content

feat: add code download command#366

Merged
clavery merged 2 commits intomainfrom
feature/code-download
Apr 20, 2026
Merged

feat: add code download command#366
clavery merged 2 commits intomainfrom
feature/code-download

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented Apr 20, 2026

Summary

  • Adds b2c code download CLI command — the inverse of code deploy
  • Downloads cartridge code from a B2C Commerce instance via WebDAV server-side ZIP
  • Supports --cartridge / --exclude-cartridge filtering, --mirror mode (extract to local project locations), and --output directory (defaults to ./cartridges)
  • Auto-discovers active code version via OCAPI when --code-version not specified
  • 10-minute timeout on ZIP and download operations for large code versions
  • Elapsed-time progress reporting every 5s for long-running phases (works in non-TTY/CI)
  • Also adds progress reporting to code deploy upload operations

Test plan

  • pnpm run typecheck:agent passes
  • pnpm --filter @salesforce/b2c-tooling-sdk run test:agent — 8 new download tests pass
  • pnpm --filter @salesforce/b2c-cli run test:agent — 8 new CLI tests pass
  • pnpm run lint:agent passes (excluding pre-existing mrt-utilities issues)
  • ./cli code download --help shows correct usage
  • Manual test: ./cli code download -o ./tmp --server <host> --code-version <cv> downloads cartridges
  • Manual test: ./cli code download --mirror extracts to local project locations
  • Manual test: progress messages appear during long operations

Implement `b2c code download` — the inverse of `code deploy`. Downloads
cartridge code from a B2C Commerce instance via WebDAV server-side ZIP,
with support for cartridge filtering, mirror mode, and elapsed-time
progress reporting.

Also adds progress reporting to `code deploy` upload operations.
@clavery clavery marked this pull request as ready for review April 20, 2026 22:45
@clavery clavery enabled auto-merge (squash) April 20, 2026 22:46
@clavery clavery disabled auto-merge April 20, 2026 22:46
@clavery clavery merged commit 59dd584 into main Apr 20, 2026
4 checks passed
@clavery clavery deleted the feature/code-download branch April 20, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant