Skip to content

feat: plaintext output mode and Effect-native help/logging#19

Open
jundai-godaddy wants to merge 6 commits intomainfrom
jundai/plaintext-output
Open

feat: plaintext output mode and Effect-native help/logging#19
jundai-godaddy wants to merge 6 commits intomainfrom
jundai/plaintext-output

Conversation

@jundai-godaddy
Copy link
Collaborator

@jundai-godaddy jundai-godaddy commented Mar 17, 2026

Summary

  • Add --output=plaintext / -p / --plaintext / GODADDY_CLI_OUTPUT=plaintext for human-readable output instead of JSON envelopes
  • Add --output=json / -j / --json to explicitly force JSON (overrides env var)
  • Replace custom help subcommand system with Effect's built-in --help, with help as a positional alias
  • Fix excessive blank lines and boilerplate noise in Effect's help output via a custom Console layer
  • When -j / --json is active, --help emits a structured JSON envelope with {version, usage, description, options, commands} instead of raw text
  • Wire -v / -vv / -vvv and --log-level=X (equals form) to --log-level info/debug/trace so Effect's runtime logger respects verbosity
  • Print a human-readable message to stderr when a verbosity level is set (e.g. Log level has been set to: debug)
  • Add a custom Effect Logger that routes Effect.log* calls to stderr, formatted as JSON or plaintext based on output format
  • Remove redundant command title line at the top of help output

Test plan

  • godaddy --help / godaddy -h — Effect's root help, no excessive blank lines
  • godaddy help — same (positional alias)
  • godaddy env help / godaddy auth -h — subcommand help
  • godaddy -j --help — structured JSON: {ok, command, result: {version, usage, description, options, commands}, next_actions}
  • godaddy env get — JSON output (default)
  • godaddy -p env get / godaddy --plaintext env get — plaintext output
  • GODADDY_CLI_OUTPUT=plaintext godaddy env get — plaintext via env var
  • godaddy -j env get — JSON (overrides env var)
  • godaddy -v auth status — prints "Log level has been set to: info", sets log-level=info
  • godaddy -vv env get — sets log-level=debug
  • godaddy -vvv env get — sets log-level=trace
  • godaddy --log-level=debug env get — same as -vv (equals form normalised)
  • godaddy --log-level debug env get — same as above (space form)

🤖 Generated with Claude Code

jundai-godaddy and others added 6 commits March 16, 2026 16:52
…TPUT

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace custom help subcommands with Effect's --help (via `help` → `--help` positional rewrite)
- Add Console layer that collapses 3+ blank lines in Effect's help output
- Add Effect Logger that routes Effect.log* to stderr, formatted as JSON or plaintext based on outputFormat
- Wire -v/-vv/-vvv to --log-level info/debug/trace so Effect's runtime logger respects verbosity
- Remove makeHelpSubcommand from all command files and delete help.ts

Co-Authored-By: Claude <noreply@anthropic.com>
Remove the verbose per-option metadata lines Effect's renderer injects
("A true or false value.", "This setting is optional.", "One of the
following: ...") and collapse the orphaned blank lines that remain,
producing tight two-line option blocks (name + description).

Co-Authored-By: Claude <noreply@anthropic.com>
When -v, -vv, -vvv, or --log-level is passed, emit a human-friendly
line to stderr before command output indicating the active log level.

Co-Authored-By: Claude <noreply@anthropic.com>
- Expand --log-level=X (equals form) to two-token form in
  normalizeVerbosityArgs; @effect/cli only accepts the space-separated
  form, so the equals form was being passed through unparsed and
  producing different output than running without a log-level flag.
  Verbosity levels are absorbed into the counter to avoid duplication.

- Remove the standalone command-name title line Effect renders at the
  top of help output (e.g. "godaddy\n\ngodaddy 0.2.3"), leaving just
  the version line as the first thing shown.

Co-Authored-By: Claude <noreply@anthropic.com>
- Parse Effect's help text into {version, usage, description, options, commands}
  when output format is json, instead of a raw help string
- Add --plaintext as the long-form alias for -p (mirrors --json/-j symmetry)

Co-Authored-By: Claude <noreply@anthropic.com>
@jundai-godaddy jundai-godaddy marked this pull request as ready for review March 18, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant