Skip to content

Code operations commands and improved error handling#4

Merged
clavery merged 2 commits intomainfrom
feature/code-operations
Dec 1, 2025
Merged

Code operations commands and improved error handling#4
clavery merged 2 commits intomainfrom
feature/code-operations

Conversation

@clavery
Copy link
Collaborator

@clavery clavery commented Dec 1, 2025

Summary

  • Add code management commands: deploy, list, activate, delete, watch
  • Add CartridgeCommand base class for shared cartridge-related flags
  • Fix OCAPI OpenAPI spec for proper openapi-fetch typing (success/error discrimination)
  • Improve error handling with Error.cause for structured OCAPI errors
  • Add catch() to BaseCommand for consistent error logging and exit codes
  • Fix ./cli wrapper to preserve exit codes

Code Commands

  • code deploy - Deploy cartridges to a code version
  • code list - List all code versions on an instance
  • code activate - Activate a code version
  • code delete - Delete a code version (with confirmation prompt)
  • code watch - Watch and sync cartridge changes

Error Handling

Library functions now throw errors with the OCAPI fault in cause:

throw new Error('Failed to delete code version', {cause: error});

BaseCommand catches errors, logs them with structured logger (including cause), and uses oclif's this.error() for proper exit codes.


  • Tests pass (pnpm test)
  • Code is formatted (pnpm run format)

🤖 Generated with Claude Code

@clavery clavery changed the title Feature/code operations Code operations commands and improved error handling Dec 1, 2025
@clavery clavery merged commit 05bb084 into main Dec 1, 2025
2 checks passed
@clavery clavery deleted the feature/code-operations branch January 27, 2026 01:23
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