Skip to content

[FEAT cloudctl] - Refactor output.Printer #84

Open

Description

@jellonek

Priority

(Medium) I'm annoyed but I'll live

User Story

At the moment each subcommand is implemented in 2 parts: main functionality in subcommand definition file, output functionality defined as a switch case of plain/interactive output.Printer. Each subcommand is calculating the printer on its own using the same copy-pasted code what can be done once on rootcmd initialization.

Description

This issue is about introducing new output.Printer interface, which will contain AsJSON, AsYAML, AsPlainText, AsInteractive methods. Each subcommand which is outputting any data should implement this interface.

Part for selecting the output printer and calling it (which are now copy-pasted on each subcommand core functions) also should be moved to common place (init of root cmd?) which should set a variable available to be consumed by subcommand code (e.g. allowing to check for interaction, control spinner).

Mentioned variable and output handling code should land in ./internal/ package

Acceptance Criteria

  • new printer interface introduced in internal/ package
  • code for selecting printer added to root command initialization
  • subcommands refactored to use new interface:
    • bootstrap
    • cluster-version
    • sync
    • update
    • version
  • old cmd/output/ package removed

Reference Issues

No response

Activity

  1. added
    featureNew functional capabilities or significant additions to the CLI.
    on Oct 15, 2026
  2. github-actions commented on Oct 15, 2026

    @github-actions

    Thanks for opening this issue! 🎉

    A maintainer will triage it within 5 business days. You can learn more about our issue workflow in the Issue Lifecycle documentation.

    In the meantime, please make sure you have provided:

    • A clear problem statement
    • Steps to reproduce (for bugs)
    • Expected vs actual behavior

    This helps us route your issue faster.

  3. self-assigned this
    on Oct 15, 2026
  4. added
    backlogReady for sprint planning; triggers project addition
    and removed
    needs-triageNew issue, not yet reviewed
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backlogReady for sprint planning; triggers project additionfeatureNew functional capabilities or significant additions to the CLI.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions