Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLIPublic
AssigneesNone

Relationships

#1753 Add SWAMP_CLI_OUTPUT env var to control default output mode (plaintext/tui/json)

Opened by shelson · 8/20/2026

Problem

Currently, to get non-interactive (plaintext/JSON) output from swamp, you must append --json to every single command. There is no way to set a persistent default. Conversely, if someone prefers the TUI but a script or alias uses --json, there is no env-var-based escape hatch either.

Additionally, the --log CLI option exists but appears to do nothing meaningful — it certainly doesn't switch to non-interactive output as its help text suggests. It should either be fixed or removed.

Proposed Solution

Introduce an environment variable SWAMP_CLI_OUTPUT with three values:

  • plaintext — default friendly terminal output (existing behavior, no TUI)
  • tui — enable the interactive TUI (equivalent to what would be the default if TUI were on)
  • json — emit JSON output for every command (equivalent to passing --json on every command)

If the env var is not set, behavior stays exactly as it is today (no change).

If the env var is set AND --json (or a future --plaintext/--tui) flag is passed on a specific invocation, the CLI flag wins — env var is a default, not a lockdown.

Bonus: Fix or Remove --log

The --log flag currently claims to enable "non-interactive" output but doesn't seem to actually do that. Options:

  1. Make --log work as advertised (output to a file, non-interactive mode)
  2. Repurpose --log to set a log level (debug/info/warn/error) while SWAMP_CLI_OUTPUT handles the output mode
  3. Remove --log entirely if it's vestigial

Alternatives Considered

  • Could add --plaintext / --tui CLI flags alongside --json, but an env var is the simplest single touchpoint for users who always want one mode.
  • Could detect stdout being a pipe/redirect and auto-switch to JSON, but that's brittle and doesn't cover all use cases.

Why This Matters

Users who script swamp or integrate it into other tooling currently have to remember --json on every call. An env var makes this ergonomic, CI-friendly, and discoverable.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

8/20/2026, 7:03:35 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.