Skip to content

feat(cli): ProjectDiscovery-style UX — banner, colored logs, braille spinner, styled tables#26

Merged
root-Manas merged 2 commits intomainfrom
copilot/improve-cli-tool-user-experience
Apr 12, 2026
Merged

feat(cli): ProjectDiscovery-style UX — banner, colored logs, braille spinner, styled tables#26
root-Manas merged 2 commits intomainfrom
copilot/improve-cli-tool-user-experience

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Brings macaron's CLI UX to parity with ProjectDiscovery tooling (nuclei, httpx, subfinder) — banner on startup, colored log levels, live braille spinner, and colored result tables.

internal/cliui/banner.go (new)

  • Box-drawing MACARON art + tagline/version header via PrintBanner(version, quiet)
  • Colored log helpers: Info (cyan [INF]), Warn (yellow [WRN]), Err (red [ERR]), OK (green [OK])
  • Color utility functions (Highlight, Muted, GreenText, RedText, YellowText, CyanText)
  • Respects NO_COLOR env var and new -nc flag

internal/cliui/live.go

  • Swapped |/-\ spinner for braille frames (⣾⣽⣻⣷⣯⣟⡿⢿) — same pattern as Nuclei/httpx
  • Live line format: ⣾ example.com [subdomains] enumerating (4s)
  • Stage events logged as [SCAN], [RUN], [OK], [WRN] badges

cmd/macaron/main.go

  • Banner shown for all user-facing commands; suppressed by -qut
  • printHelp() rewritten — grouped sections (USAGE / SCAN FLAGS / OUTPUT FLAGS / API KEYS / DASHBOARD / TOOLS & CONFIG / EXAMPLES), cyan flag names, muted descriptions
  • Pre-scan: [INF] Profile: balanced | mode: wide | stages: all | rate: 150 | threads: 30
  • Post-scan: [OK] Completed 1 target(s) in 12.4s
  • -lst shows ✔ installed / ✘ missing per tool
  • All fmt.Fprintf(os.Stderr, ...) replaced with typed log helpers

internal/app/app.go

  • All tables use table.StyleRounded + cyan column headers
  • Vuln counts colored red when >0; live-host counts colored green when >0
  • Extracted tableStyle() helper for consistency across ShowStatus, RenderSetup, RenderScanSummary

…spinner, styled tables

Agent-Logs-Url: https://github.com/root-Manas/macaron/sessions/6dea78af-da78-401a-9db1-1beab80801a7

Co-authored-by: root-Manas <97402139+root-Manas@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance CLI tool user experience to match security tools feat(cli): ProjectDiscovery-style UX — banner, colored logs, braille spinner, styled tables Apr 8, 2026
Copilot AI requested a review from root-Manas April 8, 2026 08:58
@root-Manas root-Manas marked this pull request as ready for review April 12, 2026 15:47
Copilot AI review requested due to automatic review settings April 12, 2026 15:47
@root-Manas root-Manas merged commit c3f21d1 into main Apr 12, 2026
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates macaron’s CLI user experience to match ProjectDiscovery-style tooling by adding a startup banner, colored log helpers, a braille-based live spinner renderer, and consistently styled/colored tables across app outputs.

Changes:

  • Add a new internal/cliui banner + colored log helper module and integrate it across CLI flows.
  • Update live scan progress rendering to use a braille spinner and structured stage/badge formatting.
  • Style all rendered tables with a shared rounded style and color-emphasized cells (e.g., live/vuln counts).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Updates documentation/examples to reflect the new CLI UX and compact flags.
internal/cliui/banner.go Introduces banner rendering, colored log helpers, and color utility functions.
internal/cliui/live.go Updates live progress UI (braille spinner, badge formatting, clearer line formatting).
internal/app/app.go Applies a consistent table style and adds color emphasis to key fields.
cmd/macaron/main.go Adds -nc, integrates banner/log helpers, rewrites help/guide output, and updates command output formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/macaron/main.go
}

if showVersion {
cliui.PrintBanner(version, false)
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-qut (quiet) is parsed before this block, but showVersion always calls PrintBanner(version, false), so macaron -ver -qut will still print the banner. Consider passing quiet through (or explicitly documenting that -ver ignores quiet).

Suggested change
cliui.PrintBanner(version, false)
cliui.PrintBanner(version, quiet)

Copilot uses AI. Check for mistakes.
Comment thread cmd/macaron/main.go
b := cliui.Highlight
m := cliui.Muted

cliui.PrintBanner(version, false)
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

printHelp() forces the banner on via PrintBanner(version, false), so running with -qut (or calling help in scripted contexts) still emits the banner. This contradicts the flag description "Quiet output (no banner, no progress)"; consider threading quiet into printHelp() and honoring it here.

Suggested change
cliui.PrintBanner(version, false)
quiet := false
for _, arg := range os.Args[1:] {
switch arg {
case "-qut", "--qut", "-quiet", "--quiet":
quiet = true
}
if quiet {
break
}
}
if !quiet {
cliui.PrintBanner(version, false)
}

Copilot uses AI. Check for mistakes.
Comment thread internal/cliui/live.go
Comment on lines +74 to +76
r.printLinef("%s [%s] %s %s %s %s",
r.ok("OK "),
r.stageLabel(ev.Stage),
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r.ok("OK ") includes a trailing space. In no-color mode, badge() returns "["+v+"]" without trimming, which will render as [OK ] (note the extra space). Either remove the trailing space at the call sites or trim in the no-color branch to keep output consistent.

Copilot uses AI. Check for mistakes.
Comment thread internal/cliui/banner.go
Comment on lines +104 to +109
// Highlight wraps v in bold white.
func Highlight(v string) string {
return cp(cBold, v)
}

// Muted wraps v in dim white.
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments for Highlight/Muted say they wrap text in "bold white" / "dim white", but the implementation only applies cBold/cDim (no foreground color). Either update the comments to match what the functions actually do, or include an explicit white/gray foreground code in the style.

Suggested change
// Highlight wraps v in bold white.
func Highlight(v string) string {
return cp(cBold, v)
}
// Muted wraps v in dim white.
// Highlight wraps v in bold.
func Highlight(v string) string {
return cp(cBold, v)
}
// Muted wraps v in dim.

Copilot uses AI. Check for mistakes.
Comment thread cmd/macaron/main.go
Comment on lines 252 to 258
if rate <= 0 {
fmt.Fprintln(os.Stderr, "error: --rate must be > 0")
cliui.Err("--rte (rate) must be > 0")
return 1
}
if threads <= 0 {
fmt.Fprintln(os.Stderr, "error: --threads must be > 0")
cliui.Err("--thr (threads) must be > 0")
return 1
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new validation errors mention --rte / --thr, but the CLI UX/docs largely present these as -rte / -thr (and users may also pass --rate / --threads via the alias mapping). Consider wording the error as something like -rte/--rate must be > 0 to match the surfaced flag names.

Copilot uses AI. Check for mistakes.
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.

3 participants