Summary
Add --output-format json support to the register command, as part of roadmap section 12 (Epic #348).
Roadmap task: 12.13
Parent Epic: #348
Specification
See docs/issues/396-add-json-output-to-register-command.md for the full spec (to be committed after issue creation).
JSON Output Format
{
"environment_name": "my-env",
"instance_ip": "192.168.1.100",
"ssh_port": 22,
"registered": true
}
| Field |
Type |
Description |
environment_name |
string |
Name of the environment the instance was registered to |
instance_ip |
string |
IP address of the registered instance |
ssh_port |
integer |
SSH port used for the instance (default 22) |
registered |
boolean |
Always true when the command exits successfully |
Implementation Notes
RegisterCommandController::execute() returns Environment<Provisioned> — the DTO is built from this rich result
- DTO:
RegisterDetailsData { environment_name, instance_ip, ssh_port, registered }
- Named constructor:
from_environment(env: &Environment<Provisioned>)
- Strategy Pattern — same as all prior commands in this epic
complete_workflow() needs updating to receive &Environment<Provisioned> alongside output_format
Acceptance Criteria
Summary
Add
--output-format jsonsupport to theregistercommand, as part of roadmap section 12 (Epic #348).Roadmap task: 12.13
Parent Epic: #348
Specification
See
docs/issues/396-add-json-output-to-register-command.mdfor the full spec (to be committed after issue creation).JSON Output Format
{ "environment_name": "my-env", "instance_ip": "192.168.1.100", "ssh_port": 22, "registered": true }environment_nameinstance_ipssh_portregisteredtruewhen the command exits successfullyImplementation Notes
RegisterCommandController::execute()returnsEnvironment<Provisioned>— the DTO is built from this rich resultRegisterDetailsData { environment_name, instance_ip, ssh_port, registered }from_environment(env: &Environment<Provisioned>)complete_workflow()needs updating to receive&Environment<Provisioned>alongsideoutput_formatAcceptance Criteria
cargo run -- register my-env 192.168.1.100 --output-format json 2>/dev/nullproduces valid JSONcargo run --bin linter allpasses