Skip to content

Add JSON output to purge command (12.12) #394

@josecelano

Description

@josecelano

Overview

Add JSON output format support to the purge command (roadmap task 12.12). Part of Phase 2 of the JSON output epic (#348).

The purge command deletes all local data for an environment (data/<env>/, build/<env>/, and the registry entry). Since PurgeCommandHandler::execute() returns (), the JSON output is minimal: environment name + confirmation flag.

Rationale

Lists the directories and files that were removed. Provides a machine-readable record of what was cleaned up, enabling automation to verify successful purge before proceeding.

Specification

See detailed specification: docs/issues/394-add-json-output-to-purge-command.md

(File will be committed and renamed with the real issue number.)

JSON Output Format

{
  "environment_name": "my-env",
  "purged": true
}

Tasks

  • Create PurgeDetailsData view DTO
  • Implement JsonView for purge command
  • Implement TextView (preserving current complete_workflow output)
  • Add output_format: OutputFormat parameter to execute()
  • Update router to pass output_format
  • Add unit tests for both views
  • Update docs/user-guide/commands/purge.md
  • All linters pass (cargo run --bin linter all)

Related

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions