Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLIPublic
Assigneesstack72

Relationships

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

Opened by shelson · 8/20/2026· Shipped 9/14/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
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 7 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/14/2026, 9:23:31 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/14/2026, 7:01:18 PM
Editable. Press Enter to edit.

stack72 commented 9/14/2026, 9:24:24 PM

Thanks @shelson for the output-mode default proposal. JSON output can now be enabled for the CLI through SWAMP_CLI_OUTPUT_JSON, and the change has shipped in PR #2454.

shelson commented 9/23/2026, 12:25:34 AM

<3 <3 <3 Thanks!

Sign in to post a ripple.