basecamp / basecamp/once

`once list` ANSI output breaks programmatic parsing in CI

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.9k
Forks
89
Avg merge
21h 42m
Merged PRs (30d)
15

Description

## Problem

`once list` always emits ANSI escape sequences even when stdout is not a terminal.

Raw output:
```
\e]8;;https://foo.bigconfig.space\e\\[94mfoo.bigconfig.space[m\e]8;;\e\\ (running)
```

There is no `--no-color`, `--plain`, or `--output json` flag to suppress this.

## Impact

Any script, CI job, or Ansible module that needs to parse `once list` must first strip ANSI codes with a brittle regex before it can extract hostnames or statuses.This is fragile — it breaks if the output format changes or if a hostname does not match the assumed domain pattern.

## Expected behaviour

At minimum, `once` should honour the [`NO_COLOR`](https://no-color.org/) convention so that setting `NO_COLOR=1` (or detecting a non-TTY stdout) suppresses all ANSI codes.

A `--output json` flag on `once list` would be even better:

```json
[
{"host": "foo.bigconfig.space", "status": "running"},
{"host": "bar.bigconfig.space", "status": "running"}
]
```

## Steps to reproduce

```bash
once list > output.txt
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.