Skip to content

feat: Inteligently manage output when no TTY #805

@mbevc1

Description

@mbevc1

Problem

When running Kosli CLI as part of the CI pipeline sometimes stdErr and stdOut are multiplexed, e.g. Docker, GHA, etc. and writing to stdErr might pollute the output and break the workflow depending or parsing that output.

Proposed approach

Following the discussion in Slack the solution might be to detect when there is no TTY and ignore printing to stdErr. This approach would need to ensure all the output going for stdErr is silently dropped/ignored and only stdOut is printed out.

Context

We recently introduced checking ofr latest version which prints out a notice when not running the latest CLI. It outputs to stdErr only when not outputting as table format (user interaction). It also skips the check when in debug mode, but there might be use cases were it runs without TTY and the this behaviour is not desired. We should only check for newer versions when using --version or version command in that case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions